我想自定义一个章节标题以强调其首字母缩写。我认为将其分成多行是一个很好的解决方案,但我还想让首字母突出。另外,我注意到右侧有很多空白,但我认为我应该能够将题词移到那里。我该如何实现这一点?
理想情况下,应该有比颜色更好的方法来强调 SLAM 字母。我考虑过多行字母,类似于此,但我不知道从哪里可以得到它们:
我愿意接受其他建议:)
谢谢你!
我的 MWE 相当复杂,看起来与我所拥有的不完全一样(题词较小,但这并不重要)。
\documentclass[12pt]{report}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{lmodern} % use modern latin fonts
\usepackage[T1]{fontenc} % use 8 bit output font encoding with more glyphs
\usepackage{xcolor} % more color choices
\usepackage[english=british]{csquotes} % for correct use of `` '' ... meh!
\usepackage{blindtext}
% an epigraph is a small 'inspirational' text displayed at the beggining of a chapter
\usepackage{epigraph}
\setlength{\epigraphwidth}{.8\textwidth}
\renewcommand{\textflush}{flushleft}
\renewcommand{\epigraphflush}{center}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% provided by school in a .sty file
\topmargin -45truept % Nominal distance from top of paper to top of page
\textwidth=159truemm
\oddsidemargin=0truemm \evensidemargin=0truemm
\makeatletter
\@ifclassloaded{slides}
{\textheight 240truemm}
{
\ifcase \@ptsize
% mods for 10 pt (\baselineskip=12pt)
\textheight 682pt % Height of text (including footnotes and figures)
\or % mods for 11 pt (\baselineskip=13.6pt)
\textheight 690 pt % Height of text (including footnotes and figures)
\or % mods for 12 pt (\baselineskip=15pt)
\textheight 685 pt % Height of text (including footnotes and figures)
\fi
}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Title}
\author{Me}
%% =============================================================================
% This should be in .cls file, ideally
% Remove "Chapter x" line before a new chapter
\makeatletter
\renewcommand{\@makechapterhead}[1]{%
\vspace*{35 pt}% Space before the chapter name
{\setlength{\parindent}{0pt} \raggedright \normalfont
\bfseries\Huge
#1% The chapter's name
\par\nobreak\vspace{35 pt}}} % Space after chapter name
\makeatother
%% =============================================================================
\begin{document}
\chapter[Simultaneous Localisation And Mapping]{Simultaneous\\Localisation\\And\\Mapping}
% no idea why in my real report this is wider ...
\epigraph{`` Using sensory information to locate the robot in its environment is the most fundamental problem to provide a mobile robot with autonomous capabilities. ''}{Ingemar J Cox, 1990}
\blindtext[5]
\end{document}
答案1
\epigraphhead
可用于适当放置题词。确切的距离调整取决于章节标题和题词的内容。有关详细信息,请参阅文档。显然,这还需要适当调整题词的对齐方式和宽度。
对于第一个字母,我尝试了该软件包支持的一种装饰字体emerald
。请参阅文档以获取安装说明,因为该字体不包含在 TeX Live 中。
我也改用了,因为这通常比手动设置布局尺寸更好。请注意,如果相对于该尺寸指定了geometry
标题宽度,则在更改后设置标题宽度很重要。\textwidth
最后,我注意到你实际上使用的不是英式英语引号,而是美式英语。我不知道这对你是否重要,但这似乎很奇怪。
无论如何,我都不建议在题词周围使用引号。这就像在引用块周围使用引号一样,尽管可能不是那么绝对错误,因为我不确定题词的标点符号规则是什么。在我看来,这看起来很奇怪。
无论如何,结果如下
\documentclass[12pt]{report}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[english=british]{csquotes}
\usepackage{blindtext}
\usepackage{epigraph,etoolbox}
\renewcommand{\textflush}{flushleft}
% \renewcommand{\epigraphflush}{center}
\usepackage[textwidth=159mm, hmargin ratio=1:1, vmargin ratio=3:2, verbose]{geometry}
\makeatletter
\AtEndPreamble{%
\normalfont
\ifcase \@ptsize
\geometry{textheight=240mm}%
\or
\geometry{textheight=243mm}%
\or
\geometry{textheight=241mm}%
\fi
}
\makeatother
\setlength{\epigraphwidth}{.4\textwidth}
\title{Title}
\author{Me}
\makeatletter
\renewcommand{\@makechapterhead}[1]{%
\vspace*{35 pt}% Space before the chapter name
{\setlength{\parindent}{0pt} \raggedright \normalfont
\bfseries\Huge
#1
\par\nobreak\vspace{35 pt}}}
\makeatother
\newcommand*\fcap[1]{{\myfancyfont #1}}
\usepackage{emerald}
\let\myfancyfont\ECFDecadenceWithoutTheDiamonds
\begin{document}
\chapter[Simultaneous Localisation And Mapping]{\fcap Simultaneous\\\fcap Localisation\\\fcap And\\\fcap Mapping}
\epigraphhead[150]{\epigraph{\raggedleft `` Using sensory information to locate the robot in its environment is the most fundamental problem to provide a mobile robot with autonomous capabilities. ''}{Ingemar J Cox, 1990}}
\blindtext[5]
\end{document}