亲爱的 LaTeX 用户们,
我是该领域的新手,必须从相对复杂的文档模板(PNAS 研究文章模板)开始。相应的文件可以在以下位置获取:http://www.pnas.org/page/authors/latex
模板包含一个带有所谓“重要性陈述”的框/对象。根据我选择的介绍的长度,框会移动到下一页。第一段的原始长度存在一定的阈值,这使得这种情况可以重现。我认为这不应该发生,因为 PNAS 的所有文章都在第一页的左下角右侧(参见我的 2 张截图)
主界面中没有任何东西可以设置这个“盒子”的位置.tex文件,但我在“主要”中发现以下内容.sty文件(参见下文)。我尝试查找它,我猜“afterpage”确实将其放在了下一页?这应该发生吗?为什么在段落长度达到阈值后才会发生这种情况?我该如何修复它,使其不移动到下一页?
\RequirePackage{float}
\floatstyle{plain}
\newfloat{sigstatement}{b!}{sst}
\additionalelement{%
\afterpage{\begin{sigstatement}
\sffamily
\mdfdefinestyle{pnassigstyle}{linewidth=0.7pt,backgroundcolor=pnasblueback,linecolor=pnasbluetext,fontcolor=pnasbluetext,innertopmargin=6pt,innerrightmargin=6pt,innerbottommargin=6pt,innerleftmargin=6pt}
\@ifundefined{@significancestatement}{}{%
\begin{mdframed}[style=pnassigstyle]%
\section*{Significance Statement}%
\@significancestatement
\end{mdframed}}
% \medskip
\scriptsize
\@ifundefined{@authorcontributions}{}{\@authorcontributions}
\vskip5pt%
\@ifundefined{@authordeclaration}{}{\@authordeclaration}
\vskip5pt%
\@ifundefined{@equalauthors}{}{\@equalauthors}
\vskip5pt%
\@ifundefined{@correspondingauthor}{}{\@correspondingauthor}
\end{sigstatement}}
}
非常感谢
答案1
之所以有这个\afterpage
命令,是因为重要性语句是一个浮点数,这确保了即使第一页上有其他浮点数,它仍然位于列的底部。
您之所以看到这种情况,是因为第一段非常长,而 LaTeX 在第一页上找不到空间容纳重要性陈述,因此它会移至下一页。尝试将该文本分成多个段落,问题就会消失。
请注意下面的示例(顺便说一句,您通常应该在问题中提供 MWE),如果您将blindtext
第一段中的重复值设置为 10 或更大,则第一页上没有空间容纳整个段落,因此会发生您看到的行为。如果您将其设置为 9,第一段的结尾仍然在第二页,但这是因为如果没有重要性陈述,就会有空间容纳它。
\documentclass[9pt,twocolumn,twoside,lineno]{pnas-new}
\templatetype{pnasresearcharticle}
\usepackage{blindtext}
\title{Template for preparing your research report submission to PNAS using Overleaf}
\author[a,c,1]{Author One}
\author[b,1,2]{Author Two}
\author[a]{Author Three}
\affil[a]{Affiliation One}
\affil[b]{Affiliation Two}
\affil[c]{Affiliation Three}
\leadauthor{Lead author last name}
\significancestatement{Authors must submit a 120-word maximum statement about the
significance of their research paper written at a level understandable to an undergraduate
educated scientist outside their field of speciality. The primary goal of the Significance
Statement is to explain the relevance of the work in broad context to a broad readership.
The Significance Statement appears in the paper itself and is required for all research papers.}
\authorcontributions{Please provide details of author contributions here.}
\authordeclaration{Please declare any conflict of interest here.}
\equalauthors{\textsuperscript{1}A.O.(Author One) and A.T. (Author Two) contributed equally to this work (remove if not applicable).}
\correspondingauthor{\textsuperscript{2}To whom correspondence should be addressed. E-mail: author.two\@email.com}
\keywords{Keyword 1 $|$ Keyword 2 $|$ Keyword 3 $|$ ...}
\begin{abstract}
Please provide an abstract of no more than 250 words in a single paragraph. Abstracts should
explain to the general reader the major contributions of the article. References in the
abstract must be cited in full within the abstract itself and cited in the text.
\end{abstract}
\dates{This manuscript was compiled on \today}
\doi{\url{www.pnas.org/cgi/doi/10.1073/pnas.XXXXXXXXXX}}
\begin{document}
\maketitle
\thispagestyle{firststyle}
\ifthenelse{\boolean{shortarticle}}{\ifthenelse{\boolean{singlecolumn}}{\abscontentformatted}{\abscontent}}{}
\dropcap{T}his PNAS journal template is provided to help you write your work in the correct
journal format. Instructions for use are provided below. \blindtext[9]
\blindtext[10]
\end{document}
输出:
答案2
不知为何我无法登录我的旧账户。我是提问者“Andrew”。
解决方案:
使用 Overleaf 直接提供的 LaTeX 模板,而不是 PNAS 网页提供的模板!尽管文本完全相同,但我再也没有遇到过这个问题!