LaTeX 仅打印文档的前两页

发布于 2024-08-29 18:11:39 字数 2852 浏览 10 评论 0原文

我正在 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} 

谢谢

彼得

I am working in LaTeX, and when I create a pdf file (using LaTeX button or pdfLaTeX button or using yap) the pdf has only the first two pages. No errors. It just stops. If I make the first page longer by adding text, it still stops at end of 2nd page. Any ideas?

OK, responding to first comment, here is the code

\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} 

thanks

Peter

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

就此别过 2024-09-05 18:11:39

LaTeX 宏 \section、\subsection 等旨在在其后添加一些文本。他们故意防止紧随其后的材料断裂。由于您有一系列的切片宏,没有其他任何东西,因此没有地方可以发生中断。如果您查看日志,您会看到一个过满的 vbox: 我明白

Overfull \vbox (712.84044pt too high) has occurred while \output is active []

这意味着 \box 255 的内容(实际上包含排版页面)太大,并且从底部溢出。由于部分命令从来没有打算像这样使用,因此您可能必须重新考虑您的方法,或者编写自己的版本,以免造成换行。

The LaTeX macros \section, \subsection and so on are intended to have some text after them. They deliberately prevent a break with the material immediately following. As you have a series of sectioning macros with nothing else, there is nowhere for a break to occur. If you look at your log, you'll see an overfull vbox: I get

Overfull \vbox (712.84044pt too high) has occurred while \output is active []

This means that the content of \box 255 (which actually contains the typeset page) is much too big, and runs off the bottom. As the section commands were never intended to be used like this, you may have to rethink your approach, or perhaps write your own versions that do not mess with the line-breaking.

花间憩 2024-09-05 18:11:39

在每个节和子节命令后面添加波形符 (~)。如果某个部分没有内容,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}

请参阅其他帖子以了解枚举环境的自定义。

Add a tilde (~) after each of these section and subsection commands. If you have no content for a section LaTeX will not break the box (a tilde is a non-breaking space and will count as content).

i.e.

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

To meet your goal (of an outline) it may be better to use nested enumerations:

\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}

See other posts for customization of enumeration environment.

心是晴朗的。 2024-09-05 18:11:39

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

我会做的是:

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

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

类似于对单个单词使用 \em 命令一次,并将文档的其余部分加粗。

More information is needed! Can you reproduce this behaviour with minimal document?

What I would've done is:

  1. Try removing all blocks of text and replacing them with a single word, but keep all latex commands. Can you still see the last block of text?
  2. Now try to remove all trivial latex commands (\subject{} formulas, etc.).
  3. If the problem still reproduce, try to remove one by one each suspected latex command until you've found the culprit.
  4. Google for the documentation of the offending command, and try to understand what went wrong.

My guess is, you used some TeX command which "switches" the state of the document, and somehow removes all text from a certain point.

Something like using the \em command once on a single word, and have the rest of the document boldface.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文