0

I was trying to use package minted to insert Python code in my document and now succeeded in compiling and could generate the correct PDF file. I followed this thread which said it's better to create your own user command contained

pdflatex -shell-escape -synctex=1 -interaction=nonstopmode %.tex

But using this command to compile will not pop up the internal pdfviewer as using F5 to compile.

I tried goto

Options > Configure TeXStudio > Commands

and changed

pdflatex -synctex=1 -interaction=nonstopmode %.tex

into

pdflatex -shell-escape -synctex=1 -interaction=nonstopmode %.tex

then compiled through F5 again. This time it compiled correct and pop up the internal pdfviewer.

How can I still using user command but have internal pdfviewer at the same time?

1

Under Configure TeXstudio -> Build -> User commands, you can 'stack' the commands with the | character, so something like:

pdflatex --shell-escape -synctex=1 -interaction=nonstopmode %.tex | txs:///view-pdf

should work. (see red box)

enter image description here

Alternatively, you can click the 'Spanner' icon (blue box in pic) to configure the Quick build command, in which you can add TXS-specific commands to the list, including view-pdf:

quickbuild

  • I did what you showed in the image, but it did't work. It still compiled succeeded but no viewer pop up. – Adam_Hu Feb 26 '18 at 1:19
  • @Adam_Hu Take screenshots of what you have on your TXS settings. Specifically the equivalent of the two windows shown in my answer. And add it into your question in an edit. – Troy Feb 26 '18 at 7:44
  • @Adam_Hu Also, what pdf viewer are you using -- internal or external? What TeXstudio version are you using? – Troy Feb 26 '18 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.