# Fail to give output pdf without any error

I tried to run the code, however, it does not give any pdf output. Why?

%&latex
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{graphicx,psfrag,epsf}
\usepackage{enumerate}
\usepackage{natbib}
\usepackage{url} % not crucial - just used below for the URL
%\RequirePackage{gensymb}
%\usepackage{placeins}

\pdfminorversion=4
% NOTE: To produce blinded version, replace "0" with "1" below.
\newcommand{\blind}{0}

% DON'T change margins - should be 1 inch all around.

\begin{document}

%\bibliographystyle{natbib}

\def\spacingset#1{\renewcommand{\baselinestretch}%
{#1}\small\normalsize} \spacingset{1}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    %%%

\if1\blind
{
\title{\bf I am a title}
\author{Name}
\maketitle
} \fi

\if0\blind
{
\bigskip
\bigskip
\bigskip
\begin{center}
{\LARGE\bf I am a title}
\end{center}
\medskip
} \fi

\bigskip
\begin{abstract}
The text of your abstract. 200 or fewer words.
\end{abstract}

\noindent%
{\it Keywords:}  3 to 6 keywords, that do not appear in the title
\vfill

\newpage
\spacingset{1.45} % DON'T change the spacing!
% --------------------------------------------------- %
\section{Introduction}
\label{sec:intro}

\end{document}


The messages are

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the ?' option.
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/dvips.def)))
(/usr/local/texlive/2016/texmf-dist/tex/latex/psfrag/psfrag.sty)
(/usr/local/texlive/2016/texmf-dist/tex/generic/epsf/epsf.sty
This is epsf.tex' v2.7.4 <14 February 2011>
) (/usr/local/texlive/2016/texmf-dist/tex/latex/tools/enumerate.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/natbib/natbib.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/url/url.sty) (./test.aux)
[1] [2] (./test.aux) )
Output written on test.dvi (2 pages, 864 bytes).
SyncTeX written on test.synctex.gz.
Transcript written on test.log.


I am surprised there is no error. And any one could help me to figure how to output a pdf. file?

Thanks very much.

• Inorder to get a PDF output, you should use pdflatex instead of latex. Now the output is test.dvi. Run pdflatex test to generate the PDF. – Jagath Jul 9 '16 at 13:39
• Thanks very much for helping out. However, I am using Texshop in macbook. I found there is no pdflatex option. Do you have any idea of how to running pdflatex in macbook? – Po Ning Jul 9 '16 at 14:37
• Remove the first line (% &latex) if you want a .pdf file. – Bernard Jul 9 '16 at 15:27
• Please change %&latex to %&pdflatex. – Jagath Jul 9 '16 at 15:46

As the MWE starts with %&latex, TeXShop uses latex to generate DVI output and no PDF was generated.
To generate a PDF, one should use %&pdflatex, so that TeXShop automatically uses pdflatex to generate the PDF.
If nothing is provided, then it will use pdflatex and output a PDF file.