在我的一个图书项目中,期刊标题始终必须采用斜体,在标题中如此,在目录中亦如此。
但是如果样式规定某些标题本身必须为斜体,该怎么办?
我想要的是:在斜体格式的标题中(此处:部分),强调的部分应采用正常字体,而不是斜体。
我得到的是:所有章节标题都用斜体表示。
我试图在章节标题中用 \normalfont 替换 \textit,但是这也会删除目录中所需的斜体 - 并且它不仅设置括号之间的部分,而且还将标题的其余部分设置为正常字体。
如何才能让 \textit 命令在斜体环境中恢复斜体?如果不可能,是否有其他命令可以手动设置部分标题的格式?
以下是 MWE:
\documentclass[10pt]{book}
\usepackage[nobottomtitles]{titlesec}
\makeatletter%hier definition schriftgrößen-makro
\newcommand\chapsize{\@setfontsize\chapsize{13pt}{6}}
\newcommand\secsize{\@setfontsize\secsize{11.5pt}{6}}
\newcommand\pnsize{\@setfontsize\pnsize{10.5pt}{6}}
\newcommand\appsize{\@setfontsize\appsize{9pt}{6}}
\makeatother
\titleformat{\chapter}[hang]
{\chapsize\centering}{\thechapter.\ }{0pt}{}
\titleformat{\section}[hang]
{\secsize\centering}{\thesection\ }{0pt}{}
\titleformat{\subsection}[hang]
{\pnsize\centering\itshape}{\thesubsection\ }{0pt}{}
\titleformat{\subsubsection}[hang]
{\centering}{\thesubsubsection\ }{0pt}{}
\titleformat{\paragraph}[runin]{\normalfont \itshape}{\theparagraph.}{.7em}{}[.]%Paragraph kursiv mit Punkt
\titlespacing*{\chapter}{0pt}{0pt}{8mm}
\titlespacing*{\section}{0pt}{24pt}{4.233mm}
\titlespacing*{\subsection}{0pt}{24pt}{12pt}
\titlespacing*{\subsubsection}{0pt}{18pt}{6pt}
\begin{document}
\frontmatter
\begingroup
\makeatletter \let\ps@plain\ps@empty \makeatother
\tableofcontents
\endgroup
\mainmatter
\chapter{Chapter 1}
\section{Section 1}
\subsection{Subsection 1.1 with a \textit{Journal title} in it}
\textit{Journal titles} should always be emphasized, also in titles and the TOC.
\end{document}
答案1
通常的做法是使用\emph
(强调)而不是\textit
。这样,在大多数情况\emph
下可以定义为,但当统治风格是斜体时可以定义为其他东西。尝试在您的示例中查看:\textit
\subsection{Subsection 1.1 with a \emph{Journal title} in it}
\documentclass[10pt]{book}
\usepackage[nobottomtitles]{titlesec}
\makeatletter%hier definition schriftgrößen-makro
\newcommand\chapsize{\@setfontsize\chapsize{13pt}{6}}
\newcommand\secsize{\@setfontsize\secsize{11.5pt}{6}}
\newcommand\pnsize{\@setfontsize\pnsize{10.5pt}{6}}
\newcommand\appsize{\@setfontsize\appsize{9pt}{6}}
\makeatother
\titleformat{\chapter}[hang]
{\chapsize\centering}{\thechapter.\ }{0pt}{}
\titleformat{\section}[hang]
{\secsize\centering}{\thesection\ }{0pt}{}
\titleformat{\subsection}[hang]
{\pnsize\centering\itshape}{\thesubsection\ }{0pt}{}
\titleformat{\subsubsection}[hang]
{\centering}{\thesubsubsection\ }{0pt}{}
\titleformat{\paragraph}[runin]{\normalfont \itshape}{\theparagraph.}{.7em}{}[.]%Paragraph kursiv mit Punkt
\titlespacing*{\chapter}{0pt}{0pt}{8mm}
\titlespacing*{\section}{0pt}{24pt}{4.233mm}
\titlespacing*{\subsection}{0pt}{24pt}{12pt}
\titlespacing*{\subsubsection}{0pt}{18pt}{6pt}
\begin{document}
\frontmatter
\begingroup
\makeatletter \let\ps@plain\ps@empty \makeatother
\tableofcontents
\endgroup
\mainmatter
\chapter{Chapter 1}
\section{Section 1}
\subsection{Subsection 1.1 with a \emph{Journal title} in it}
\textit{Journal titles} should always be emphasized, also in titles and the TOC.
\end{document}
\emph
在目录中显示为斜体:
\emph
在斜体标题内显示为罗马字体: