I have a main text that calls other texts in, and for some reason, despite the main.tex specifically saying no indentation, the tex file indents the first line of every section after the first section.
\documentclass[10pt]{article} % 11pt font
\usepackage[%
colorlinks = true,
citecolor = blue,
linkcolor = blue,
urlcolor = blue,
unicode,
]{hyperref}
% 1in margins
\usepackage[margin=1in]{geometry}
% single line spacing
\usepackage{setspace}
\singlespacing
\usepackage[tiny,compact]{titlesec}
\titleformat{\section}[runin]{\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}[runin]{\bfseries}{\thesubsection}{1em}{}
\usepackage{amsmath}
\usepackage[final,nopatch=footnote]{microtype}
\usepackage{xcolor}
\usepackage{amssymb}
\usepackage{cleveref}
\usepackage{rotating}
\usepackage{tablefootnote}
\newcommand{\note}[1]{\textsf{\textcolor{red}{#1}}}
\newcommand{\comment}[1]{}
\usepackage{etoolbox}
\usepackage{tikz}
\usepackage{caption}
% \usepackage{hyperref}[hyperfootnotes=false]
\usepackage[%
autocite = plain,
backend = biber,
doi = true,
url = true,
giveninits = true,
hyperref = true,
maxbibnames = 99,
maxcitenames = 99,
sortcites = true,
style = numeric,
]{biblatex}
\usepackage{blindtext}
% \input{bibliography-mimosis}
% \addbibresource{references.bib}
% -------------------------
% BEGINNING OF THE DOCUMENT
% -------------------------
\begin{document}
\begin{center}
{\bf Some title}
\
\bf{for the}
\
\bf{document}
\end{center}
\begin{center}
My Name
\end{center}
\begin{center}
\par\noindent\rule{\textwidth}{0.2pt}
\section*{\textsc{\textmd{Summary}}}
\par\noindent\rule{\textwidth}{0.2pt}
\end{center}
\blindtext
\begin{center}
\par\noindent\rule{\textwidth}{0.2pt}
\section*{\textsc{\textmd{Background}}}
\par\noindent\rule{\textwidth}{0.2pt}
\end{center}
\blindtext
\end{document}
Yet for some reason, for the background and beyond tex files, I still have to specify \noindent
Thanks in advance for helping out
Alex
Edit: The Latex script to give a test document. Hopefully, the edit will also keep with the original question and not breach the guidelines.
2nd Edit: How do I add the titles in the format they are currently in without them counting as the first line in the first paragraph? So that the opening line for the corresponding line to the section is not indented. I would like not to use \setlength{\parindent}{0pt} or \noindent in the preamble and body of text respectively.
Thanks
Alex
titlesec. So why don't you add the centering and the horizontal lines to thetitlesecconfiguration of\section(or\section*)? As an alternative totitlesecyou could also usesectstyand see the\sectionruleexample in section 8.2 of the manual. – cabohah Mar 08 '24 at 12:49hyperref) more than once at least not with different options. And if you want to set options for a package, the optional argument has to be before the mandatory with the package name. (The meaning of the optional argument after the package name is for version selection if supported). – cabohah Mar 08 '24 at 12:51\strut\hspace{-\parindent}. Might need an asterisk on the\hspace. This is brute force, so be careful. – rallg Mar 08 '24 at 16:43center.rule\parand\noindentand font commands in a section argument. which should never appear in the document body, they are part of the styling of section heads that you specify elsewhere. If you have the intended markup\section*{Background} Some more text that will also be indented, like I don't wantThen the text does follow the section heading. – David Carlisle Mar 08 '24 at 17:36\bfhas not been defined by default in latex for 30 years, it is defined in article class for comaptibility with documents from the1980s but it does not take an argument it was{\bf document}not\bf{document}the later would make any following text bold as well. – David Carlisle Mar 08 '24 at 17:39runinwhich means the heading is essentially the first few words of the paragraph and so can not have vertically spaced rules above and below. – David Carlisle Mar 08 '24 at 17:41