title: Create PDF with Anaconda Sphinx
body: <p>I am attempting to create documentation using sphinx. I do not have sudo permissions, but do have anaconda installed in my environment. I can successfully build HTML, but when I build PDF I am receiving errors and no PDF.</p>
  
  <h2>Steps</h2>
  
  <pre class="lang-sh prettyprint-override"><code>conda create --name jeff-sphinx
  conda activate jeff-sphinx
  conda install sphinx texlive-core
  </code></pre>
  
  <p>There is more, but the versions that get installed by default:</p>
  
  <pre><code>sphinx:                   1.8.2-py37_0           
  sphinxcontrib:            1.0-py37_1             
  sphinxcontrib-websupport: 1.1.0-py37_1    
  texlive-core:             20180414-hc8d0b01_0 
  </code></pre>
  
  <p>I can successfully build HTML with <code>make html</code></p>
  
  <p>Having HTML is half my battle. We also need some bundled format that can be sent to users that do not have access to HTML (because the instructions for setting up your network are in the documentation)... Acrobat and MS Word are the only readers available.</p>
  
  <p>When I attempt to run <code>make latexpdf</code>, I receive an error:</p>
  
  <pre><code>------------
  Running 'pdflatex   -recorder  "UserGuide.tex"'
  ------------
  warning: kpathsea: configuration file texmf.cnf not found in these directories:
  ... many directories ...
  This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
  
  </code></pre>
  
  <p>Is there some other configuration I need to do get <code>texlive-core</code> installed and working in my environment?</p>
  
  <h1>Attempts at Self-Help</h1>
  
  <p>I did do a search for <code>texmf.cnf</code> in the environment and found that it <em>is</em> present, but not on any of the configured paths. To try to circumvent the problem, I tried creating a symlink to remap the folders:</p>
  
  <pre><code>cd ~/.conda/envs/jeff-sphinx/share
  ln -s ./texlive/texmf-dist texmf-dist
  </code></pre>
  
  <p>Runs after this resulted in error messages about </p>
  
  <pre><code>------------
  Running 'pdflatex   -recorder  "UserGuide.tex"'
  ------------
  warning: ~/.conda/envs/jeff-sphinx/share/texmf-dist/web2c/texmf.cnf:540: (kpathsea) No cnf value on line: $SELFAUTOLOC ...more paths ...
  </code></pre>
  
  <p>At this point I assumed this was an invalid path to follow and backed out.</p>
  
  <p>I also tried changing the <code>sphinx</code> and <code>texlive</code> versions that were installed. Generally, this resulted in worse results (missing <code>pdflatex</code> for example). This could be because I had invalid combinations.</p>
  
  <h1>More Detail</h1>
  
  <h2>Full Output</h2>
  
  <p>Based on some feedback in the comments, I am including a output. I have sanitized paths.</p>
  
  <pre><code>The LaTeX files are in _build/latex.
  Run 'make' in that directory to run these through (pdf)latex
  (use `make latexpdf' here to do that automatically).
  make[1]: Entering directory `/home/jeff/Documents/projects/docs/doc/_build/latex'
  latexmk -pdf -dvi- -ps-  'UserGuide.tex'
  Latexmk: This is Latexmk, John Collins, 17 Jan. 2018, version: 4.55.
  Latexmk: applying rule 'pdflatex'...
  Rule 'pdflatex': File changes, etc:
     Non-existent destination files:
        'UserGuide.pdf'
  ------------
  Run number 1 of rule 'pdflatex'
  ------------
  ------------
  Running 'pdflatex   -recorder  "UserGuide.tex"'
  ------------
  warning: kpathsea: configuration file texmf.cnf not found in these directories: &lt;many directories&gt;.
  This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
  
  kpathsea: Running mktexfmt pdflatex.fmt
  warning: kpathsea: configuration file texmf.cnf not found in these directories: &lt;many directories&gt;.
  /home/jeff/.conda/envs/jeff-sphinx/bin/mktexfmt: kpsewhich -var-value=TEXMFROOT failed, aborting early.
  BEGIN failed--compilation aborted at /home/jeff/.conda/envs/jeff-sphinx/bin/mktexfmt line 25.
  I can't find the format file `pdflatex.fmt'!
  Latexmk: Errors, so I did not complete making targets
  Collected error summary (may duplicate other messages):
    pdflatex: (Pdf)LaTeX failed to generate the expected log file 'UserGuide.log'
  Latexmk: Did not finish processing file 'UserGuide.tex':
     (Pdf)LaTeX failed to generate the expected log file 'UserGuide.log'
  Latexmk: Use the -f option to force complete processing,
   unless error was exceeding maximum runs of latex/pdflatex.
  make[1]: *** [UserGuide.pdf] Error 12
  make[1]: Leaving directory `/home/jeff/Documents/projects/docs/doc/_build/latex'
  make: *** [latexpdf] Error 2
  </code></pre>
  
  <h2>Bin Paths</h2>
  
  <p>Running <code>which</code> on some utilities</p>
  
  <pre><code>$ echo perl pdflatex latexmk | xargs "which"
  
  /bin/perl
  /home/jeff/.conda/envs/jeff-sphinx/bin/pdflatex
  /home/jeff/.conda/envs/jeff-sphinx/bin/latexmk
  </code></pre>