<html>#2638: documentation.tex assume to be a specific location relative to Cactus root directory
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Roland Haas</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td></td></tr>
</table>

<p>Currently the LaTeX documentation files must include a relative path to <code>cactus.sty</code> like so:</p>
<div class="codehilite"><pre><span></span><span>\usepackage{../../../../doc/latex/cactus}</span>
</pre></div>


<p>which, assuming the “typical” directory layout, accidentally works both when calling <code>pdflatex</code> directly (and manually) on the LaTeX input file in the source code location and via the various <code>-ThornDoc</code> and <code>-ThornGuide</code> make targets.</p>
<p>This is however fragile and fails if e.g. the thorn lives in a git repository of its own so that the directory layout is:</p>
<div class="codehilite language-text"><pre><span></span>Cactus
|
+- repos
   |
   +- ThornRepo
      |
      +- doc
         |
         +- documenation.tex
</pre></div>


<p>rather than the expected  </p>
<div class="codehilite"><pre><span></span><span>Cactus</span>
<span>|</span>
<span>+- repos</span>
<span>   |</span>
<span>   +- ArrRepo</span>
<span>      |</span>
<span>      +- Thorn</span>
<span>         |</span>
<span>         +- doc</span>
<span>            |</span>
<span>            +- documenation.tex</span>
</pre></div>


<p>or (the initially envisioned one assumes):</p>
<div class="codehilite"><pre><span></span><span>Cactus</span>
<span>|</span>
<span>+- arrangements</span>
<span>   |</span>
<span>   +- ArrangeMent</span>
<span>      |</span>
<span>      +- Thorn</span>
<span>         |</span>
<span>         +- doc</span>
<span>            |</span>
<span>            +- documenation.tex</span>
</pre></div>


<p>One way to handle this is to use conditionals to try both locations:</p>
<div class="codehilite language-tex"><pre><span></span><span class="k">\IfFileExists</span><span class="nb">{</span>../../../doc/latex/cactus.sty<span class="nb">}</span>
<span class="c">% then</span>
<span class="nb">{</span><span class="k">\usepackage</span><span class="nb">{</span>../../../doc/latex/cactus<span class="nb">}}</span>
<span class="c">% else</span>
<span class="nb">{</span><span class="k">\us
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2638/documentationtex-assume-to-be-a-specific'>https://bitbucket.org/einsteintoolkit/tickets/issues/2638/documentationtex-assume-to-be-a-specific</a></p>
</html>