标题未使用 LaTeX 呈现

问题描述

所以我有以下文件

while(True):
    if socket_client.recv(1024):
        updatestock = socket_client.recv(1024)
        updatestock2 = pickle.loads(updatestock)
        print(updatestock2)
        if updatestock2 == "Quit":
            break
        else:
             update()
mydb.close()
socket_client.close()

我的 preamble.tex 文件内容是:

\include{preamble}


\title{test title}

\begin{document}


\maketitle



\begin{equation*}
    \begin{aligned}
       \pi\sqrt{\pi\sqrt{\pi\sqrt{\pi\sqrt{\pi\sqrt{\pi\dots}}}}}
    \end{aligned}
\end{equation*}
    



\bibliographystyle{plain}
\bibliography{references}
\end{document}

出于某种原因,当我编译代码时,标题不会包含在 pdf 中,我确定我在正确的位置有 \title{} 和 \maketitle。任何有关为什么会这样的帮助将不胜感激。

解决方法

将标题移到 \begin{document} 之后:

\documentclass{revtex4}   

\begin{document}

\title{test title}
\maketitle

\end{document}

enter image description here

(不要对其他文档类这样做。大多数情况下,最好在序言中使用 \title,例如,如果与 hyperref 结合使用,可以获得合理的 pdf 元数据)