Closed memeplex closed 6 months ago
[18:42:47.862][Cleaner] Clean temporary files command The command is latexmk:["-c","%WS1%/test.tex"].
Method is not set to glob.
Right. But then there is a documentation issue, because in two places glob is documented as the default for latex-workshop.latex.clean.method
as I mentioned above.
But:
Moreover, even if method is not set to glob as documented, there are another misleading parts of the documentation:
In no part it is stated that this functionality depends on the clean method.
I will fix the wiki shortly.
Going back to the original problem, latexmk -c
must be called with the option -outdir
otherwise it cannot find the .fdb_latexmk
which contains all the information generated by latexmk.
latexmk -c must be called with the option -outdir
Yes, I'd thought about this and agree. Anyway, since the command is configurable it's better to be aware that you may break things if you change it. But as a default value using -outdir
would be more consistent with the documented behavior and other settings of LW. Thanks!
The Clean command doesn't seem to work for me either (in 9.19.1). I'm not sure whether I have understood correctly, but I consider .aux
, .blg
, .fdb_latexmk
, .fls
, .idx
, .ilg
, .ind
, .log
, .out
, .run.xml
, .synctex
, .synctex.gz
all temporary files. But they are left untouched:
My document consists of a subfiles-tree, could that make a difference?
Those seem to be files for separate compilations of specific files like appendix and boundary, not for dimension-paper which is the target of the clean command.
I'm not sure but I don't think it should be removing them.
The dimension-paper.tex
references appendix.tex
and others by subfiles like this:
The build of dimension-paper.tex
triggers the build of all files recursively. So it is then natural to expect that Clean reverts the Build; i.e. removes all temporary files of all subfiles recursively.
I don't use subfiles myself but my understanding (and a little test I did) is that it doesn't trigger separate compilations when you compile the main file (and I don't think that those separate compilations would make sense given how TeX works). See also the answer to question 3 here. Are you sure that you haven't separately compiled appendix.tex?
I deleted all temporarily files manually, and then rebuilt the root file dimension-paper.tex
. You are right that it only generates temporary files for dimension-paper.tex
.
The point of using subfiles is to chop down a long paper/book into manageable pieces which I can edit in isolation, to avoid long build times for previews when I modify something. So my writing consists of jumping to a specific subfile, and making many modify-build cycles for it. That generates the temporary files for the subfile. Logically everything under the subfile tree rooted under the root file is in the same project, so I would like to be able to clean all files in that "project".
I created this simple project:
test.tex
========
\documentclass{article}
\usepackage{subfiles}
\begin{document}
Pre
\subfile{subfile}
Post
\end{document}
subfile.tex
===========
\documentclass[test.tex]{subfiles}
\begin{document}
Inside
\end{document}
I built both files separately, so I now have aux files for both.
If I run clean when subfile.tex is active, I get these options:
The second one will remove the aux files for subfile.tex
I think that behavior is ok, but I understand that sometimes you would like to say "delete everything from this project". You could easily customize this with latex-workshop.latex.clean.method/command/args
or add a new task for that.
Moreover, if you're generating a ton of aux files from many different subfiles, it could be saner to just set a different outdir.
The situations where I'd need to Clean Everything are where seemingly the build process gets somehow stuck or confused, and it is not clear why (e.g. renaming subfiles may lead to something like this). In these situations I just do the nuclear option of deleting everything in the output directory, and the problem is then usually solved. I can certainly live with this, but it would be cool to be able to do it for Workshop directly.
@memeplex What do you mean a different outdir? I currently have the single output
directory for all subfiles. Do you mean having separate subdirectories for each subfile?
I currently have the single output directory for all subfiles. Do you mean having separate subdirectories for each subfile?
No, just this, I didn't realize that you were already doing it. I mean, for the exceptional situations when the build process is messed up and you need a clean start you can easily delete everything in the folder. But if you want to do it from LW, and if want to keep the ability to remove aux files separately in general but altogether for some particular situations, you can easily add a new recipe for the "nuclear option".
Also notice that you don't need to delete everything to fix the building, but just the aux files for the current file.
Good to know that deleting .aux
files suffice for a reset :) I don't really know the meaning of the various temporarily files. Maybe I'll then add the nuclear command myself.
Good to know that deleting
.aux
files suffice for a reset :) I don't really know the meaning of the various temporarily files. Maybe I'll then add the nuclear command myself.
No, this is a misunderstanding, I was referring to aux files in general (it's latexmk terminology), not to .aux files in particular. My point is that if the build for document.tex is broken you just need to remove aux stuff for document.tex and not for section.tex that is a subfile. Remember that each build completely ignores files for other builds, be them aux or out files. So "fixing a build" is not really a compelling use case for a "remove everything" option.
I see. If so, then I agree that "remove everything" does not seem that useful. Perhaps I'll be just fine with the current Clean.
Pre-checks*
Environment*
The Issue*
I've set
latex-workshop.latex.outDir
to"/tmp/latex-out"
. I built a simple document from LaTeX Workshop using the default latexmk recipe without any issue, the output and auxiliary files are in/tmp/latex-out
. But theClean up auxiliary files
command does nothing, although it works for the defaultlatex-workshop.latex.outDir
setting.I've also tried enabling
latex-workshop.latex.clean.subfolder.enabled
since it's documented that:but to no avail. Moreover, the value of
latex-workshop.latex.clean.method
is the default"glob"
, which:Perhaps I'm missing something, but I believe this should be working.
Reproduction Steps
latex-workshop.latex.outDir
to some directoryExpected Behavior
Auxiliary files are removed from outDir.
Logs
LaTeX Workshop Output*
Developer Tools Console