这可能是一个简单而又愚蠢的问题,但它困扰了我好几天。根据我的代码:
\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}