compile directly to latex pdf

Currently to get pdf output for tex files, broadly speaking, it’s a two step process: using Scrivener/multi-markdown to compile a new tex file, and then using some separate latex editor to compile that new file to pdf. My thought is to give Scrivener the option to compile documents written in latex format directly to pdf.

This would greatly simplify the document production and revision process, with Scrivener being used for both it’s great organization tools and directly producing well formatted pdf output.

Just a thought…

Hi Bill,

This is already possible, as long as you have the necessary LaTeX > PDF tools installed and Scrivener can find them. For instance, if you install MacTeX and restart Scrivener, you will find a MultiMarkdown > PDF menu item appears with the other MultiMarkdown menu items in the Compile formats menu.

All the best,
Keith

It could be the LaTeX distribution that you use places pdflatex in a different location that Scrivener is looking for it. If you copy and paste the following into Terminal and hit return, you should see /usr/texbin/pdflatex as the result:

which pdflatex

If you see something other than what I provided above, it may work to place a symbolic link there, pointing back to the real location. After that you may need to reload your project, but I think you can just reload compile and check the “Compile For” menu for MMD->PDF at the very bottom.

Thank you Keith and AmberV for letting me know that Scrivener can already compile Latex to pdf with its built in MultiMarkdown functionality. Apparently I have homework to do.

Bill

Because of SIP (introduced in recent Mac OS), even if you have mactex installed, which pdflatex will very likely not show /usr/texbin/pdflatex

SIP is system integrity protection and is new in recent Mac OS releases. You can disable SIP read more here apple.stackexchange.com/question … os-x-10-11 and then place a symbolic link like scrivener expects

sudo mkdir -p /usr/texbin sudo ln -s $(which pdflatex) /usr/texbin/pdflatex

Don’t blame SIP. SIP is a very good change in recent Mac OS. I recommend against disabling SIP. Instead, I request scrivener dev team to reconsider looking for pdflatex on the system path in other locations such as /usr/local or /Library/TeX/texbin/pdflatex or the likes

and while l&l update scrivener to look elsewhere not at /usr/texbin/pdflatex

you can temporarily disable SIP, add symlink and enable SIP.

and if you want to use xelatex (say for unicode support) instead of pdflatex

[code]    which xelatex
/Library/TeX/texbin/xelatex[/code]

You run this instead the earlier steps I indicated above.

sudo mkdir -p /usr/texbin sudo ln -s $(which xelatex) /usr/texbin/pdflatex

This way scrivener will be tricked into running xelatex instead of pdflatex.

I tried this and the latex compile produced lots of errors. It looked as if other files in the texbin folder were needed.

So instead I created a symbolic link to the folder, with this command.

sudo ln -s /Library/TeX/texbin /usr/texbin

This produced an error-free compile to pdf.

As you pointed out, you have to disable SIP http://apple.stackexchange.com/question%20…%20os-x-10-11 in order to do this.

I find the need to hack the OS a little bit disconcerting and I think it would be better if this could be fixed by providing the ability of configuring the link in Scrivener, or by fixing scrivener so that it searches for the latex distribution.