Change the path where (the internal viewer of) TexStudio looks for the generated PDF file?

The preview of pdf cannot be seen when the output directory is changed?

The solution to this one is to enter the output directory (output in our example above), in Tools → Configure Texstudio → Build → Additional Search Paths → PDF Viewer

Click the Additional Search Paths checkbox in Tools → Configure → Build and enter the name of the output directory in PDF Viewer. Then click OK

PDF Viewer will look for the pdf file in output directory

You are done!


Similar to "Cursor on build error and temp build directory with TexStudio".

In TexStudio 2.5.2 on Linux the "PDF Viewer" path under "Additional Search Paths" does not seem to actually set the path. In my case, the newly-set output directory was not being passed to dvips or the viewer, resulting in the error:

Process started: dvips -o "filename".ps "filename".dvi
...
dvips: DVI file can't be opened: filename.dvi: No such file or directory
Process exited with error(s)

This can be solved by setting the paths manually. For example, if you were setting your directory to "/tmp":

Under Options -> Configure -> Commands

# Set the output directory with -output-directory
latex -src -interaction=nonstopmode -output-directory=/tmp %.tex
DVI Viewer: evince /tmp/%.dvi > /dev/null
PS Viewer: evince /tmp/%.ps > /dev/null
PDF Viewer: evince /tmp/%.pdf > /dev/null
dvips -o /tmp/%.ps /tmp/%.dvi

Under Build -> Additional Search Paths (to remove a log file error)

Log File: /tmp

I tried setting search paths, -aux-directory, etc. and manually setting the path as so was the only thing that worked for me.


I am using TeXStudio 2.11.2 on Windows 10.

However, I can not find Tools -> Configure Texstudio -> Build -> Additional Search Paths -> PDF Viewer.

So here is my solution:

  1. Options -> Save profile as *.txsprofile.

  2. Open your config file. Assume that you have changed the default build directory to ".\Tmp". Find and modify these lines:

Tools\Commands\view=txs:///view-pdf-internal --embedded "?a.\\Tmp\\?m.pdf"

Tools\Commands\view-pdf=txs:///view-pdf-internal --embedded

  1. Save and Options -> Load profile.
  2. Now, you can compile and build your tex, and see your pdf simutanouly on the embeded windows.

May you succeed.

Tags:

Texstudio