I am having an issue where the first paragraph is being indented after a section heading. For instance
\section{My Section}\label{sec:my-section}
This is my section, and I have no idea why it's being indented
I am using the article class:
\documentclass[10pt]{article}
I have narrowed the issue down to this snippet of code:
\makeatletter
\renewcommand\section{\@startsection {section}{1}{0mm} % name, level, indent
{3pt} % before skip
{3pt} % after skip
{\normalfont\bfseries}}
\makeatother
These are the packages being imported:
\usepackage{float,latexsym,longtable,color}
\usepackage[pdftex]{graphics,graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{setspace}
\usepackage[small,compact]{titlesec}
\usepackage{bm}
\usepackage{fancyhdr}
\usepackage{hangcaption}
\usepackage{amsbsy}
\usepackage{floatflt}
\usepackage{epsfig}
\usepackage{wrapfig} % wrap figures/tables in text
\usepackage{subfigure} % subcaptions for subfigures
\usepackage{threeparttable} % tables with footnotes
\usepackage{dcolumn,multirow} % decimal-aligned tabular math columns
\usepackage{booktabs}
\usepackage{nomencl} % nomenclature package
\usepackage{lscape}
\usepackage{times}
\usepackage[colorlinks=true, linkcolor=DarkBlue, citecolor=DarkBlue, urlcolor=DarkBlue]{hyperref}
\usepackage{array}
\usepackage{caption}
\usepackage[table]{xcolor}
\usepackage{import}
\usepackage{datetime}
\usepackage{flafter}
\usepackage{enumitem} % Better control over lists
Best Answer
With this code you are precisely telling TeX to indent after section titles.
The parameter "before skip" should be negative for having no indentation:
However, it's not a good idea to have fixed spacing around section titles, which don't leave flexibility to the page. Probably
would be a better choice (albeit too tight, in my opinion).
Notice that LaTeX will "change sign" to the specified glue, so it's not a negative vertical spacing.
You would get a very similar result without tampering with low level commands with
so my advice is to remove the
\@startsection
code, as the one provided bytitlesec
is safer.