Hallo TeXstudio-Team,
I use Sumatra 2.3.2 as external viewer for my portable TeXstudio 2.6.2. As command to start Sumatra I tried:
"C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" -reuse-instance "%.pdf" -forward-search "%.tex" @
and
dde:///"C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe":SUMATRA/control/[ForwardSearch("?am.pdf","?c:am.tex",@,0,0,1)]
From Sumatra I use:
"C:\<path>\texstudio.exe" "%f" -line %l</path>
When viewing the pdf from TeXstudio, Sumatra starts and shows the correct position. However, a double click in Sumatra starts a second instance of TeXstudio and jumps to the position. Why does Sumatra starts TeXstudio a second time?
To work around this problem one can close the first instance of TeXstudio, which closes Sumatra too. After that it is possible to start Sumatra from TeXstudio again and switch between Sumatra and TeXstudio correctly.
Kind regards,
Dirk
Anonymous
This may happen, if Sumatra changes the default temporary directory (TMP or TEMP environment variable) and then txs does not find the file saying it is running.
If you call Help/Check Latex Installation, what does it list for the TMP, TEMP and LOCK_NAME_OVERRIDE... variables? In the normal txs and the one started by Sumatra
Normal txs:
TEMP=C:\Users\<name>\AppData\Local\Temp
LOCK_NAME_OVERRIDE_qtsingleapp_TeXstu_c959_1=C:/Users/<name>/AppData/Local/Temp/qtsingleapp-TeXstu-c959-1-lockfile</name></name>
txs from Sumatra:
First an error occurs: Log File not found
Than the System Report shows:
TEMP=C:\Users\<name>\AppData\Local\Temp
LOCK_NAME_OVERRIDE_qtsingleapp_TeXstu_c959_1=C:/Users/<name>/AppData/Local/Temp/qtsingleapp-TeXstu-c959-1-lockfile</name></name>
Kind regards
Dirk
That looks okay.
Then it is some other issue.
But I cannot reproduce it.
How do you start texstudio? Did you try the same command you set in Sumatra?
Hey Benito,
I thought about it and notice, that I start TeXstudio with the "--start-always" option. Can you reproduce it with this option?
All best
Dirk
That's actually what the option is supposed to do.
If you use --start-always it is not considered a running txs instance
However, I only use it to start TeXstudio when clicking a txs or txss file, not in the option of Sumatra.
From the second instance, everything works as I expect.
because the 2nd instance is not started with the --start-always option
So starting TeXstudio a second time from Sumatra is the expected behaviour, if I start TeXstudio with --start-always? That sound a little bit weird to me.
if you start txs normally, then start another instance with --start-always, sumatra should open the file in the first instance, not in the 2nd one.
Therefore it is never opening a file in an instance started with --start-always.
Than I have this problem with the second instance, haven´t I?
I add the --start-always option to the registry of Windows, so it is not that easy to switch always the option.
Do you think it is a bug or a feature?
Ticket moved from /p/texstudio/bugs/770/
Hi, I have the same problem with the last versions of TeXstudio portable for Windows (since few months) but I'm not executing it with the option that Dirk used (--start-always).
As explained above:
but I don't have the problem described above:
I can close the first instance of TeXstudio without any problem (SumatraPDF still remains open).
I used these settings:
dde:///"path\SumatraPDF.exe":SUMATRA/control/[ForwardSearch("?am.pdf","?c:am.tex",@,0,0,1)]
and
"path\texstudio.exe" "%f" -line %l
Do you know any solution to this problem? (it's really annoying)
Thank you very much.
Last edit: trbvm 2015-11-25