Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use -output-directory=DIR with latexmk #144

Open
matteoacrossi opened this issue Feb 17, 2016 · 2 comments
Open

Use -output-directory=DIR with latexmk #144

matteoacrossi opened this issue Feb 17, 2016 · 2 comments

Comments

@matteoacrossi
Copy link

HI! Thanks for this great bundle!
I wonder if there is the possibility to make the -output-directory parameter work with latexmk. If I add the parameter to the options dialog in the Preferences window, it is simply ignored.

If I issue the command latexmk -pdf -output-dir=out file.tex from the Terminal I obtain the correct output inside the out directory.

@matteoacrossi matteoacrossi changed the title Use -output-directory=DIR with latexmk Use -output-directory=DIR with latexmk Feb 17, 2016
@sanssecours
Copy link
Member

Hi teored90,

I wonder if there is the possibility to make the -output-directory parameter work with latexmk.

currently this is not possible. I like the idea behind the option (keep the project directory clean). However, the way this option works is not that helpful, since latexmk also saves the output file (.pdf, .ps) in output-directory. For now, I will consider adding this feature sometimes in the future. Since I do not think that the feature is very useful, but requires larger changes to the bundle, it might take some time till I have a look at it.

If I add the parameter to the options dialog in the Preferences window, it is simply ignored.

The options specified in the preferences are for to the engine (pdlfatex, xelatex, …) and not for latexmk. pdflatex also supports the option -output-directory. For example the following command

pdflatex -output-directory output test.tex

stores all files in the directory output. For that to work, the directory output has to exist beforehand. Since all commands in the LaTeX bundle assume that the output file (.pdf, .ps) is located in the same directory as the master file, specifying the option -output-directory output inside the bundle preferences, will not be very helpful. “Typeset & View (PDF)” will simply fail to display the produced PDF.

If I issue the command latexmk -pdf -output-dir=out file.tex from the Terminal I obtain the correct output inside the out directory.

There is a small typo in your command. The option is either called -outdir= or -output-directory=.

Kind regards,
René

@SdotVdot
Copy link

SdotVdot commented Mar 15, 2019

It would be a nice feature.

A possible hack if you want to watch a file called foo.tex is to set a latexmkrc file as:
$pdf_previewer = 'open -a Skim';
$pdflatex = 'lualatex -synctex=1 -interaction=nonstopmode';
$out_dir = 'output';
@generated_exts = (@generated_exts, 'synctex.gz');

And then run:
latexmk -quiet -bibtex -pvc -f -pdf foo.tex

Finally you need to make a symbolic link:
ln -s output/foo.pdf foo.pdf

However, it would be better to have a similar feature in latex.tmbundle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants