我需要缩进\subsubsection
我的论文中的每个元素。
我认为解决方案是这样的
\renewcommand{\subsubsection}{some-magic-here}
但是我对 Latex 还不熟悉,我不知道它有什么样的魔力。;)
有人能帮助我吗?
答案1
结果很糟糕,我看不出有什么理由想要这样做。但这份文件是你的。
\documentclass{article}
\usepackage{changepage}
\usepackage{lipsum} % just for the example
\newenvironment{subs}
{\adjustwidth{3em}{0pt}}
{\endadjustwidth}
\begin{document}
\section{A section}
\lipsum[1]
\subsection{A subsection}
\lipsum[2]
\begin{subs}
\subsubsection{One}
\lipsum[3]
\subsubsection{Two}
\lipsum[4]
\end{subs}
\lipsum[5]
\end{document}
经过以下更改后,小节标题将与左边距齐平。结果比以前更糟糕。
\documentclass{article}
\usepackage{changepage}
\usepackage{lipsum} % just for the example
\newenvironment{subs}
{\adjustwidth{2pc}{0pt}}
{\endadjustwidth}
\makeatletter
\renewcommand\subsubsection{%
\@startsection{subsubsection}{3}
{-2pc}% <------- The opposite of what we set for subs
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries}}
\makeatother
\begin{document}
\section{A section}
\lipsum[1]
\subsection{A subsection}
\lipsum[2]
\begin{subs}
\subsubsection{One}
\lipsum[3]
\subsubsection{Two}
\lipsum[4]
\end{subs}
\lipsum[5]
\end{document}
答案2
\documentclass{article}
\usepackage{lipsum}
\makeatletter
\renewcommand\section{\leftskip 0pt\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries}}
\renewcommand\subsection{\leftskip 0pt\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\large\bfseries}}
\newcommand\Xsubsubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries\leftskip 3ex}}
\renewcommand\subsubsection[1]{\Xsubsubsection{#1}\leftskip 3ex}
\makeatother
\begin{document}
\section{My section}
\lipsum[4]
\subsection{My subsection}
\lipsum[4]
\subsubsection{My subsubsection\label{xxx}}
In subsection \ref{xxx}, we have the indent.
\subsection{Next subsection}
\lipsum[4]
\section{next section}
\lipsum[4]
\end{document}