使用PhDThesisPSnPDF.cls模板添加双摘要时的标题修改问题
Got it, let's sort out how to add those two abstracts while keeping the required \begin{abstract}...\end{abstract} markup for the second one. Here are two straightforward approaches tailored to your custom document class:
Approach 1: Temporarily Override the Abstract Title
This works if your template uses the \abstractname command for the abstract title (which most LaTeX classes do, including likely this one). It's simple and requires no extra packages.
First, add your standard academic abstract as usual:
\begin{abstract} Your detailed academic abstract content goes here—summarize your research goals, methods, key findings, and contributions. \end{abstract}Before your lay summary, redefine
\abstractnameto "Lay Summary", then reset it afterward if needed:% Switch the abstract title to Lay Summary \renewcommand{\abstractname}{Lay Summary} \begin{abstract} Your plain-language lay summary here—explain your research in terms accessible to non-experts, focusing on why your work matters. \end{abstract} % Optional: Switch back to original title if you need to use the abstract environment again later \renewcommand{\abstractname}{Abstract}If you want each abstract on its own page, add
\clearpagebetween them:\begin{abstract} ... \end{abstract} \clearpage \renewcommand{\abstractname}{Lay Summary} \begin{abstract} ... \end{abstract}
Approach 2: Patch the Abstract Environment (For Hardcoded Titles)
If your custom class hardcodes the "Abstract" title directly in the abstract environment (instead of using \abstractname), use the etoolbox package to patch the environment first. This ensures your title override works correctly.
Load
etoolboxin your preamble:\usepackage{etoolbox}Patch the abstract environment to replace the hardcoded title with
\abstractname:% Replace hardcoded "Abstract" in the chapter heading \patchcmd{\abstract}{\chapter*{Abstract}}{\chapter*{\abstractname}}{}{} % Replace hardcoded "Abstract" in the table of contents entry (if applicable) \patchcmd{\abstract}{\addcontentsline{toc}{chapter}{Abstract}}{\addcontentsline{toc}{chapter}{\abstractname}}{}{}Now you can use Approach 1 exactly as above to switch between "Abstract" and "Lay Summary".
Quick Check to Verify Your Template's Setup
To confirm which approach to use, open PhDThesisPSnPDF.cls and look for the abstract environment definition. If you see lines like \chapter*{\abstractname}, Approach 1 is perfect. If you see \chapter*{Abstract} (hardcoded text), go with Approach 2.
内容的提问来源于stack exchange,提问作者Enoana

