两个垂直对齐的章节

两个垂直对齐的章节

我正在尝试垂直对齐地编写整个章节。我找到了以下解决方案:

\begingroup%
\makeatletter%
\let\clearpage\relax% 
\vspace*{\fill}%
\vspace*{\dimexpr-50\p@-\baselineskip}
\chapter*{\centering\normalsize{Abstract}}
\noindent
\begin{quote}
text 1
\end{quote}
\vspace*{\fill}%
\endgroup

这个解决方案对我来说很好用,直到我开始\newpage尝试编写另一个垂直对齐的章节。在这种情况下,第二章不是垂直对齐的。有人能帮我吗?

完整代码如下

\documentclass[a4paper,12pt,twoside,openright]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[lighttt]{lmodern}
\usepackage[a4paper,top=2.50cm,bottom=2.50cm,left=2.50cm,right=2.50cm]{geometry}

\usepackage{textcomp}
\usepackage{setspace}
    \onehalfspacing

\usepackage{fancyhdr}
    \setlength{\headheight}{18pt}%
    \fancypagestyle{main}{%
      \renewcommand{\headrulewidth}{.4pt}% Header rule
      \renewcommand{\footrulewidth}{0pt}% No Footer rule
      \fancyhf{}% Clear header/footer
      \fancyhead[LE]{\itshape\nouppercase\leftmark}
      \fancyhead[RO]{\itshape\nouppercase\rightmark}
      \fancyhead[RE,LO]{\thepage}% 
    }
    \fancypagestyle{plain}{%
        \fancyhf{} % clear all header and footer fields
        \fancyfoot[R]{\thepage}
        \fancyhead{} 
        \renewcommand{\headrulewidth}{0pt}
        \renewcommand{\footrulewidth}{0pt}
    }
    \raggedbottom
    
\usepackage{titlesec}
    \titleformat{name=\chapter}[display]
        {\Large\ttfamily}
        {{\chaptertitlename} \thechapter}
        {2ex}
        {\bfseries\filcenter\Huge 
    }
    \titleformat{\section}[block]
        {\ttfamily\bfseries\boldmath\Large}
        {\thesection}{1em}{}
    \titleformat{\subsection}[block]
        {\ttfamily\bfseries\large}
        {\thesubsection}{1em}{}
    \titlespacing{\chapter}{0pt}{-10pt}{40pt}

\newenvironment{changemargin}[2]{%
\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{#1}%
\setlength{\rightmargin}{#2}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{\parskip}%
}%
\item[]}{\end{list}}

\begin{document}

\begingroup%
\makeatletter%
\let\clearpage\relax% 
\vspace*{\fill}%
\vspace*{\dimexpr-50\p@-\baselineskip}
\chapter*{\centering\normalsize{Abstract}}
\noindent
\begin{quote}
           A problem of non-relativistic quantum mechanics treated using regularization and renormalization is presented. The main aim of this thesis is to study regularization and renormalization techniques in general and applying them first to a classical electromagnetism problem and then to compute the bound state energy of a single quantum particle subjected to a two-dimensional $\delta$-function potential, which results to be divergent if computed naively. The naive computation is performed both solving directly the Schr\"odinger equation and using the theory of propagators, that is briefly studied in the central part of the thesis. The regularization techniques used are the cutoff regularization and the dimensional one. An effective field theory approach, where the potential is regularized through the real space scheme, is also presented. After regularization has been performed, the potential is renormalized re-defining the coupling constant and the running of the renormalized coupling constant, i.e. the renormalization group equation, is found.
\end{quote}
\vspace*{\fill}%
\endgroup

\newpage


\begingroup%
\makeatletter%
\let\clearpage\relax% 
\vspace*{\fill}%
\vspace*{\dimexpr-50\p@-\baselineskip}
\chapter*{\centering\normalsize{Sommario}}
\noindent
\begin{quote}
               A problem of non-relativistic quantum mechanics treated using regularization and renormalization is presented. The main aim of this thesis is to study regularization and renormalization techniques in general and applying them first to a classical electromagnetism problem and then to compute the bound state energy of a single quantum particle subjected to a two-dimensional $\delta$-function potential, which results to be divergent if computed naively. The naive computation is performed both solving directly the Schr\"odinger equation and using the theory of propagators, that is briefly studied in the central part of the thesis. The regularization techniques used are the cutoff regularization and the dimensional one. An effective field theory approach, where the potential is regularized through the real space scheme, is also presented. After regularization has been performed, the potential is renormalized re-defining the coupling constant and the running of the renormalized coupling constant, i.e. the renormalization group equation, is found.
\end{quote}
\vspace*{\fill}%
\endgroup
\end{document}

这是一张图片图片所需输出(仅第一部分有效)

答案1

无需使用\chapter*它来撤消它所做的任何操作。

使用特殊环境可确保您获得统一的输出。您还可以轻松选择页面样式、问题\addcontentsline等。或者,也许改变主意,只需更改环境的定义;对文档中的所有内容进行硬编码很容易出错。

\documentclass[a4paper,12pt,twoside,openright]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[italian,english]{babel}
\usepackage[lighttt]{lmodern}
\usepackage[a4paper,top=2.50cm,bottom=2.50cm,left=2.50cm,right=2.50cm]{geometry}

\usepackage{textcomp}
\usepackage{setspace}
\usepackage{fancyhdr}
\usepackage{titlesec}

\usepackage{lipsum}

%% package settings
% fancyhdr
\setlength{\headheight}{18pt}
\fancypagestyle{main}{%
  \renewcommand{\headrulewidth}{.4pt}% Header rule
  \renewcommand{\footrulewidth}{0pt}% No Footer rule
  \fancyhf{}% Clear header/footer
  \fancyhead[LE]{\itshape\nouppercase\leftmark}
  \fancyhead[RO]{\itshape\nouppercase\rightmark}
  \fancyhead[RE,LO]{\thepage}% 
}
\fancypagestyle{plain}{%
  \fancyhf{} % clear all header and footer fields
  \fancyfoot[R]{\thepage}
  \fancyhead{}
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}
}
% titlesec
\titleformat{name=\chapter}[display]
  {\Large\ttfamily}
  {{\chaptertitlename} \thechapter}
  {2ex}
  {\bfseries\filcenter\Huge}
\titleformat{\section}[block]
  {\ttfamily\bfseries\boldmath\Large}
  {\thesection}
  {1em}
  {}
\titleformat{\subsection}[block]
  {\ttfamily\bfseries\large}
  {\thesubsection}
  {1em}
  {}
\titlespacing{\chapter}{0pt}{-10pt}{40pt}

%% personal commands and environments
\newenvironment{changemargin}[2]{%
  \begin{list}{}{%
    \setlength{\topsep}{0pt}%
    \setlength{\leftmargin}{#1}%
    \setlength{\rightmargin}{#2}%
    \setlength{\listparindent}{\parindent}%
    \setlength{\itemindent}{\parindent}%
    \setlength{\parsep}{\parskip}%
  }%
  \item[]
}{\end{list}}

\newenvironment{specialchapter}[2][english]{%
  \cleardoublepage
  \thispagestyle{plain}
  \vspace*{\fill}
  \begin{otherlanguage}{#1}
  {\centering\normalsize\bfseries #2\par}
  \begin{quotation}
}{%
  \end{quotation}
  \end{otherlanguage}
  \vspace*{\fill}
  \clearpage
}

%%% final document settings
\raggedbottom
\onehalfspacing

\begin{document}

\begin{specialchapter}{\abstractname}
text 1
\end{specialchapter}

\begin{specialchapter}[italian]{\abstractname}
text2
\end{specialchapter}

\end{document}

我使用quotation而不是quote,因为前者对垂直间距的要求较低(您已经有\onehalfspacing)。

在此处输入图片描述

另一方面,我只会使用\chapter下的标准命令\frontmatter,因此它不会被编号。

顺便问一下,你的问题出在哪里?\clearpage在第二个特别章节之后,你没有遇到任何问题。

我还改变了序言部分的顺序。我发现先加载包然后再指定设置要好得多。

相关内容