I'm working collaboratively on a tex document, and this magic comment appeared on top of the main file (because I guess someone is using TeXShop or TeXworks):
%!TEX TS-program = pdflatex
I think TeXstudio doesn't really like this magic comment, because it causes the intenal PDF viewer not to start. In particular, TeXstudio always launches the external viewer rather than the internal one, even if the latter is set as the default via Settings -> Build -> Default Viewer = txs:///view-pdf-internal --embedded.
I couldn't find a way to make TeXStudio ignore the magic comment. Is it possible?
-- Just an additional point. Of course I can very easily comment the line with an additional % and it will work just fine. I am asking for a way to do this with some option because we're versioning tex files with git, and it's impractical if this other guy and I constantly comment/uncomment the line whenever we have to compile before pushing our changes.
Works fine here.
Help -> Check LaTeX Configuration
and provide the part "Command configuration in TeXstudio"I am using TeXstudio 2.12.2, and the command I'am using that bound to the magnifier lens button, I guess "txs:///view-pdf-internal --embedded".
There's the point. This button is button is bound to
PDF Viewer (view-pdf)
which is set up to use the external viewer. Change it totxs:///view-pdf-internal --embedded
and you'll be good.This is funny, I didn't know it was supposed to be that way. So why does the lens button show the embedded viewer when I comment the line out, even if it is set to view-pdf-external?
Here is some testing I have done:
1. Line commented, view-pdf-external -> embedded viewer
2. Line commented, view-pdf-internal --embedded -> embedded viewer
3. Line uncommented, view-pdf-external -> external viewer
4. Line uncommented, view-pdf-internal --embedded -> embedded viewer
Case 1 seems weird, and is the way I always used TXS, without knowing, until now. I always thought the lens was bound to the internal viewer.
1 seems weird indeed. Please provide a minimal example file.
Actually, the minimal example is really really minimal (I think this has to do with some TeXstudio setting, rathern than with latex).
Compiling this and clicking on the magnifier lens button doesn't open the external viewer, even if PDF Viewer (view-pdf) is bound to txs:///view-pdf-external.
The viewer opens correctly after clicking on the lens button if on the other hand I compile this:
Well, my statement above on the view button was not exact.
Under normal circumstances, the view button is bound to
txs:///view
. When you define a specific compiler using%!TEX TS-program
it gets reassigned totxs:///view-dvi
forlatex
and totxs:///view-pdf
forpdflatex
,xelatex
andluatex
/lualatex
(for internal reference: Texstudio::commandLineRequested).Generally, it is good practice (and default) to set
txs:///view
totxs:///view-pdf
and define the viewer details intxs:///view-pdf
so, won't fix ?
To be discussed. see my personal mail.
Code changes as a result of this report.
hg 6415 (70a7aa5a3407):
remove pdf viewer subtypes from "Default Viewer" config
The "Default Viewer" should only select between dvi/ps/pdf. PDF viewer subtypes
should be selected in "PDF Viewer".
hg 6417 (74c3060c4fad)
option to deactivate interperation of command definition in magic comments
This should make it more obvious and better to control.