我想在 LaTex 中制作这个模板,在页眉两侧加上两个徽标,并在示例中加上小页脚,但是,我尝试使用 fancyhdr 并设置一个新的样式页面或单独放置图像,但什么也没发生。
我的代码:
\documentclass[11pt,letter,twoside,twocolumn]{article}
%SIZES AND MARGINS
\special{papersize=8.5in,11in}
\usepackage[paperheight=27.94cm,paperwidth=21.59cm,top=1.69cm,bottom=3cm,inner=1.99cm,outer=2.74cm]{geometry}
% fancy headers/footers
\usepackage{fancyhdr,color}
\usepackage{tabularx}
\pagestyle{fancy}
\chead{\footnotesize{Author/ Revista DYNA, 87(213), pp. 148-158, April - June, 2021}}
\lhead{}
\rhead{}
\cfoot{\footnotesize\thepage}
\renewcommand{\headrulewidth}{0pt}
\setlength{\voffset}{-10mm}
\setlength{\topmargin}{0mm}
\setlength{\headheight}{5mm}
\setlength{\headsep}{5mm}
\setlength{\footskip}{10mm}
%for the numbers date's
\usepackage[super]{nth}
%LANGUAGES
\usepackage[utf8]{inputenc}
\usepackage[english,]{babel} % Idiomas add %spanish,es-noshorthands
\usepackage{titling}
\usepackage{setspace}
%MATH
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{authblk}
% para poder introducir varias figuras que ocupen el ancho de las dos columnas.
\usepackage{subfigure}
\usepackage{graphicx}
% for dummy text
\usepackage{lipsum}
%------------ TITLE-------------------------------%
\setstretch{1.0}
\title{\LARGE\textbf{State of stress in the main shaft of a coffee pulper machine\vspace*{-12pt}}}
\author[a]{Valentina Mejía Gallón}
\author[a]{Sebastián Gómez Duran}
\author[a]{Andrés Felipe Jaramillo}
\author[a]{Simón González Zapata}
\affil[a]{\footnotesize{\textit{Facultad de Minas, Universidad Nacional de Colombia, Medellín, Colombia, [email protected], [email protected], [email protected], [email protected]}}}
\renewcommand\Authands{ \& } % change "and" for &
\date{\vspace*{-60pt}}
%------------ MAIN DOCUMENT------------------------------------%
\begin{document}
\setcounter{page}{1}
\twocolumn[
\begin{@twocolumnfalse}
\begin{titlingpage}
\maketitle
\end{titlingpage}
\begin{center}
\scriptsize{Received: July \nth{10}, 2021. Received in revised form: August \nth{3}, 2021. Accepted: November \nth{25}, 2021.}\vspace*{5pt}
\end{center}
%-----ABSTRACT-----%
\footnotesize\textbf{Abstract}
\footnotesize{This is an example of an article formatted for our journal. Note that this text is typed in Times New Roman, size 9, justified, with the word Abstract in bold, Type title and in a separate line. Abstract length does not exceed 150 words. Also, note that keywords are separated by semicolon.}
\vspace{1\baselineskip}
\textit{Keywords}: manuscript formatting; camera$-$ready manuscript.
\vspace{0.2cm}
\par\noindent\rule{\textwidth}{0.4pt}
\vspace{0.05cm}
%------SECOND TITLE -------------%
\begin{titlepage}
\centering
\setstretch{1.5}
{\LARGE\textbf{Estado de esfuerzos en eje principal de una despulpadora de café}}
\end{titlepage}
%-----ABSTRACT 2-----%
\vspace{2\baselineskip}
\footnotesize\textbf{Resumen}
\footnotesize{This is an example of an article formatted for our journal. Note that this text is typed in Times New Roman, size 9, justified, with the word Abstract in bold, Type title and in a separate line. Abstract length does not exceed 150 words. Also, note that keywords are separated by semicolon.}
\vspace{1\baselineskip}
\textit{Palabras clave}: manuscript formatting; camera$-$ready manuscript.
\vspace{0.2cm}
\par\noindent\rule{\textwidth}{0.4pt}
\vspace{0.1cm}
\end{@twocolumnfalse}
]
%---------INTRODUCTION--------------------%
\newpage
\section{Introduction}
\lipsum[1-8]
\end{document}}
答案1
一些观察:
- 您可以为首页定义一个特殊的页面样式(我假设您只希望在第一页上使用此页眉)。您可以使用 来执行此操作
\fancypagestyle
。但这需要\headheight
在此页面上使用与其他页面不同的页面样式。这是可以做到的,但很棘手。因此,我建议将此页眉放在普通文本主体中,并在该页面上放置一个空的真实页眉(具有特殊的页面样式)。这就是我在我的解决方案中所做的。 - 您可以使用 定义各种页面参数
\setlength
,但使用 参数来定义会更好geometry
。否则,您将使用两种不同的机制,这可能会导致冲突。 也是如此\special{papersize=8.5in,11in}
。这就是geometry
您要做的。所以我注释掉了这些。 - 我将整个可选参数放在
\twocolumn
括号中{}
,以便可以在里面使用方括号。
考虑到这一点,他是我的解决方案:
\documentclass[11pt,twoside,twocolumn]{article}
%SIZES AND MARGINS
%\special{papersize=8.5in,11in}
\usepackage[paperheight=27.94cm,paperwidth=21.59cm,top=1.69cm,bottom=3cm,inner=1.99cm,outer=2.74cm]{geometry}
% fancy headers/footers
\usepackage{fancyhdr,color}
\usepackage{tabularx}
\usepackage{graphicx}
\pagestyle{fancy}
\chead{\footnotesize{Author/ Revista DYNA, 87(213), pp. 148-158, April - June, 2021}}
\lhead{}
\rhead{}
\cfoot{\footnotesize \copyright\ The author: licensee ...\\Revista DYNA ...\\DOI: http://...}
\fancypagestyle{firstpage}{%
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
}
% \setlength{\voffset}{-10mm}
% \setlength{\topmargin}{0mm}
% \setlength{\headheight}{5mm}
% \setlength{\headsep}{5mm}
% \setlength{\footskip}{10mm}
%for the numbers date's
\usepackage[super]{nth}
%LANGUAGES
\usepackage[utf8]{inputenc}
\usepackage[english,]{babel} % Idiomas add %spanish,es-noshorthands
\usepackage{titling}
\usepackage{setspace}
%MATH
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{authblk}
% para poder introducir varias figuras que ocupen el ancho de las dos columnas.
\usepackage{subfigure}
\usepackage{graphicx}
% for dummy text
\usepackage{lipsum}
%------------ TITLE-------------------------------%
\setstretch{1.0}
\title{\LARGE\textbf{State of stress in the main shaft of a coffee pulper machine\vspace*{-12pt}}}
\author[a]{Valentina Mejía Gallón}
\author[a]{Sebastián Gómez Duran}
\author[a]{Andrés Felipe Jaramillo}
\author[a]{Simón González Zapata}
\affil[a]{\footnotesize{\textit{Facultad de Minas, Universidad Nacional de Colombia, Medellín, Colombia, [email protected], [email protected], [email protected], [email protected]}}}
\renewcommand\Authands{ \& } % change "and" for &
\date{\vspace*{-60pt}}
%------------ MAIN DOCUMENT------------------------------------%
\begin{document}
\setcounter{page}{1}
\twocolumn[{
\begin{@twocolumnfalse}
\noindent\makebox[\textwidth]{\includegraphics[height=2cm]{example-image-a} \hfill
\includegraphics[height=2cm]{example-image-b}}\\\rule[8pt]{\textwidth}{1pt}
\vspace{-2cm}
\begin{titlingpage}
\maketitle
\end{titlingpage}
\begin{center}
\scriptsize{Received: July \nth{10}, 2021. Received in revised form: August \nth{3}, 2021. Accepted: November \nth{25}, 2021.}\vspace*{5pt}
\end{center}
%-----ABSTRACT-----%
\footnotesize\textbf{Abstract}
\footnotesize{This is an example of an article formatted for our journal. Note that this text is typed in Times New Roman, size 9, justified, with the word Abstract in bold, Type title and in a separate line. Abstract length does not exceed 150 words. Also, note that keywords are separated by semicolon.}
\vspace{1\baselineskip}
\textit{Keywords}: manuscript formatting; camera$-$ready manuscript.
\vspace{0.2cm}
\par\noindent\rule{\textwidth}{0.4pt}
\vspace{0.05cm}
%------SECOND TITLE -------------%
\begin{titlepage}
\centering
\setstretch{1.5}
{\LARGE\textbf{Estado de esfuerzos en eje principal de una despulpadora de café}}
\end{titlepage}
\thispagestyle{firstpage}
%-----ABSTRACT 2-----%
\vspace{2\baselineskip}
\footnotesize\textbf{Resumen}
\footnotesize{This is an example of an article formatted for our journal. Note that this text is typed in Times New Roman, size 9, justified, with the word Abstract in bold, Type title and in a separate line. Abstract length does not exceed 150 words. Also, note that keywords are separated by semicolon.}
\vspace{1\baselineskip}
\textit{Palabras clave}: manuscript formatting; camera$-$ready manuscript.
\vspace{0.2cm}
\par\noindent\rule{\textwidth}{0.4pt}
\vspace{0.1cm}
\end{@twocolumnfalse}
}]
%---------INTRODUCTION--------------------%
\newpage
\section{Introduction}
\lipsum[1-8]
\end{document}}