Closed atticus-sullivan closed 2 years ago
Hm after some testing, I noticed with using cd
the use of input
is broken (and since tikzexternalize uses input
, this is broken too).
Still I see the use of output-directory
a problem, but now I've got no easy solution anymore. Any Ideas welcome
See this tex.stackexchange post for a discussion on this topic. For me I'm using the there described solution1 for now (not quite sure how long it will work since the paths/prefix aren't designed for that use).
Nevertheless if it's true what is mentioned there
-output-directory
just breaks a lot of packages. Then cluttex has to handle these packages somehow.
(whether this issue should be closed or not is up to you, my specific problem has solved, but if this is a more general problem, this problem will come up again and has to be solved somehow)
Follow up: After some source code reading I think you already tackle this issue by --change-directory
(adding the pwd to TEXINPUTS
helps that the files are still found (which was a problem of mine when just using cd
)). But as far as I see it when using this option output-directory
shouldn't be set in the final lualatex
(or what so ever) command as the working directory was already set to this directory.
After some testing I think there are some bugs regarding change-directory
. See for example this session:
$ ll
drwx------ user group 4 B 2021-12-12 23:47:44 ./
drwx------ user group 9 B 2021-12-12 22:47:30 ../
.rw------- user group 69 B 2021-12-12 23:47:14 main.tex
drwx------ user group 2 B 2021-12-12 23:47:32 tex-aux/
$ ll tex-aux/
drwx------ user group 2 B 2021-12-12 23:47:32 ./
drwx------ user group 4 B 2021-12-12 23:47:44 ../
$ cat main.tex
───────┬───────────────────────────
│ File: main.tex
───────┼───────────────────────────
1 │ \documentclass{article}
2 │
3 │ \begin{document}
4 │ Hello world
5 │ \end{document}
───────┴───────────────────────────
$ cluttex --output-directory=tex-aux -e lualatex --change-directory -shell-escape main.tex
/usr/bin/cluttex:1181: tex-aux/main.cluttexinit.lua: No such file or directory
$ mkdir tex-aux/tex-aux
$ cluttex --output-directory=tex-aux -e lualatex --change-directory -shell-escape main.tex # now it worked
because if change-directory
is set, all paths are relative to output-directory
, cluttex
tries to write to output-directory/output-directory
which is strange.
Maybe it would be best to keep paths absolute to ensure that the destination will not change even if change-directory
is used. Or is it possible to simply unset output-directory
if change-directory
is set (would only work if no other relative path was already derived from output-directory
I think)?
Fixed by PR #8
Hi, I've read that setting
-output-directory
for latex engines breaks many packages. So I thought of usingcd
instead of settingoutput-directory
(in effect this should be similar tocd <dir> && <latex-engine> ... && cp <output-file> ../
instead of<latex-engine> -output-directory <dir> && cp <dir>/<output-file> ./
).Is this possible with the current set of options?
If not can one avoid that
cluttex
setsoutput-directory
at all (so thatcd
etc can be handled by a Makefile on my own)?