小節標題左縮排

小節標題左縮排

我正在 LaTex 中使用 Moderncv 套件來準備我的履歷。我一直在為小節標題的左縮排而苦苦掙扎。如何將 \subsection 標題推到左側?

正如您在圖片中看到的那樣,[第 1 款]沿著垂直線對齊,其中[部分]開始。我怎樣才能推動[第 1 款](藍色字幕)向左,使其與下面的行對齊[第 1.1 款:]以子彈開頭?

在此輸入影像描述

答案1

您必須重新定義\subsection命令。

\documentclass[sans]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}

\name{John}{Doe}
\title{Title}

\makeatletter
\RenewDocumentCommand{\subsection}{sm}{%
  \par\addvspace{1ex}%
  \phantomsection{}% reset the anchor for hyperrefs
  \addcontentsline{toc}{subsection}{#2}%
  \strut\subsectionstyle{#2}%
  \par\nobreak\addvspace{.5ex}\@afterheading}% to avoid a pagebreak after the heading
\makeatother

\begin{document}
\maketitle
\section{Section}
\subsection{Subsection 1}
\end{document}

相關內容