調整小節中的段落邊距

調整小節中的段落邊距

這可能是一個簡單又愚蠢的問題,但它一直困擾著我好幾天。基於我的程式碼:

\documentclass[a4paper, 11pt]{article} 
\usepackage[margin=2cm]{geometry} % changes the margin
\usepackage{enumitem}
\usepackage{titlesec}
\usepackage{indentfirst}
\usepackage{blindtext}

\renewcommand\thesection{\Alph{section}.}
\renewcommand\thesubsection{\arabic{subsection}.}
\titleformat{\section}
{\normalfont\fontsize{11}{.5em}\bfseries}{\thesection}{.5em}
    {}
\titleformat{\subsection}
{\normalfont\fontsize{11}{.5em}\selectfont}{\thesubsection}{.5em}
    {}
\titlespacing % starred version: first paragraph is not indented
{\subsection} % <command>
{1em} % <left>
{.4em} % <before-sep>
{.3em} % <after-sep>

\begin{document}

\section{Introduction}
\subsection{Subsection One}
    \begin{itemize}  [leftmargin=1.3cm,topsep=0pt,itemsep=0pt,parsep=0pt,partopsep=0pt]
        \item some item here and there
        \item some item here and there
    \end{itemize}

\subsection{Subsection Two}
\setlength\parindent{.85cm} \blindtext

\end{document}

結果就是這張照片輸出結果

我的問題是,如何調整與小節編號平行的段落邊距?和不是節號?

答案1

這是你想要的嗎?這一切都依賴於\llap命令,該命令將其參數插入到該行當前點的左側,而不移動後者。

\documentclass[a4paper, 11pt]{article}
\usepackage[margin=2cm]{geometry} % changes the margin
\usepackage{enumitem}
\usepackage{titlesec}
\usepackage{indentfirst}
\usepackage{blindtext}

\renewcommand\thesection{\Alph{section}.}
\renewcommand\thesubsection{\arabic{subsection}.}
\titleformat{\section}
{\normalfont\fontsize{11}{.5em}\bfseries}{\llap{\thesection\hskip0.67em}}{0em}
    {}
\titleformat{\subsection}
{\normalfont\fontsize{11}{.5em}\selectfont}{\thesubsection}{.5em}
    {}
\titlespacing % starred version: first paragraph is not indented
{\subsection} % <command>
{0em} % <left>
{.4em} % <before-sep>
{.3em} % <after-sep>

\begin{document}

\section{Introduction}
\subsection{Subsection One}
    \begin{itemize} [leftmargin=1.3cm,topsep=0pt,itemsep=0pt,parsep=0pt,partopsep=0pt]
        \item some item here and there
        \item some item here and there
    \end{itemize}

\subsection{Subsection Two}
\setlength\parindent{.85cm} \blindtext

\end{document} 

在此輸入影像描述

相關內容