在标题页的底部边距区域添加文本框

在标题页的底部边距区域添加文本框

我正在尝试为我们的期刊创建一个类文件。我必须在标题页的底部空白区域添加一个包含一些有关出版社信息的文本框。但我在实验中没有得到我想要的结果。我的结果如下;

在此处输入图片描述

我的 MWE 是这样的;

% test.tex
\documentclass[11pt, a4paper, twocolumn]{article}
\usepackage[super,comma,sort&compress]{natbib}
\usepackage{abstract}
\renewcommand{\abstractnamefont}{\normalfont\bfseries}
\renewcommand{\abstracttextfont}{\normalfont\small}
\usepackage{lipsum}

% Any configuration that should be done before the end of the preamble:
\usepackage{hyperref}
\hypersetup{colorlinks=true, urlcolor=blue, linkcolor=blue, citecolor=blue}
\usepackage{geometry}
\geometry{top=1cm,bottom=1.5cm,left=2cm,right=2cm,includehead,includefoot,showframe}
\setlength{\columnsep}{6mm} % Column separation width
\usepackage[absolute]{textpos}
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}

%%%%%%%%%%%%%%%%%
% Configuration %
%%%%%%%%%%%%%%%%%
\title{Article Title}

\author{An Author}

\newcommand{\abstractText}{\noindent\lipsum[4]}
\renewcommand{\thefootnote}{\alph{footnote}}

\begin{document}
    
\begin{textblock}{185}(20,272)
    \noindent\rule{0.92\textwidth}{0.3mm}
    \noindent\fbox{%
        \parbox{0.9\textwidth}{%
        \vspace*{1mm}%
        {\footnotesize
        \textbf{E-mail:\,}[email protected]\\
        \textbf{Submitted:\,}00.00.0000
        \,\textbf{\,Revision Received:\,}00.00.0000
        \,\textbf{\,Accepted:\,}00.00.0000
        \,\textbf{\,Published Online:\,}00.00.0000}
      }
    }
\end{textblock} 
    %%%%%%%%%%%%
    % Abstract %
    %%%%%%%%%%%%
    
    \twocolumn[
    \begin{@twocolumnfalse}
        \maketitle
        \begin{abstract}
            \abstractText
            \newline
            \newline
        \end{abstract}
    \end{@twocolumnfalse}
    ]
    
    %%%%%%%%%%%
    % Article %
    %%%%%%%%%%%
    
    \section{Section Title 1}
    
    This is the first sentence\cite{ref1}.
    
    \section{Section Title 2}
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque\footnote{First footnote}. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat\cite{ref2}. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus\cite{ref3}. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum\footnote{Second footnote}.
    
    \section{Section Title 3}
 
    \lipsum[2]
    \subsection{Section Title 3.1}
    \lipsum[3]
    \nocite{*}
    
%%%%%%%%%%%%%%
% References %
%%%%%%%%%%%%%%

\begin{thebibliography}{99}
    \bibitem[Ref1, (2003)]{ref1} Ref1 journal, 2003
    \bibitem[Ref2, (2006)]{ref2} Ref2 journal, 2006
    \bibitem[Ref3, (2009)]{ref3} Ref3 journal, 2009
\end{thebibliography}   
\end{document}

在这个例子中,我使用textpos包来显示我想要的内容。但我不想使用这个包。因为这种用法会将框覆盖在边距区域上,而不会插入到页码上方。此设置仅适用于标题页,不适用于其他页面。

我该如何进行此类调整?


我的试用

很遗憾没有人回应。我相信有人知道这个问题的答案。我用这个afterpage包做了一些实验,但仍然得不到我想要的结果。

我修改的代码是beloe;

% test.tex
\documentclass[11pt, a4paper, twocolumn]{article}
\usepackage[super,comma,sort&compress]{natbib}
\usepackage{abstract}
\renewcommand{\abstractnamefont}{\normalfont\bfseries}
\renewcommand{\abstracttextfont}{\normalfont\small}
\usepackage{lipsum}

% Any configuration that should be done before the end of the preamble:
\usepackage{hyperref}
\hypersetup{colorlinks=true, urlcolor=blue, linkcolor=blue, citecolor=blue}
\usepackage{geometry}
\geometry{top=1cm,bottom=1.5cm,left=2cm,right=2cm,includehead,includefoot,showframe}
\setlength{\columnsep}{6mm} % Column separation width
\usepackage[absolute]{textpos}
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}

%------------------- these are added ---------------------------
\usepackage{afterpage}
\newcommand{\tpshrink}{
    \makeatletter
    \addtolength{\textheight}{-10mm}
    \addtolength{\footskip}{10mm}
    \makeatother
}

\newcommand{\tprestore}{
\makeatletter
\addtolength{\textheight}{10mm}
\addtolength{\footskip}{-10mm}
\makeatother
}
%------------------- these are added ---------------------------

%%%%%%%%%%%%%%%%%
% Configuration %
%%%%%%%%%%%%%%%%%
\title{Article Title}

\author{An Author}

\newcommand{\abstractText}{\noindent\lipsum[4]}
\renewcommand{\thefootnote}{\alph{footnote}}
\tpshrink  % <----------------  this is used to shrink title page -----------------
\begin{document}
    
\begin{textblock}{185}(20,261.5)
    \noindent\rule{0.92\textwidth}{0.3mm}
    \noindent\fbox{%
        \parbox{0.9\textwidth}{%
        \vspace*{1mm}%
        {\footnotesize
        \textbf{E-mail:\,}[email protected]\\
        \textbf{Submitted:\,}00.00.0000
        \,\textbf{\,Revision Received:\,}00.00.0000
        \,\textbf{\,Accepted:\,}00.00.0000
        \,\textbf{\,Published Online:\,}00.00.0000}
      }
    }
\end{textblock} 
    %%%%%%%%%%%%
    % Abstract %
    %%%%%%%%%%%%
    
    \twocolumn[
    \begin{@twocolumnfalse}
        \maketitle
        \begin{abstract}
            \abstractText
            \newline
            \newline
        \end{abstract}
    \end{@twocolumnfalse}
    ]
    
    \afterpage{\aftergroup\tprestore}  % < ---- this used to restore to the default BUT NOT WORKING!!!!!!   
    %%%%%%%%%%%
    % Article %
    %%%%%%%%%%%
    
    \section{Section Title 1}
    
    This is the first sentence\cite{ref1}.
    
    \section{Section Title 2}
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque\footnote{First footnote}. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat\cite{ref2}. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus\cite{ref3}. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum\footnote{Second footnote}.
    
    \section{Section Title 3}
 
    \lipsum[2]
    \subsection{Section Title 3.1}
    \lipsum[3]
    \nocite{*}
    
%%%%%%%%%%%%%%
% References %
%%%%%%%%%%%%%%

\begin{thebibliography}{99}
    \bibitem[Ref1, (2003)]{ref1} Ref1 journal, 2003
    \bibitem[Ref2, (2006)]{ref2} Ref2 journal, 2006
    \bibitem[Ref3, (2009)]{ref3} Ref3 journal, 2009
\end{thebibliography}   
\end{document}

在这次试验中,当我使用\tpshrink命令和注释\afterpage{\aftergroup\tprestore}行时,我得到了第一页我想要的结果,但下一页却不正确。

在此处输入图片描述

afterpage命令无法正常工作。它应该在分页后恢复页面设置,但它不起作用。

这该如何调整呢?

答案1

问题似乎与有关twocolumn。您需要\afterpage在第二列的开头调用。

为了做到这一点,我挂接到摘要的末尾并调用了\afterpage两次(由于某种原因,我无法让它在摘要之前工作)。

我改为使用\newgeometry\restoregeometry设置第一页边距,然后将文档其余部分恢复为默认值,而不是使用原语。

textpos一旦解决了边距问题,我认为使用并不是一件可怕的事情。

\documentclass[11pt, a4paper, twocolumn]{article}
\usepackage{lipsum}

% Any configuration that should be done before the end of the preamble:
\usepackage[super,comma,sort&compress]{natbib}

\usepackage{hyperref}
\hypersetup{colorlinks=true, urlcolor=blue, linkcolor=blue, citecolor=blue}

\usepackage{geometry}
\geometry{top=1cm,bottom=1.5cm,left=2cm,right=2cm,footskip=1cm,includehead,includefoot,columnsep=6mm,showframe}

\usepackage[absolute]{textpos}
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}

\makeatletter
\usepackage{abstract}
\renewcommand{\abstractnamefont}{\normalfont\bfseries}
\renewcommand{\abstracttextfont}{\normalfont\small}

\newcommand{\maketitleandabstract}{%
  \twocolumn[
    \begin{@twocolumnfalse}
      \maketitle
      \begin{abstract}
        \abstractText
        \newline
        \newline
      \end{abstract}
    \end{@twocolumnfalse}
  ]
  \afterpage{\aftergroup\adjfootskip}%
  \begin{textblock}{185}(20,261.5)
    \noindent\rule{17cm}{0.3mm}

    \noindent\fbox{%
      \parbox{0.9\textwidth}{%
        \vspace*{1mm}%
        {\footnotesize
          \textbf{E-mail:\,}\@email\\
          \textbf{Submitted:\,}\@submitted
          \,\textbf{\,Revision Received:\,}\@revisionreceived
          \,\textbf{\,Accepted:\,}\@accepted
        \,\textbf{\,Published Online:\,}\@publishedonline}
      }
    }
  \end{textblock} 
}

\usepackage{afterpage}
\newcommand*{\adjfootskip}{\afterpage{\aftergroup\restoregeometry}}
\AtBeginDocument{%
  \newgeometry{top=1cm,bottom=1.5cm,left=2cm,right=2cm,footskip=2.5cm,includehead,includefoot}
}

\newcommand*{\email}[1]{\gdef\@email{#1}}
\newcommand*{\submitted}[1]{\gdef\@submitted{#1}}
\newcommand*{\revisionreceived}[1]{\gdef\@revisionreceived{#1}}
\newcommand*{\accepted}[1]{\gdef\@accepted{#1}}
\newcommand*{\publishedonline}[1]{\gdef\@publishedonline{#1}}
\makeatother

%%%%%%%%%%%%%%%%%
% Configuration %
%%%%%%%%%%%%%%%%%
\title{Article Title}

\author{An Author}

\email{[email protected]}
\submitted{00.00.0000}
\revisionreceived{00.00.0000}
\accepted{00.00.0000}
\publishedonline{00.00.0000}

\newcommand{\abstractText}{\noindent\lipsum[4]}

\renewcommand{\thefootnote}{\alph{footnote}}

\begin{document}
%%%%%%%%%%%%
% Abstract %
%%%%%%%%%%%%

\maketitleandabstract

%%%%%%%%%%%
% Article %
%%%%%%%%%%%

\section{Section Title 1}

This is the first sentence\cite{ref1}.

\section{Section Title 2}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque\footnote{First footnote}. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat\cite{ref2}. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus\cite{ref3}. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum\footnote{Second footnote}.

\section{Section Title 3}

\lipsum[2]

\subsection{Section Title 3.1}

\lipsum[3]
\nocite{*}
    
%%%%%%%%%%%%%%
% References %
%%%%%%%%%%%%%%

\begin{thebibliography}{99}
    \bibitem[Ref1, (2003)]{ref1} Ref1 journal, 2003
    \bibitem[Ref2, (2006)]{ref2} Ref2 journal, 2006
    \bibitem[Ref3, (2009)]{ref3} Ref3 journal, 2009
\end{thebibliography}   
\end{document}

第一页

p1输出

第二页

p2输出

相关内容