
フォントサイズを定義し、あなたの質問への回答の助けを借りて、私は次のように状況を解決しました:
\usepackage{titlesec}
\titleformat{\chapter}
{\normalfont\fontfamily{phv}\fontsize{16}{19}\bfseries}{\thechapter}{1em}{}
\titleformat{\section}
{\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries}{\thesubsection}{1em}{}
今、サブセクションにのみ斜体スタイルを追加する必要があります。どうすればいいでしょうか?? ご清聴と貴重なご支援に心より感謝いたします。
答え1
\usepackage{titlesec}
\titleformat{\chapter}
{\normalfont\fontfamily{phv}\fontsize{16}{19}\bfseries}{\thechapter}{1em}{}
\titleformat{\section}
{\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries\itshape}{\thesubsection}{1em}{}
例えば:
\documentclass{book}
\usepackage{titlesec}
\titleformat{\chapter}
{\normalfont\fontfamily{phv}\fontsize{16}{19}\bfseries}{\thechapter}{1em}{}
\titleformat{\section}
{\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries\itshape}{\thesubsection}{1em}{}
\begin{document}
\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\end{document}
このファミリーでは斜体の形状が利用できないため、斜体の代わりに斜体フォントが使用されることに注意してください。
答え2
\fontfamily
明示的な指示はできる限り避けてください。サンセリフ フォントを宣言してから\sffamily
; を使用する方がよいでしょう。傾斜した文字の場合は を追加します\slshape
。タイトルに Helvetica を使用する場合は、ドキュメントでサンセリフ フォントが要求されるすべてのケースで Helvetica を使用する必要があります。
\documentclass{book}
\usepackage{helvet}
\usepackage{titlesec}
\titleformat{\chapter}
{\normalfont\fontsize{16}{19}\sffamily\bfseries}
{\thechapter}
{1em}
{}
\titleformat{\section}
{\normalfont\fontsize{12}{17}\sffamily\bfseries}
{\thesection}
{1em}
{}
\titleformat{\subsection}
{\normalfont\fontsize{12}{17}\sffamily\bfseries\slshape}
{\thesubsection}
{1em}
{}
\begin{document}
\chapter{Something}
\section{Title}
\subsection{Again}
\end{document}
フォーマットしたコードはコンパイルされないことに注意してください。\titleformat
さまざまな引数が明確に表示されるこのレイアウトがコマンドには適しています。