For a class I want to upload on CTAN, I'd like the provided files to be organized as follows when installed by TeX distributions:
〈ROOT PATH〉/doc/latex/myclass/
myclass.pdf
sample/sample.tex
sample/sample.pdf
README
...
〈ROOT PATH〉/tex/latex/myclass/
myclass.cls
...
〈ROOT PATH〉/source/latex/myclass
myclass.dtx
myclass.ins
...
where 〈ROOT PATH〉
will be the TeX distribution root path.
The source documentation file, 〈ROOT PATH〉/source/latex/myclass/myclass.dtx
, contains some code examples and "screenshots" coming from the auxiliary files:
〈ROOT PATH〉/doc/latex/myclass/sample/sample.tex
〈ROOT PATH〉/doc/latex/myclass/sample/sample.pdf
For maintenance reasons of the class' development version, these code examples and "screenshots" are directly imported in the myclass.dtx
source file from the sample.tex
and sample.pdf
auxiliary files, thanks to something like:
\lstinputlisting[linerange=...-...]{〈hard coded ROOT PATH〉/doc/latex/myclass/sample/sample.pdf}
...
\includegraphics[page=...]{〈hard coded ROOT PATH〉/doc/latex/myclass/sample/sample.pdf}
where 〈hard coded ROOT PATH〉
is my own texmf
tree. This works pretty well.
The trouble is that, when distributed by TeX distributions, this workflow will fail because, AFAIU, I'm likely unable to anticipate what TeX distribution 〈hard coded ROOT PATH〉
should be specified in \lstinputlisting
and \includegraphics
above, as it depends on:
- the TeX distributions,
- the OS.
Hence the user couldn't produce the documentation by running the .dtx
file.
Do you see a way to circumvent this problem?