Makechapterstyle 中章节编号的位置

Makechapterstyle 中章节编号的位置

在此代码中,我无法移动章节编号,只能移动标题。章节编号应与章节标题处于同一高度。我可以使用什么命令?章节标题不应移动。

 \documentclass[11pt,a4paper]{memoir}

 \usepackage[a4paper,top=2.5cm,bottom=2.5cm,left=2cm,right=2cm]{geometry}


 \usepackage[ngerman,english]{babel}   % select the language
 \usepackage[utf8]{inputenc}           % input encoding
 \usepackage{mathptmx}                 % font size extension
 \usepackage{blindtext}                % blindtext
 \usepackage{xcolor}                   % extended colors
 \usepackage{calc}                     % \setlength minus ...


 % --- fancy chapter style ---
 \makechapterstyle{combined}{
   \setlength{\midchapskip}{-4cm}
   \setlength{\afterchapskip}{3cm}
   \renewcommand*{\printchaptername}{}
   \renewcommand*{\chapnumfont}{\normalfont\bfseries\fontsize{80}{80}\selectfont}
   \renewcommand*{\printchapternum}{\flushright\chapnumfont\textcolor{gray}{\thechapter}}
   \renewcommand*{\chaptitlefont}{\normalfont\fontsize{35}{35}\selectfont}
   \renewcommand*{\printchaptertitle}[1]{%
     \raggedright\chaptitlefont\parbox[t]{\textwidth -2cm}{\raggedright##1}}
 }
 \chapterstyle{combined}
 % --- end of chapter style definition ---


 \begin{document}
 \chapter{First Chapter}
 \blindtext[4]
 \end{document}

答案1

一种可能性是:

\documentclass[11pt,a4paper]{memoir}
\usepackage[a4paper,top=2.5cm,bottom=2.5cm,left=2cm,right=2cm]{geometry}
\usepackage[ngerman,english]{babel}   % select the language
\usepackage[utf8]{inputenc}           % input encoding
\usepackage{mathptmx}                 % font size extension
\usepackage{blindtext}                % blindtext
\usepackage{xcolor}                   % extended colors
\usepackage{calc}                     % \setlength minus ...
\usepackage{graphicx}

 % --- fancy chapter style ---
\makechapterstyle{combined}{
  \setlength{\midchapskip}{-\baselineskip}
  \setlength{\afterchapskip}{3cm}
  \setlength{\beforechapskip}{1cm}
  \renewcommand*{\printchaptername}{}
  \renewcommand*{\chapnumfont}{\normalfont\bfseries\fontsize{80}{80}\selectfont\color{gray}}
  \renewcommand*{\chaptitlefont}{\normalfont\fontsize{35}{35}\selectfont\color{gray}}
  \renewcommand*{\printchapternum}{%
    \hfill\raisebox{0pt}[0pt][0pt]{%
      \parbox[b]{2cm}{\raggedleft\chapnumfont\thechapter}%
     }%
  }%
  \renewcommand*{\printchaptertitle}[1]{%
    \raisebox{0pt}[0pt][0pt]{%
      \parbox[b]{\textwidth-2cm}{\raggedright\chaptitlefont##1}
    }%
  }
}
\chapterstyle{combined}
 % --- end of chapter style definition ---

\begin{document}

\chapter{First Chapter}
\blindtext[4]

\end{document}

在此处输入图片描述

由于问题中提供的唯一信息是数字应与章节标题出现在相同的高度,但没有提供有关水平放置的信息,因此我选择将章节编号放在左侧;您可以根据需要进行更改。

相关内容