我正在使用titlesec
包和文档类ABNT 类它遵循巴西的文档开发标准。到目前为止,我已经设法遵循巴西计算机协会的科学文章制作指南(这是我的真正目标,以便进一步重复使用),但是同时使用类abnt
和包会破坏文档缩进,因为每个段落都有一个无法管理的titlesec
固定缩进,添加不会产生任何结果,所以我决定使用并使用以下代码强制文档的整体缩进titlesec
[noindentafter]{titlesec}
setspace
\setlength{\parindent}{1.25cm}
为了防止第一段缩进(这是本科学文章模型所要求的),我必须使用\noindent
after \section{}
,\subsection{}
这\subsubsection
真的很烦人,有没有办法自动嵌入\noindent
到节函数调用的末尾?这很简单\section{*}\noindent
编辑:我正在提供 MWS 以供进一步检查
\documentclass[12pt,a4paper]{abnt}
\usepackage{setspace,titlesec,setspace}
\usepackage[utf8]{inputenc}
\titleformat{\section}{\fontsize{13.5pt}{12pt}\selectfont\bfseries}{\thesection}{0.75cm}{}[]
\renewcommand{\thesection}{\arabic{section}.}
\setlength{\parindent}{1.25cm}
\titlespacing*{\section} {0pt}{0pt}{0pt}
\begin{document}
\section{Lorem Ipsum}
This first paragraph is indented, consectetuer adipiscing elit. Etiam lobortis facilisis sem.
Nullam nec mi et neque pharetra sollicitudin.
This paragraph is also indented, ultricies vel, semper in, velit. Ut porttitor. Praesent in
sapien.
\section{Pellentesque Placerat}\noindent
This first paragraph is using noindented, praesent in
sapien. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
This paragraph is indented, ultricies vel, semper in, velit. Ut porttitor. Praesent in
sapien. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis fringilla tristique neque.
Sed interdum libero ut metus.
\end{document}
答案1
很奇怪的是,该模型既需要 ABNT,又需要章节标题后没有缩进。
setspace
和titlesec
都不再需要。相反,您必须恢复 所做的修改indentfirst
,该修改由 加载abnt.cls
。以下文档显示了如何操作:
\documentclass[12pt,a4paper]{abnt}
\makeatletter
% package indentfirst says \let\@afterindentfalse\@afterindenttrue
% and we revert this modification, reinstating the original definitio
% of \@afterindentfalse
\def\@afterindentfalse{\let\if@afterindent\iffalse}
\makeatother
\begin{document}
\section{Lorem Ipsum}
This first paragraph is \emph{NOT} indented, consectetuer adipiscing elit.
Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra sollicitudin.
This paragraph is indented, ultricies vel, semper in, velit. Ut porttitor.
Praesent in sapien.
\section*{Pellentesque Placerat}
This first paragraph is \emph{NOT} indented, praesent in
sapien. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
This paragraph is indented, ultricies vel, semper in, velit. Ut porttitor.
Praesent in sapien. Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Duis fringilla tristique neque. Sed interdum libero ut metus.
\end{document}