I have had no problem with texshop generating pdf files until I tried a new template today. When it compiles, texshop only generates dvi, not pdf. Any clues or suggestions? I clicked "typeset" with the drop down "Latex". There is no pdfLatex in my texshop.

The tex file:

\usepackage{url} % not crucial - just used below for the URL 



{#1}\small\normalsize} \spacingset{1}

\spacingset{1.45} % DON'T change the spacing!

Body of paper.  Margins in this document are roughly 0.75 inches all
around, letter size paper.


  • 1
    Those are the very first lines of the file? – cfr May 19 '16 at 3:05
  • There should be a menu which has compile options. One of them should read something like pdflatex -synctex=1 -interaction=nonstopmode %.tex pdflatex always compiles to pdf Your example compiles fine. – A Feldman May 19 '16 at 3:38
  • Somebody who uses a mac will most likely be able to help. Try using an alternative editor to rule out a problem with your TeX setup. A good one is TeXStudio texstudio.org which works on mac. Or you can try compiling at the command line. – A Feldman May 19 '16 at 3:50
  • Did you really show the complete document? – Ulrike Fischer May 19 '16 at 6:42
  • 1
    You guys are right. I did not show the very first line of the tex file, which I thought was a comment and can be ignored. The very first line is %&latex. Once I delete this line, I get pdf! Why? I thought everything that begins with a % is treated as a comment. – emmyray May 19 '16 at 21:00

TeX engines (the binaries which actually compile your document) recognise certain special comments in the very first line of the file. This works as several apparently different processes all resolve to the same underlying binary. In particular, both pdflatex and latex use the same binary, pdfTeX, but with different settings. If you have a first line that reads

% &latex

this is treated as though you gave the command

pdftex "&latex"

which means 'use the pdfTeX binary with the LaTeX format in DVI mode', even when you run pdflatex (which is the same as pdftex "&pdflatex").

This special parsing of the first line can be disabled, but normally it's only present if it's deliberately inserted (there are use cases where it is helpful).

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.