You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用PhDThesisPSnPDF.cls模板添加双摘要时的标题修改问题

Solution for Adding Two Abstracts (Abstract + Lay Summary) in 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.

  1. 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}
    
  2. Before your lay summary, redefine \abstractname to "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}
    
  3. If you want each abstract on its own page, add \clearpage between 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.

  1. Load etoolbox in your preamble:

    \usepackage{etoolbox}
    
  2. 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}}{}{}
    
  3. 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 11:04:39