我尝试运行代码,但是它没有给出任何 pdf 输出。为什么?
%&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}
%\RequirePackage[colorlinks,citecolor=blue,urlcolor=blue]{hyperref}
%\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.
\addtolength{\oddsidemargin}{-.5in}%
\addtolength{\evensidemargin}{-.5in}%
\addtolength{\textwidth}{1in}%
\addtolength{\textheight}{-.3in}%
\addtolength{\topmargin}{-.8in}%
\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}
这些信息是
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.
我很惊讶没有错误。有谁能帮我弄清楚如何输出 pdf 文件?
非常感谢。
答案1
由于 MWE 以 开头%&latex
,因此 TeXShop 用于latex
生成 DVI 输出,并且不生成 PDF。
要生成 PDF,应该使用%&pdflatex
,以便 TeXShop 自动使用pdflatex
来生成 PDF。
如果没有提供任何内容,那么它将使用pdflatex
并输出 PDF 文件。