sumatrapdf icon indicating copy to clipboard operation
sumatrapdf copied to clipboard

EnableTeXEnhancements reset itself

Open stevenlis opened this issue 6 years ago • 14 comments

I tried to disable double-click to open my Latex file, so I set

EnableTeXEnhancements = false

But it resets to true every time I close and reopen the program.

version: v3.1.2 64-bit
OS: Windows 10

stevenlis avatar Dec 03 '19 03:12 stevenlis

@StevenLi-DS [EDIT] see later post where I confirm I was wrong here That is most unusual. Having tested LaTeX in dozens of editors, I can't remember the false not disabling even if the default command of InverseSearchCmdLine = notepad %fis left in place. What WILL retrigger the setting to true is if the Editor during compilation calls SumatraPDF with the -inverse-search command, which is why in ALL editor configurations I advise against its use. (manually set it true ONCE only)

GitHubRulesOK avatar Dec 03 '19 03:12 GitHubRulesOK

I just tried to set it back to notepad %f, and retried. It still happened.

I just wanna disable double-clicking to show source LaTeX. Is there a way to do so? I can leave InverseSearchCmdLine blink but it will show a message whenever I double-click.

stevenlis avatar Dec 03 '19 04:12 stevenlis

I tried:

C:\Program Files\SumatraPDF\SumatraPDF.exe -reuse-instance

it seems a workaround for me but I don't know if this will just refresh the program or something.

stevenlis avatar Dec 03 '19 04:12 stevenlis

SumatraPDF looks at the filename PDF file folder location IF there is a similar filename.synctex or filename.synctex.gz alongside it will attempt on double click to run the synctex source.tex name with the stored command I just tested with 3.1.2 (without any LaTeX editor) and it DOES reset itself to true when the file is present thus a "feature" (so a bug for some) that I had forgotten You can remove the command in the "options dialog" (keep a copy in-case you want it back later) but that will give an error message that it cannot start inverse command ! The alternative is to delete the unwanted synctex file, some editors have clean-up options to remove auxillary files

GitHubRulesOK avatar Dec 03 '19 04:12 GitHubRulesOK

@kjk [EDIT] I previously said "for legacy reasons it is perhaps best to NOT change this behaviour"

however the more I think about it I see no reason for a double click to change the setting from false to true. It should be sticky as the user sets it, The situation where an editor uses -inverse-search to set the editor command IS the only reason to over-ride the user setting.

The prime reason for the setting is to expose the command entry box, however I am suggesting it bu used to signal/perform a secondary funtion

[Feature Request] Is to add yet another over-ride control (debug menu ?) to disregard synctex[.gz] files on demand ? [Feature request / BugFix] The EnableTeXEnhancements = false should STAY false UNLESS a specific command line -inverse-search call requests a CHANGE of InverseSearchCmdLine The slight delay while the new -inverse-search commandline is checked against current setting should only happen once SINCE I have always advocated that it should never have been a permanent setting in the editor. Those that follow poor legacy advice will soon see that folly.

The secondary natural use of setting Tex Enhancements to false should be to disable the double click synctex call

GitHubRulesOK avatar Dec 03 '19 04:12 GitHubRulesOK

Maybe add a command like “ignore” or “doing nothing”?

stevenlis avatar Dec 03 '19 04:12 stevenlis

I just realize this issue is more general. I changed the background in the setting file to be dark but sometimes I do need it to be white, so I comment out my setting:

FixedPageUI [
	TextColor = #f5f5f5
        BackgroundColor = #FFFFFF
#	BackgroundColor = #1a1a1a
	SelectionColor = #0080ff
	WindowMargin = 1 1 1 1
	PageSpacing = 2 2
]

But it will restore itself after I restart the program.

stevenlis avatar Dec 14 '19 06:12 stevenlis

@StevenLi-DS: So any change you make to SumatraPDF-settings.txt is getting reverted? Are you sure you have the necessary permissions to edit that file?

SumatraPeter avatar Dec 14 '19 21:12 SumatraPeter

@SumatraPeter these two issues are seperate however in both cases SumatraPDF will "correct" the settings.txt in opposition to user preference

Both "corrections" are understandable but user preference in each case should be allowable.

GitHubRulesOK avatar Dec 14 '19 22:12 GitHubRulesOK

@SumatraPeter If I have comments then it will be reset to the default.

stevenlis avatar Dec 14 '19 23:12 stevenlis

@SumatraPeter that's expected behavior.

The way saving preferences works is: we serialize current state of the program and write it out to settings file (if changed from the time we've read it).

If you make changes outside of sumatra, we'll over-write them.

kjk avatar Dec 15 '19 00:12 kjk

@SumatraPeter https://github.com/sumatrapdfreader/sumatrapdf/issues/1327

stevenlis avatar Dec 15 '19 01:12 stevenlis

I've moved my commented settings related discussion to #1327 since it fits better there.

SumatraPeter avatar Dec 15 '19 22:12 SumatraPeter

This issue is still occurring. It would be nice to disable the synctex and make it stick. A workaround I found is to set the inverse search command to rundll32.exe, which is a program that does nothing from no arguments (https://superuser.com/questions/381103/is-there-a-windows-exe-that-does-nothing) and doesn't cause an error message to pop up.

bandgeekdante avatar Apr 17 '24 20:04 bandgeekdante