In LyX, how can I set Ubuntu's document viewer (Evince) as the preferred PDF reader for the generated PDF files?
All of a sudden it started using Okular, which I don't like all that much.
Go to Tools > Preferences > File Handling > File Formats. Choose the file format. I am guessing that you want PDF (pdflatex). Change "viewer" to "evince". You are done.
The reason it all of a sudden started using Okular is because you installed Okular after you installed LyX and you did Tools > Reconfigure (or you did something that triggered that).
Why does LyX favor Okular over Evince. Here is my interpretation: Evince is the default viewer in Ubuntu. Suppose you install a program that is not the default program (e.g. Okular). If I had to make a guess as to whether you prefer Evince or Okular, I would guess that you prefer Okular because you went to the trouble to install it, not the program that came with Ubuntu.
custom you can't put the full path there. It stupidly doesn't work. Instead you have to put just the name of the program file (e.g. SumatraPDF.exe) and then add the path in Tools->Preferences->Paths->PATH Prefix I use a newer version of Lyx (version 2.1.4) and I can no longer follow the answers here. The problem is the same, which is that the default pdf viewer is changed to okular after I do the "reconfigure." What I did to solve the problem is the followings.
/.lyx. There a lyxrc.defaults which contains many key-value pairs for Lyx configurations.cp lyxrc.defaults lyxrc.defaults.bkp.lyxrc.defaults to replace all occurrences of okular with evince.I cannot explain why, but that worked for me:
In LyX 2.0.4 in Tools > Preferences must be something as
okular --unique "file:$$o#src:$$n $$t" that you can change to other options, as evince:
synctex view -i $$n:0:$$t -o $$o -x "evince -i %{page+1} $$o" In theory, that must be enough. This change must be saved in ~\.lyx\preferences.
However, I was surprised because in my Ubuntu this change does nothing, even after several reconfigure and restart (bug or feature?).
So I tried, maintaining the above evince configuration:
sudo apt-get remove okular (please note that this also remove kubuntu-desktop) lyx --> Now LyX use evince as viewer. Test it and close LyX again.sudo apt-get install okular lyx --> LyX still use evince. Thus, solved (I think).This worked for me: Tools>Preferences>File Handling>File Formats choose 'PDF (pdflatex)' in 'Format' and 'evince' in 'Editor' and Save