我正在用 LaTeX 写一篇论文。我选择了牛津模板,并根据我大学的要求对其进行了调整。论文几乎完成了,我缺少摘要和结论,但现在我遇到了一个问题。我需要用英语和法语写摘要,但我无法将摘要标题改为简历。我添加了代码(基本上是模板的代码):
\documentclass[12pt,a4paper,singlespacing,openright]{ociamthesis}
\usepackage[frenchb, english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{a4wide}
\usepackage{amssymb}
\usepackage{fixltx2e}
\usepackage{float}
\usepackage{amsmath}
\usepackage{graphics}
\usepackage{underscore}
\usepackage{siunitx}
\usepackage{notoccite}
\usepackage{textcomp}
\usepackage{bigints}
\usepackage{array}
\usepackage{siunitx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[skip=3pt,font=scriptsize]{caption}
\usepackage[skip=2pt,font=scriptsize]{subcaption}
\usepackage[hyphens]{url}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{multirow}
\usepackage{imakeidx} % Indice analitico
\makeindex[intoc]
\usepackage{titlesec}
\hypersetup{breaklinks=true}
\usepackage{minitoc}
\usepackage{paralist}
\urlstyle{same}
\usepackage{cite}
\usepackage{geometry}
\geometry{%
a4paper, body={150mm,220mm},
left=25mm,top=30mm,
headheight=7mm,
headsep=14mm,
marginparsep=4mm, marginparwidth=27mm
}
\usepackage{cdlr}
\titlespacing*{\section}
{0pt}{5.5ex plus 1ex minus .2ex}{4.3ex plus .2ex}
\titlespacing*{\subsection}
{0pt}{5.5ex plus 1ex minus .2ex}{4.3ex plus .2ex}
\begin{document}
%set the number of sectioning levels that get number and appear in the contents
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\university{ETABLISSEMENT}
\univlogo{logo-ETABLISSEMENT.png}
\doctoral{XXXXXXXXXX}
\researchunit{XXXXXXXXXX}
\specialisation{XXXXXXXXXX}
\jury{Civilit\'e Pr\'enom {\sc Nom} }{ Grade }{ Etablissement \qquad \qquad \qquad } {Statut Jury }
\jury{Civilit\'e Pr\'enom {\sc Nom} }{ Grade }{ Etablissement }{ Statut Jury }
\jury{Civilit\'e Pr\'enom {\sc Nom} }{ Grade }{ Etablissement }{ Statut Jury }
\jury{Civilit\'e Pr\'enom {\sc Nom} }{ Grade }{ Etablissement }{ Statut Jury }
\jury{Civilit\'e Pr\'enom {\sc Nom} }{ Grade }{ Etablissement }{ Statut Jury }
\maketitle
\include{dedication} % include a dedication.tex file
\include{acknowlegements} % include an acknowledgements.tex file
\include{abstract} % include the abstract
\begin{romanpages} % start roman page numbering
\dominitoc
\tableofcontents % generate and include a table of contents
\listoffigures
\listoftables
\end{romanpages}
\include{chapter1}
\include{chapter2}
\include{chapter3}
\include{chapter4}
\include{chapter5}
\include{chapter6}
\include{conclusions}
\appendix
\include{appendix1}
\include{appendix2}
\addcontentsline{toc}{chapter}{Bibliography}
%uncomment next line to change bibliography name to references
%\renewcommand{\bibname}{References}
\bibliography{refs} %use a bibtex bibliography file refs.bib
%\bibliographystyle{plain} %use the plain bibliography style
\bibliographystyle{elsarticle-num}
\printindex
\end{document}
然后,我分别在“摘要”中尝试了以下操作:
\selectlanguage{frenchb} \addto\captionsfrench{\renewcommand{\abstractname}{Résumé}}
\begin{abstract}
\end{abstract}
\selectlanguage{english}
\begin{abstract}
\end{abstract}
它识别法语,但标题仍然是“摘要”。我也尝试了其他课程(回忆录、报告……),但问题数量增加了……请考虑一下,我是 LaTeX 的初学者。
答案1
我假设文档类是可在以下位置下载的类:
https://www.maths.ox.ac.uk/members/it/faqs/latex/thesis-class
问题在于环境abstract
被类(重新)定义为:
\renewenvironment{abstract} {\begin{alwayssingle} \thispagestyle{empty}
\begin{center}
\vspace*{1.5cm}
{\Large \bfseries Abstract}
\end{center}
\vspace{0.5cm}
\begin{quote}}
{\end{quote}\end{alwayssingle}}
这意味着它不照顾\abstractname
。
您可以在序言中添加以下几行来解决这个问题:
\renewenvironment{abstract} {\begin{alwayssingle} \thispagestyle{empty}
\begin{center}
\vspace*{1.5cm}
{\Large \bfseries \abstractname}
\end{center}
\vspace{0.5cm}
\begin{quote}}
{\end{quote}\end{alwayssingle}}
梅威瑟:
\documentclass[12pt,a4paper,singlespacing,openright]{ociamthesis}
\usepackage[frenchb, english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\renewenvironment{abstract} {\begin{alwayssingle} \thispagestyle{empty}
\begin{center}
\vspace*{1.5cm}
{\Large \bfseries \abstractname}
\end{center}
\vspace{0.5cm}
\begin{quote}}
{\end{quote}\end{alwayssingle}}
\begin{document}
\selectlanguage{frenchb}
\begin{abstract}
\end{abstract}
\selectlanguage{english}
\begin{abstract}
\end{abstract}
\end{document}
输出:
请注意,该类定义的所有环境(如acknowledgements
)都存在此问题。该类肯定不适用于英语以外的语言。
另请注意
\addto\captionsfrench{\renewcommand{\abstractname}{Résumé}}
不再需要,因为它是 的默认设置frenchb
。