我希望能够写标题之前抽象的在同一页上同时使用英语和西班牙语。我也想用英语写。如果不进行硬编码,我该如何实现呢?
我正在使用 abstract.tex 文件,如下所示:
\newenvironment{abstract}
{\thispagestyle{empty} \cleardoublepage\null \thispagestyle{empty} \vfill\begin{center}%
\Large \bfseries \abstractname \end{center}}
{\thispagestyle{empty} \vfill\null }
\begin{abstract}
La presente tesis estudia dos instancias diferentes de teoremas inversos discretos, la primera relacionada con cuestiones de convergencia en la teor´ıa.
\end{abstract}
\selectlanguage{english}
\begin{abstract}
The present thesis studies two different instances of discrete inverse theorems, the first one pertaining convergence issues in ergodic theory and the second one
problems of local distribution in number theory. \\
\textbf{Keywords}:
\end{abstract}
然后我从 main.tex 文件加载/调用 abstract.tex 文件:
\documentclass[11pt,pdfa1,a4paper,online,oneside,openright ]{book}
\begin{document}
\makeatletter
\frontmatter
\maketitle
\input{dedication}
\input{abtract}
\end{document}
答案1
使用babel
和pdflatex
一个可能的解决方案是
% !TeX TS-program = pdflatex
\documentclass[11pt,pdfa1,a4paper,online,oneside,openright ]{book}
\usepackage[spanish, english]{babel}
%https://tex.stackexchange.com/questions/70815/placing-in-the-same-page-two-abstract-in-different-language
\newenvironment{abstractpage}
{\cleardoublepage\vspace*{\fill}\thispagestyle{empty}}
{\vfill\cleardoublepage}
\newenvironment{abstract}
{\begin{center}\bfseries\abstractname\end{center}}
{\par\bigskip}
\begin{document}
\renewcommand{\abstractname}{Resumen}
\begin{abstractpage}
{\centering \huge \textbf{Teoremas inversos discretos} \par \bigskip}
\begin{abstract}
La presente tesis estudia dos instancias diferentes de teoremas inversos discretos, la primera relacionada con cuestiones de convergencia en la teoría.
\end{abstract}
\vspace{\fill}
\begin{otherlanguage}{english}
{\centering \huge \textbf{Discrete inverse theorems} \par \bigskip}
\begin{abstract}
The present thesis studies two different instances of discrete inverse theorems, the first one pertaining convergence issues in ergodic theory and the second one
problems of local distribution in number theory.
\end{abstract}
\end{otherlanguage}
\end{abstractpage}
\end{document}
与xelatex
或lualatex
并使用polyglossia
结果是等效的。
% !TeX TS-program = xelatex
\documentclass[11pt,pdfa1,a4paper,online,oneside,openright ]{book}
\RequirePackage{polyglossia}% An Alternative to Babel xelatex lualatex
\setmainlanguage{spanish}
\setotherlanguage[]{english}
\def\captionsenglish{%
\def\abstractname{Abstract}%
}
%https://tex.stackexchange.com/questions/70815/placing-in-the-same-page-two-abstract-in-different-language
\newenvironment{abstractpage}
{\cleardoublepage\vspace*{\fill}\thispagestyle{empty}}
{\vfill\cleardoublepage}
\newenvironment{abstract}
{\begin{center}\bfseries\abstractname\end{center}}
{\par\bigskip}
\begin{document}
\begin{abstractpage}
{\centering \huge \textbf{Teoremas inversos discretos} \par \bigskip}
\begin{abstract}
La presente tesis estudia dos instancias diferentes de teoremas inversos discretos, la primera relacionada con cuestiones de convergencia en la teoría.
\end{abstract}
\vspace{\fill}
\begin{english}
{\centering \huge \textbf{Discrete inverse theorems} \par \bigskip}
\begin{abstract}
The present thesis studies two different instances of discrete inverse theorems, the first one pertaining convergence issues in ergodic theory and the second one
problems of local distribution in number theory.
\end{abstract}
\end{english}
\end{abstractpage}
\end{document}