我使用 Doxygen 来记录我的程序。Doxygen 创建了很多 tex 文件,我使用 TeX Live 从 tex 文件生成 pdf 文件。
它以前曾经起作用,但是现在,在我的源代码经过少量更改之后,出现了 latex 的编译警告,并且编译失败,尽管 Doxygen 文档没有问题。
新的警告如下:
`LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
还有许多警告,例如:
`LaTeX Warning: Reference `LastPage' on page 60 undefined on input line 170`.
编译结束于:
make: *** [refman.pdf] Error 1
exit code: 2(0 for SUCCESS).loggingLevel: 20. Build will exit.
我尝试重新运行了几次,但没有任何变化。有人能帮我吗?
编辑:这是我的主要 tex 文件:
\documentclass[oneside]{book}
% Packages required by doxygen
\usepackage{calc}
\usepackage{doxygen}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{makeidx}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{textcomp}
\usepackage[table]{xcolor}
% Font selection
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
\usepackage{amssymb}
\usepackage{sectsty}
\renewcommand{\familydefault}{\sfdefault}
\allsectionsfont{%
\fontseries{bc}\selectfont%
\color{darkgray}%
}
\renewcommand{\DoxyLabelFont}{%
\fontseries{bc}\selectfont%
\color{darkgray}%
}
% Page & text layout
\usepackage{geometry}
\geometry{%
a4paper,%
top=2.5cm,%
bottom=3.5cm,%
left=2.5cm,%
right=2.5cm,%
headheight=2.5cm%
}
\tolerance=750
\hfuzz=15pt
\hbadness=750
\setlength{\emergencystretch}{15pt}
\setlength{\parindent}{0cm}
\setlength{\parskip}{0.2cm}
\makeatletter
\renewcommand{\paragraph}{%
\@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%
\normalfont\normalsize\bfseries\SS@parafont%
}%
}
\renewcommand{\subparagraph}{%
\@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%
\normalfont\normalsize\bfseries\SS@subparafont%
}%
}
\makeatother
% Headers & footers
\usepackage{fancyhdr}
\usepackage{lastpage}
\pagestyle{fancy}
\lhead{\includegraphics[width=3cm]{doxygen-logo-header.jpg}}
\rhead{Page \thepage \ of\ \pageref{LastPage}}
\chead{\fancyplain{}{massage}}
\lfoot{\fancyplain{}{massage2}}
\cfoot{\fancyplain{}{massage3}}
\rfoot{\fancyplain{}{massage4}}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\chaptermark}[1]{%
\markboth{#1}{}%
}
\renewcommand{\sectionmark}[1]{%
\markright{\thesection\ #1}%
}
% Indices & bibliography
\usepackage{natbib}
\usepackage[titles]{tocloft}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{5}
\makeindex
% Hyperlinks (required, but should be loaded last)
\usepackage{ifpdf}
\ifpdf
\usepackage[pdftex,pagebackref=true]{hyperref}
\else
\usepackage[ps2pdf,pagebackref=true]{hyperref}
\fi
\hypersetup{%
colorlinks=true,%
linkcolor=blue,%
citecolor=blue,%
unicode%
}
% Custom commands
\newcommand{\clearemptydoublepage}{%
\newpage{\pagestyle{empty}\cleardoublepage}%
}
%===== C O N T E N T S =====
\begin{document}
% Titlepage & ToC
\pagestyle{empty}
\hypersetup{pageanchor=false}
\pagenumbering{roman}
\begin{titlepage}
\vspace*{7cm}
\begin{center}%
\includegraphics{doxygen-logo-pdf.jpg}\\[1cm]
{\Huge Library Reference }\\
\vspace*{1.5cm}
{\Large COMPANY}\\
{\large VERSION }\\
\vspace*{1cm}
\end{center}
\end{titlepage}
\fancypagestyle{plain}{\fancyhf{}%
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
\tableofcontents
\clearemptydoublepage
\pagenumbering{arabic}
\hypersetup{pageanchor=true}
\pagestyle{fancy}
%--- Begin generated contents ---
\chapter{Module Index}
\input{modules}
\chapter{Data Structure Index}
\input{annotated}
\chapter{File Index}
\input{files}
\chapter{Module Documentation}
\input{group}
\chapter{Data Structure Documentation}
\input{struct}
\chapter{File Documentation}
\input{file}
%--- End generated contents ---
% Index
\newpage
\phantomsection
\addcontentsline{toc}{part}{Index}
\printindex
\end{document}
问题似乎出在页面和文本布局上,如果我将“bottom=3.5cm,%”更改为“bottom=2.5cm,%”,它就可以正常工作。我不知道这是不是问题所在,或者这只是解决实际问题的一种方法,我正在寻找一个长期的解决方案,因为我的源文件经常更改,我不想每次都更改 tex 文件。
如果您在我的 tex 文件中发现问题,或者对我的问题原因有所了解,我将非常高兴。谢谢!