
如何在每章、節和小節的標題前面加上符號?如果可能的話,我希望在左邊距出現這個符號。符號並不重要。
這是我的 MWE:
\documentclass[fancy,12pt,a4paper,oneside,table]{memoir}
\usepackage{lipsum}
\usepackage{xcolor}
\definecolor{sectioncolour}{RGB}{247,131,53}
\definecolor{chaptercolour}{RGB}{23,85,142}
\definecolor{subsectioncolour}{RGB}{5,130,34}
\renewcommand{\chapnamefont}{\normalfont\large\sffamily\scshape\center\color{chaptercolour}}
\renewcommand{\chapnumfont}{\Huge\bfseries\sffamily\color{chaptercolour}}
\renewcommand{\chaptitlefont}{\normalfont\Huge\bfseries\sffamily\center\color{chaptercolour}}
\setsecheadstyle{\Large\bfseries\sffamily\color{sectioncolour}}
\setsubsecheadstyle{\large\bfseries\sffamily\color{subsectioncolour}}
\begin{document}
\chapter{Guide Intro}
\lipsum[1]
\section{Operations}
\lipsum[2]
\section{General view}
\lipsum[3]
\subsection{General view}
\lipsum[4]
\chapter{Guide: Detailed content}
\lipsum[4]
\chapter{Future}
\lipsum[5]
\end{document}
答案1
根據您的要求,這會在章節和章節標題之前的左邊距中放置一個符號。
% symdivprob.tex SE 639496 (Symbol before divisions)
\documentclass[fancy,12pt,a4paper,oneside,table]{memoir}
\usepackage{lipsum}
\usepackage{xcolor}
\definecolor{sectioncolour}{RGB}{247,131,53}
\definecolor{chaptercolour}{RGB}{23,85,142}
\definecolor{subsectioncolour}{RGB}{5,130,34}
%%%% PW symbol stuff
\newcommand{\symdiv}{$\clubsuit$}
\newcommand{\lsymdiv}{\llap \symdiv}
\let\saveprintchaptitle\printchaptertitle
\renewcommand{\printchaptertitle}[1]{\llap\symdiv #1}
\renewcommand{\chapnamefont}{\normalfont\large\sffamily\scshape\center\color{chaptercolour}}
\renewcommand{\chapnumfont}{\Huge\bfseries\sffamily\color{chaptercolour}}
\renewcommand{\chaptitlefont}{\normalfont\Huge\bfseries\sffamily\center\color{chaptercolour}}
\setsecheadstyle{\Large\bfseries\sffamily\color{sectioncolour}\lsymdiv}
\setsubsecheadstyle{\large\bfseries\sffamily\color{subsectioncolour}\lsymdiv}
\begin{document}
\chapter{Guide Intro}
\lipsum[2]
\section{Operations}
% \lipsum[2]
Just a little bit of text. Just a little bit of text.
Just a little bit of text. Just a little bit of text.
Just a little bit of text. Just a little bit of text.
\subsection{General view}
Just a little bit more of text. Just a little bit more of text.
Just a little bit more of text. Just a little bit more of text.
Just a little bit more of text. Just a little bit more of text.
\end{document}