我正在尝试在 latex 中添加一个顶部摘要图像来覆盖科学双栏文章的两栏,但这样的图像与机构信息之间存在冲突。当我添加图像时,它会使机构信息消失。问题发生在 svjour3.cls 模板上。
以下是我制作的预告图片的代码:
\RequirePackage{fix-cm}
\documentclass[twocolumn]{svjour3}
\smartqed % flush right qed marks, e.g. at end of proof
\usepackage{graphicx}
\usepackage{cite}
\usepackage{times}
%\usepackage{epsfig}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{verbatim}
\usepackage{colortbl}
\usepackage[table]{xcolor}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{gensymb}
\usepackage{mathtools}
\usepackage{microtype}
\usepackage{subfig}
\usepackage{multirow,stackengine}
\usepackage[normalem]{ulem}
\newcolumntype{$}{>{\global\let\currentrowstyle\relax}}
\newcolumntype{^}{>{\currentrowstyle}}
\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%
#1\ignorespaces
}
\usepackage{pifont}
\usepackage[pagebackref=true,breaklinks=true,letterpaper=true,colorlinks,bookmarks=false]{hyperref}
\begin{document}
\title{Insert your title here}
\subtitle{Do you have a subtitle?\\ If so, write it here}
\author{First Author \and
Second Author %etc.
}
\institute{F. Author \at
first address \\
Tel.: +123-45-678910\\
Fax: +123-45-678910\\
\email{[email protected]} % \\
% \emph{Present address:} of F. Author % if needed
\and
S. Author \at
second address
}
\date{Received: date / Accepted: date}
% TEASER IMAGE -------------------------------------------------------
\twocolumn[{%
\renewcommand\twocolumn[1][]{#1}%
\maketitle
\begin{center}
\centering
\renewcommand{\arraystretch}{0.6}
\begin{tabular}{c c c}
\includegraphics[width=0.20\textwidth]{example.eps}
\includegraphics[width=0.20\textwidth]{example.eps}
\includegraphics[width=0.20\textwidth]{example.eps} \\
\end{tabular}
\captionof{figure}{\textbf{Caption of your teaser figure.} Please insert the caption of your teaser figure here.
}
\label{fig:teaser}
\end{center}
\vspace{0.5cm}
}]
% TEASER IMAGE -------------------------------------------------------
%\maketitle
\begin{abstract}
Insert your abstract here. Include keywords, PACS and mathematical
subject classification numbers as needed.
\keywords{First keyword \and Second keyword \and More}
\end{abstract}
\section{Introduction}
\label{intro}
Your text comes here. Separate text sections with
\section{Section title}
\label{sec:1}
Text with citations \cite{RefB} and \cite{RefJ}.
\subsection{Subsection title}
\label{sec:2}
as required. Don't forget to give each section
and subsection a unique label (see Sect.~\ref{sec:1}).
\paragraph{Paragraph headings} Use paragraph headings as needed.
\begin{equation}
a^2+b^2=c^2
\end{equation}
% For one-column wide figures use
\begin{figure}
% Use the relevant command to insert your figure file.
% For example, with the graphicx package use
\includegraphics{example.eps}
% figure caption is below the figure
\caption{Please write your figure caption here}
\label{fig:1} % Give a unique label
\end{figure}
%
% For two-column wide figures use
\begin{figure*}
% Use the relevant command to insert your figure file.
% For example, with the graphicx package use
\includegraphics[width=0.75\textwidth]{example.eps}
% figure caption is below the figure
\caption{Please write your figure caption here}
\label{fig:2} % Give a unique label
\end{figure*}
%
% For tables use
\begin{table}
% table caption is above the table
\caption{Please write your table caption here}
\label{tab:1} % Give a unique label
% For LaTeX tables use
\begin{tabular}{lll}
\hline\noalign{\smallskip}
first & second & third \\
\noalign{\smallskip}\hline\noalign{\smallskip}
number & number & number \\
number & number & number \\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}
% Non-BibTeX users please use
\begin{thebibliography}{}
%
% and use \bibitem to create references. Consult the Instructions
% for authors for reference list style.
%
\bibitem{RefJ}
% Format for Journal Reference
Author, Article title, Journal, Volume, page numbers (year)
% Format for books
\bibitem{RefB}
Author, Book title, page numbers. Publisher, place (year)
% etc
\end{thebibliography}
\end{document}
% end of file template.tex
调用图片内的 maketitle 会使学院信息消失。附图中,左图对应带摘要图片的版本,右图是仅用 替换所有摘要图片代码的输出maketitle
。
有没有办法解决这个问题,同时获得预告图和机构信息?我尝试了几种方法,但都没有成功。提前致谢。
答案1
\maketitle
svjour3 的(和\@maketitle
) 非常复杂。它用于\if@twocolumn
进行许多格式更改。好消息是您不必重新定义\twocolumn
。坏消息是标题的格式是针对 svjourn 的单列版本。
研究所以脚注形式打印,因此必须添加在\twocolumn
论点(组)外面。
\RequirePackage{fix-cm}
\documentclass[twocolumn]{svjour3}
\smartqed % flush right qed marks, e.g. at end of proof
\usepackage{graphicx}
\usepackage{cite}
\usepackage{times}
%\usepackage{epsfig}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{verbatim}
\usepackage{colortbl}
\usepackage[table]{xcolor}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{gensymb}
\usepackage{mathtools}
\usepackage{microtype}
\usepackage{subfig}
\usepackage{multirow,stackengine}
\usepackage[normalem]{ulem}
\newcolumntype{$}{>{\global\let\currentrowstyle\relax}}
\newcolumntype{^}{>{\currentrowstyle}}
\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%
#1\ignorespaces
}
\usepackage{pifont}
\usepackage[pagebackref=true,breaklinks=true,letterpaper=true,colorlinks,bookmarks=false]{hyperref}
\newsavebox{\tempbox}
\begin{document}
\title{Insert your title here}
\subtitle{Do you have a subtitle?\\ If so, write it here}
\author{First Author \and
Second Author %etc.
}
\institute{F. Author \at
first address \\
Tel.: +123-45-678910\\
Fax: +123-45-678910\\
\email{[email protected]} % \\
% \emph{Present address:} of F. Author % if needed
\and
S. Author \at
second address
}
\date{Received: date / Accepted: date}
% TEASER IMAGE -------------------------------------------------------
\savebox{\tempbox}{\begin{tabular}{c c c}% no idea why this is needed
\includegraphics[width=0.20\textwidth]{example.eps} &
\includegraphics[width=0.20\textwidth]{example.eps} &
\includegraphics[width=0.20\textwidth]{example.eps}
\end{tabular}}
\twocolumn[
\maketitle
\begin{center}
\renewcommand{\arraystretch}{0.6}%
\usebox\tempbox
\captionof{figure}{\textbf{Caption of your teaser figure.} Please insert the caption of your teaser figure here.
}
\label{fig:teaser}
\end{center}
\vspace{0.5cm}
]
{\def\iand{\\[5pt]\let\and=\nand}%
\def\nand{\ifhmode\unskip\nobreak\fi\ $\cdot$ }%
\let\and=\nand
\def\at{\\\let\and=\iand}%
\footnotetext[0]{\kern-\bibindent
\ignorespaces\csname @institute\endcsname}\vspace{5dd}}%
% TEASER IMAGE -------------------------------------------------------
%\maketitle
\begin{abstract}
Insert your abstract here. Include keywords, PACS and mathematical
subject classification numbers as needed.
\keywords{First keyword \and Second keyword \and More}
\end{abstract}
\section{Introduction}
\label{intro}
Your text comes here. Separate text sections with
\section{Section title}
\label{sec:1}
Text with citations \cite{RefB} and \cite{RefJ}.
\subsection{Subsection title}
\label{sec:2}
as required. Don't forget to give each section
and subsection a unique label (see Sect.~\ref{sec:1}).
\paragraph{Paragraph headings} Use paragraph headings as needed.
\begin{equation}
a^2+b^2=c^2
\end{equation}
% For one-column wide figures use
\begin{figure}
% Use the relevant command to insert your figure file.
% For example, with the graphicx package use
\includegraphics{example.eps}
% figure caption is below the figure
\caption{Please write your figure caption here}
\label{fig:1} % Give a unique label
\end{figure}
%
% For two-column wide figures use
\begin{figure*}
% Use the relevant command to insert your figure file.
% For example, with the graphicx package use
\includegraphics[width=0.75\textwidth]{example.eps}
% figure caption is below the figure
\caption{Please write your figure caption here}
\label{fig:2} % Give a unique label
\end{figure*}
%
% For tables use
\begin{table}
% table caption is above the table
\caption{Please write your table caption here}
\label{tab:1} % Give a unique label
% For LaTeX tables use
\begin{tabular}{lll}
\hline\noalign{\smallskip}
first & second & third \\
\noalign{\smallskip}\hline\noalign{\smallskip}
number & number & number \\
number & number & number \\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}
% Non-BibTeX users please use
\begin{thebibliography}{}
%
% and use \bibitem to create references. Consult the Instructions
% for authors for reference list style.
%
\bibitem{RefJ}
% Format for Journal Reference
Author, Article title, Journal, Volume, page numbers (year)
% Format for books
\bibitem{RefB}
Author, Book title, page numbers. Publisher, place (year)
% etc
\end{thebibliography}
\end{document}
\@maketitle
我想到了一个更好的解决方案是在. 末尾添加一个钩子,这样\titlehook{...}
会将(一列)内容放在标题的末尾。
\RequirePackage{fix-cm}
\documentclass[twocolumn]{svjour3}
\smartqed % flush right qed marks, e.g. at end of proof
\usepackage{graphicx}
\usepackage{cite}
\usepackage{times}
%\usepackage{epsfig}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{verbatim}
\usepackage{colortbl}
\usepackage[table]{xcolor}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{gensymb}
\usepackage{mathtools}
\usepackage{microtype}
\usepackage{subfig}
\usepackage{multirow,stackengine}
\usepackage[normalem]{ulem}
\newcolumntype{$}{>{\global\let\currentrowstyle\relax}}
\newcolumntype{^}{>{\currentrowstyle}}
\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%
#1\ignorespaces
}
\usepackage{pifont}
\usepackage[pagebackref=true,breaklinks=true,letterpaper=true,colorlinks,bookmarks=false]{hyperref}
\usepackage{etoolbox}% edit \@maketitle
\makeatletter
\let\@titlehook=\relax
\apptocmd{\@maketitle}{\@titlehook}{}{}
\newcommand{\titlehook}[1]{\def\@titlehook{#1}}
\makeatother
\begin{document}
\title{Insert your title here}
\subtitle{Do you have a subtitle?\\ If so, write it here}
\author{First Author \and
Second Author %etc.
}
\institute{F. Author \at
first address \\
Tel.: +123-45-678910\\
Fax: +123-45-678910\\
\email{[email protected]} % \\
% \emph{Present address:} of F. Author % if needed
\and
S. Author \at
second address
}
\date{Received: date / Accepted: date}
% TEASER IMAGE -------------------------------------------------------
\titlehook{\begin{center}
\renewcommand{\arraystretch}{0.6}%
\begin{tabular}{c c c}
\includegraphics[width=0.20\textwidth]{example.eps} &
\includegraphics[width=0.20\textwidth]{example.eps} &
\includegraphics[width=0.20\textwidth]{example.eps}
\end{tabular}
\captionof{figure}{\textbf{Caption of your teaser figure.} Please insert the caption of your teaser figure here.
}
\label{fig:teaser}
\end{center}
\vspace{0.5cm}}
\maketitle
{\def\iand{\\[5pt]\let\and=\nand}%
\def\nand{\ifhmode\unskip\nobreak\fi\ $\cdot$ }%
\let\and=\nand
\def\at{\\\let\and=\iand}%
\footnotetext[0]{\kern-\bibindent
\ignorespaces\csname @institute\endcsname}\vspace{5dd}}%
% TEASER IMAGE -------------------------------------------------------
%\maketitle
\begin{abstract}
Insert your abstract here. Include keywords, PACS and mathematical
subject classification numbers as needed.
\keywords{First keyword \and Second keyword \and More}
\end{abstract}
\section{Introduction}
\label{intro}
Your text comes here. Separate text sections with
\section{Section title}
\label{sec:1}
Text with citations \cite{RefB} and \cite{RefJ}.
\subsection{Subsection title}
\label{sec:2}
as required. Don't forget to give each section
and subsection a unique label (see Sect.~\ref{sec:1}).
\paragraph{Paragraph headings} Use paragraph headings as needed.
\begin{equation}
a^2+b^2=c^2
\end{equation}
% For one-column wide figures use
\begin{figure}
% Use the relevant command to insert your figure file.
% For example, with the graphicx package use
\includegraphics{example.eps}
% figure caption is below the figure
\caption{Please write your figure caption here}
\label{fig:1} % Give a unique label
\end{figure}
%
% For two-column wide figures use
\begin{figure*}
% Use the relevant command to insert your figure file.
% For example, with the graphicx package use
\includegraphics[width=0.75\textwidth]{example.eps}
% figure caption is below the figure
\caption{Please write your figure caption here}
\label{fig:2} % Give a unique label
\end{figure*}
%
% For tables use
\begin{table}
% table caption is above the table
\caption{Please write your table caption here}
\label{tab:1} % Give a unique label
% For LaTeX tables use
\begin{tabular}{lll}
\hline\noalign{\smallskip}
first & second & third \\
\noalign{\smallskip}\hline\noalign{\smallskip}
number & number & number \\
number & number & number \\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}
% Non-BibTeX users please use
\begin{thebibliography}{}
%
% and use \bibitem to create references. Consult the Instructions
% for authors for reference list style.
%
\bibitem{RefJ}
% Format for Journal Reference
Author, Article title, Journal, Volume, page numbers (year)
% Format for books
\bibitem{RefB}
Author, Book title, page numbers. Publisher, place (year)
% etc
\end{thebibliography}
\end{document}