我的问题与这个。
我想制作像这样的标题(针对未编号和编号的章节):
我已有的代码产生了这个:
也就是说,垂直线丢失了,样式也不同了。最重要的是,我们希望数字看起来更大,但更改字体大小和调整其他参数到目前为止并没有帮助。这是 MWE:
\documentclass[
ngerman,
a4paper,
12pt,
openright, titlepage=firstiscover
]{scrbook}
\usepackage{blindtext}
% Space from top
\renewcommand*\chapterheadstartvskip{\vspace*{-4.1cm}}
\renewcommand*\chapterheadendvskip{\vspace*{2.5\baselineskip}}
\renewcommand*{\chapterformat}{\chapternumber{\thechapter}}
\renewcommand{\chapterlinesformat}[3]{\chaptertitle{#3}#2}
% Chapter rule and number
\newcommand{\chapternumber}[1]{%
\usekomafont{chapter}%
\begin{minipage}[b]{0.1\paperwidth}%
\vspace*{-5.39cm}%
\raggedleft{%
{\color{black}\rule[-15pt]{0.5pt}{7cm}}%
\hspace{10mm}%
{\fontsize{60cm}{80cm}\selectfont #1}%
}%
\end{minipage}%
}
% Chapter title
\newcommand{\chaptertitle}[1]{%
\usekomafont{chapter}\normalfont\Huge %
\vspace*{5.39cm}%
\leavevmode\smash{\begin{minipage}[b]{0.72\paperwidth}%
\begin{flushright}
#1
\end{flushright}
\end{minipage}}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{pdfpages}
\usepackage[headsepline]{scrlayer-scrpage}
% Dokumentenanfang
\begin{document}
\begin{titlepage}
\Huge My fancy title
\end{titlepage}
\chapter*{Unnumbered chapter}
\blindtext
\chapter{This is an awesome chapter}
\blindtext
\section{Some section}
\blindtext
\section{Some section}
\blindtext
\section{Some section}
\blindtext
\end{document}
有人知道这个吗?提前谢谢大家。
附言:此代码也无济于事。
答案1
您必须使用可缩放字体,例如lmodern
。
以下建议基于你的第二个链接:
\documentclass[12pt,openright,titlepage=firstiscover]{scrbook}
\usepackage{blindtext}
\usepackage{lmodern}% use a scalable font
\RedeclareSectionCommand[
beforeskip=0pt,
afterindent=false,
afterskip=2.5\baselineskip,
font=\normalfont\Huge
]{chapter}
\renewcommand*\chapterformat{%
\fontsize{60pt}{60pt}\selectfont\thechapter%
}%
\renewcommand*\chapterlinesformat[3]{%
\parbox[b]{\textwidth}{\raggedchapter #3}%
\makebox[0pt][l]{%
\hspace{1ex}%
\smash{\rule[-15pt]{1pt}{10cm}}%
\hspace{1ex}
#2
}%
}
\renewcommand*\raggedchapter{\raggedleft}
\begin{document}
\begin{titlepage}
\Huge My fancy title
\end{titlepage}
\tableofcontents
\addchap*{Unnumbered chapter}
\blindtext
\chapter{This is an awesome chapter}
\blindtext
\section{Some section}
\blindtext
\section{Some section}
\blindtext
\section{Some section}
\blindtext
\end{document}