Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

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.

share|improve this answer
    
yes, I did 'reconfigure' and then okular started to appear. Thanks! –  Ricky Robinson Sep 19 '12 at 22:29
add comment

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:

  1. Close LyX
  2. sudo apt-get remove okular (please note that this also remove kubuntu-desktop)
  3. lyx --> Now LyX use evince as viewer. Test it and close LyX again.
  4. sudo apt-get install okular
  5. lyx --> LyX still use evince. Thus, solved (I think).
share|improve this answer
1  
OK but if you do a Tools > Reconfigure it will go back to Okular. –  scottkosty Sep 19 '12 at 21:16
    
True, even when evince is the default viewer of Ubuntu!. Well... until we know the reason, do not do that, if you really do not like Okular. :-) Or better, do not install. –  Fran Sep 19 '12 at 23:13
    
The reason, in my opinion, is exactly what you said -- Evince is the default viewer in Ubuntu. If you install a program that is not the default program, if I had to make a guess, I would guess that you prefer the program that was installed, not the program that came with Ubuntu. I will add this to my answer since I think it helps understanding LyX's approach (according to my interpretation). –  scottkosty Sep 20 '12 at 6:05
add comment

This worked for me: Tools>Preferences>File Handling>File Formats choose 'PDF (pdflatex)' in 'Format' and 'evince' in 'Editor' and Save

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.