LateX中两个具有不同名称的摘要 [英] Two abstracts with different names in LateX

查看:573
本文介绍了LateX中两个具有不同名称的摘要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的博士学位论文使用LateX模板,该模板可通过以下链接获得:

I am using a LateX template for my PhD thesis which is available via this link: https://github.com/kks32/phd-thesis-template/blob/master/Classes/PhDThesisPSnPDF.cls I wish to include two abstracts for the request of the University. One with the name "Abstract" and one with the name "Lay Summary". But I am having trouble changing the title in the second abstract. The abstract is a tex file starting with the following lines:

\begin{abstract}
....
\end{abstract} 

documentclass是一个自定义的环境:

The documentclass is a custom defined environment:

\documentclass[a4paper,12pt,times,numbered,print,index]{Classes/PhDThesisPSnPDF}

我在\ begin {abstract}行之前的第二个摘要中尝试了此代码,并显示错误消息:!LaTeX错误:\ abstractname未定义".

I tried this code in the second abstract before the \begin{abstract} line with an error message: "! LaTeX Error: \abstractname undefined".

\renewcommand{\abstractname}{Lay Summary}

即使标题会更改,我也不需要第二次全局更改标题.我需要在编号内容之前拥有第二个摘要,最好是在第一个摘要之后.有什么建议可以尝试吗?

And even if it would change the title I do not need it to be changed globally just for the second time. I need to have the second abstract before the numbered content, ideally after the first abstract. Is there any suggestion what to try?

推荐答案

我很容易得出一个经过测试的解决方案.

I have got, say quite easily, a tested solution.

在我的文件夹中,我将自定义文档类文件另存为docclass.cls.

In my folder, I saved your custom documentclass file as docclass.cls.

在同一文件夹中,我保存并编译了

In the same folder, I saved and compiled my MWE/main .tex file:

\documentclass[a4paper,12pt,times,numbered,print,index]{docclass}

\newenvironment{laysummary} {
  \cleardoublepage
  \setsinglecolumn
  \chapter*{\centering \Large Lay Summary}
  \thispagestyle{empty}
}

\begin{document}

\begin{abstract}
First.
\end{abstract}

\begin{laysummary}
Second.
\end{laysummary}

\chapter{Chapter}
Some Text.

\end{document}

这会产生您想要使用摘要放置摘要来实现的输出:

This produces the output you wanted to achieve with Abstract and Lay Summary:

请注意,关键是在行中:

Notice that the key thing is in the lines:

\newenvironment{laysummary} {
  \cleardoublepage
  \setsinglecolumn
  \chapter*{\centering \Large Lay Summary}
  \thispagestyle{empty}
}

我从您的自定义文档类的第1105-1121行中摘录的

:

that I took from lines 1105-1121 of your custom documentclass:

\newenvironment{abstract} {
\ifPHD@abstract
% Separate abstract as per Student Registry guidelines
  \thispagestyle{empty}
  \setsinglecolumn
  \begin{center}
    { \Large {\bfseries {\@title}} \par}
    {{\large \vspace*{1em} \@author} \par}
  \end{center}
\else
% Normal abstract in the thesis
  \cleardoublepage
  \setsinglecolumn
  \chapter*{\centering \Large Abstract}
  \thispagestyle{empty}
\fi
}

我没有删除甚至没有修改这些内部文档类文件,而是编辑了它的副本,然后将其粘贴到主tex文件中.如果要保持主要tex文件的清洁,可以将定义laysummary environmemt的六行内容粘贴在documentclass cls文件的末尾.

I did not remove or even modify these latter inside the documentclass file, I edited a copy of it that I then pasted in the main tex file. If you want to keep your main tex file cleaner, my six lines defining laysummary environmemt may be pasted at the end of the documentclass cls file instead.

这篇关于LateX中两个具有不同名称的摘要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆