I'm writing a document using eps graphics so I need to compile with Latex to produce a dvi file. In that file graphics don't show (they're a combination of .tex and .eps files), but if I do dvipdf file.dvi then the produced file.pdf shows all graphics perfectly.

I was trying to create a new command in AucTex to execute dvipdf file.dvi directly from emacs instead of opening the terminal, but I don't understand the syntax, for example in the Latex run command:

%`%l%(mode)%' %t

So what would I need to write in a command to execute the line dvipdf file.dvi?

Thank you.

  • Not AUCTeX-based, but you can use XeTeX to include the EPS and produce a PDF directly. Just compile with xelatex instead of pdflatex. – Sean Allred Apr 25 '15 at 20:34
  • @SeanAllred My document is in spanish, with characters like à è ì ò ù, and using xetex produces a pdf correctly but throws an error about Unicode char \u8:ón\kern\z@ not set up for use with LaTeX. and removes all those characters from the produced file – MyUserIsThis Apr 25 '15 at 20:40
  • That's very strange – would you mind throwing up a small document that shows the issue on pastebin or as a gist? I've never seen XeTeX have trouble with this. – Sean Allred Apr 25 '15 at 20:41
  • @SeanAllred There you go: pastebin.com/GAxDwTQu I'm compiling it with the default XeTeX option of AucTex from emacs. Instead of Introducción, it displays "Introducci", it doesn't even display the "n" of the end of the word. – MyUserIsThis Apr 25 '15 at 21:07
  • Looks like it's just an issue with the font – there's no small-caps glyph for it. Using a different font (e.g. \usepackage{fontspec}\setmainfont{Hoefler Text}) fixes the issue. – Sean Allred Apr 25 '15 at 21:09

Use TeX-command-list for this job :)

  '("DVI to PDF"
    "dvipdf %d"
    nil                              ; ask for confirmation
    t                                ; active in all modes
    :help "Convert DVI->PDF"))

To add a command to view the PDF, use

  '("View PDF"
    "open %s.pdf"
    nil                              ; ask for confirmation
    t                                ; active in all modes
    :help "View PDF"))

You can find more information on the syntax of these format strings with C-h v TeX-command-list and C-h v TeX-expand-list.

  • I was trying to create another one to open the final produced pdf file: evince file.pdf. I was looking into TeX-expand-list but there's no %X for pdf, it only has %f for .ps and %d for dvi. There is an %o option I guess can be used to do so, but I can't figure it out. How could I do this? – MyUserIsThis Apr 25 '15 at 23:16
  • @MyUserIsThis Wouldn't you just use the built-in View command? – Sean Allred Apr 26 '15 at 3:34
  • I would, but when you compile with the standard Latex the view command opens the dvi file (not showing everything), so I was trying to create a new one to open the pdf created with the DVI to PDF command. – MyUserIsThis Apr 26 '15 at 10:13
  • @MyUserIsThis see edit – Sean Allred Apr 26 '15 at 14:49
  • Thank you very much. I tried out several combinations and that one wasn't one of them. – MyUserIsThis Apr 26 '15 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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