【问题标题】:LaTeX printing only first two pages of a documentLaTeX 只打印文档的前两页
【发布时间】:2010-04-20 17:51:50
【问题描述】:

我在 LaTeX 中工作,当我创建一个 pdf 文件(使用 LaTeX 按钮或 pdfLaTeX 按钮或使用 yap)时,pdf 只有前两页。没有错误。它只是停止。如果我通过添加文本使第一页更长,它仍然会在第二页的末尾停止。有什么想法吗?

好的,回复第一条评论,这里是代码

\documentclass{article}
\title{Outline of Book}
\author{Peter L. Flom}
    \begin{document}
\maketitle
\section*{Preface}
     \subsection*{Audience}
     \subsection*{What makes this book different?}
     \subsection*{Necessary background}
     \subsection*{How to read this book}
\section{Introduction}
    \subsection{The purpose of logistic regression}
    \subsection{The need for logistic regression}
    \subsection{Types of logistic regression}
\section{General issues in logistic regression}
    \subsection{Transforming independent and dependent variables}
    \subsection{Interactions}
    \subsection{Model selection}
    \subsection{Parameter estimates, confidence intervals, p values}
    \subsection{Summary and further reading}
\section{Dichotomous logistic regression}
    \subsection{Introduction, theory, examples}
    \subsection{Exploratory plots and analysis}
    \subsection{Basic model fitting}
    \subsection{Advanced and special issues in model fitting}
    \subsection{Diagnostic and descriptive plots and analysis}
    \subsection{Traps and gotchas}
    \subsection{Power analysis}
    \subsection{Summary and further reading}
    \subsection{Exercises}
\section{Ordinal logistic regression}
    \subsection{Introduction, theory, examples}
       \subsubsection{Introduction - what are ordinal variables?}
       \subsubsection{Theory of the model}
       \subsubsection{Examples for this chapter}
    \subsection{Exploratory plots and analysis}
    \subsection{Basic model fitting}
    \subsection{Advanced and special issues in model fitting}
    \subsection{Diagnostic and descriptive plots and analysis}
    \subsection{Traps and gotchas}
    \subsection{Power analysis}
    \subsection{Summary and further reading}
    \subsection{Exercises}
\section{Multinomial logistic regression}
    \subsection{Introduction, theory, examples}
    \subsection{Exploratory plots and analysis}
    \subsection{Basic model fitting}
    \subsection{Advanced and special issues in model fitting}
    \subsection{Diagnostic and descriptive plots and analysis}
    \subsection{Traps and gotchas}
    \subsection{Power analysis}
    \subsection{Summary and further reading}
    \subsection{Exercises}
\section{Choosing a model}
    \subsection{NOIR and its problems}
    \subsection{Linear vs. ordinal}
    \subsection{Ordinal vs. multinomial}
    \subsection{Summary and further reading}
    \subsection{Exercises}
\section{Extensions and related models}
    \subsection{Other logistic models}
    \subsection{Multilevel models - PROC NLMIXED and GLIMMIX}
    \subsection{Loglinear models - PROC CATMOD}
\section{Summary}
\end{document} 

谢谢

彼得

【问题讨论】:

  • 尝试将\eject 放在\end{document} 之前。
  • 你应该使用\tableofcontents而不是滥用部分命令。
  • 谢谢大家。我现在意识到我滥用了切片命令。

标签: latex pdflatex


【解决方案1】:

LaTeX 宏 \section、\subsection 等是为了在它们后面加上一些文本。他们故意防止与紧随其后的材料中断。由于您有一系列没有其他内容的分段宏,因此无处可发生中断。如果你查看你的日志,你会看到一个过满的 vbox:我明白了

在 \output 处于活动状态时发生了 Overfull \vbox (712.84044pt too high) []

这意味着 \box 255 的内容(实际上包含排版页面)太大了,并且超出了底部。由于部分命令从未打算像这样使用,因此您可能需要重新考虑您的方法,或者可能编写自己的版本,以免与换行符混淆。

【讨论】:

    【解决方案2】:

    在每个部分和小节命令后添加波浪号 (~)。如果某个部分没有内容,则 LaTeX 不会破坏框(波浪号是不间断的空格,将计为内容)。

        \section*{Preface}~
             \subsection*{Audience}~
        ...
    

    为了实现您的目标(大纲),最好使用嵌套枚举:

    \begin{enumerate}
        \item Preface
        \begin{enumerate}
            \item  Audience
            \item  What makes this book different?
            \item  Necessary background
            \item  How to read this book
        \end{enumerate}
        \item Introduction
        \begin{enumerate}
            \item The purpose of logistic regression
            \item The need for logistic regression
            \item Types of logistic regression
        \end{enumerate}
        ...
    \end{enumerate}
    

    枚举环境的定制见其他帖子。

    【讨论】:

      【解决方案3】:

      需要更多信息!你能用最少的文档重现这种行为吗?

      我会做的是:

      1. 尝试删除所有文本块并用一个单词替换它们,但保留所有 Latex 命令。你还能看到最后一段文字吗?
      2. 现在尝试删除所有琐碎的乳胶命令(\subject{} 公式等)。
      3. 如果问题仍然存在,请尝试将每个可疑的 Latex 命令一一删除,直到找到罪魁祸首。
      4. Google 获取违规命令的文档,并尝试了解问题所在。

      我的猜测是,您使用了一些 TeX 命令来“切换”文档的状态,并以某种方式从某个点删除所有文本。

      类似于对单个单词使用一次\em 命令,然后将文档的其余部分设为粗体。

      【讨论】:

      • 您好 Elazar 感谢您的回复。本文件为大纲。没有文本块,没有 TeX 命令——文档中唯一的命令是 \section 和 \subsection 等等。没有公式。打印的部分看起来很好。它只是停在第 2 页的末尾,无论它在文档中的哪个位置(即,如果我删除一些行,它会打印更多的文档 - 任何适合 2 页的内容。彼得
      【解决方案4】:

      我仍然不确定发生了什么,但是当我在每个部分添加一点文本时,问题就消失了。

      【讨论】:

        【解决方案5】:

        所以我遇到了一个不同的问题,但我只想指出,当我在搜索类似的问题时,使用 Overleaf 编译我的 Latex 文档时,它停在 2 页,因为我没有正确结束分数(我有一个太少的端花括号)。不过,我是在查看日志后才发现这一点的。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2022-10-20
          • 2015-08-07
          • 1970-01-01
          • 2014-08-25
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多