2

Is there a way to avoid that the first line of a paragraph in an article using both elsarticle and titlesec be indented? I want to change in some minor way the section format but without losing the \noindent. As a MWE consider:

\documentclass{article}
\usepackage{titlesec}
\titleformat{\section}[hang]{\large\center \slshape}{}{0em}{}
\titleformat{\subsection}[block]{ \itshape}{}{0em}{\filright}
\titleformat{\subsubsection}[runin]{ \itshape}{}{2em}{\filright}
\begin{document}
\section{INTRODUCTION}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sollicitudin      rutrum tellus,
\subsection{A subsection}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sollicitudin rutrum tellus,
\section{ANOTHER SECTION}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sollicitudin     rutrum tellus,


eu luctus dolor commodo eu. Integer pellentesque mollis congue.
\end{document}

And now change the introductory document class to the elsarticle one:

\documentclass[authoryear,review,preprint,12pt,pdf]{elsarticle}

The first line of a section starts with an indent. Can this behavior be changed by adding some command in the way the section command is defined? Thanks.

1
  • 1
    If this is for publication, don't mess with the format. Apr 7, 2019 at 16:45

1 Answer 1

4

There's an option in titlesec for that:

\documentclass[authoryear,review,preprint,12pt,pdf]{elsarticle}
\usepackage{etoolbox}
\usepackage[noindentafter]{titlesec}
\titleformat{\section}[hang]{\large\filcenter \slshape}{}{0em}{}[\leavevmode\hspace*{-\parindent}]
\titleformat{\subsection}[block]{ \itshape}{}{0em}{\filright}
\titleformat{\subsubsection}[runin]{ \itshape}{}{2em}{\filright}

\begin{document}

\section{INTRODUCTION}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sollicitudin rutrum tellus,
\subsection{A subsection}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sollicitudin rutrum tellus,
\section{ANOTHER SECTION}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sollicitudin rutrum tellus,


eu luctus dolor commodo eu. Integer pellentesque mollis congue.

\end{document} 

enter image description here

1
  • Great! I imagined that there might be a option, but I couldn't find it. Thank you.
    – Xavier
    Apr 7, 2019 at 17:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .