Search code examples
latex

How to disable automatic indentation in latex?


I want to create a pdf in which there are short texts followed by images.

\documentclass{article}

\usepackage{graphicx}

\begin{document}
    \section*{some title}
    A text... \\
    More text... \\
    \includegraphics{example.png}
    \newpage
    A text... \\
    More text... \\
    \includegraphics{example.png}
    \newpage
    A text... \\
    More text... \\
    \includegraphics{example.png}
    \newpage
    \section*{some title}
    A text... \\
    More text... \\
    \includegraphics{example.png}
\end{document}

My problem is that LaTex automatically indents "A text". "More text" is not indented. If "A text" comes after \section*{} it is also not indented.


Solution

  • You can control the width of the indentation by changing \parindent

    \documentclass{article}
    
    \usepackage{graphicx}
    
    \setlength{\parindent}{0pt}
    
    \begin{document}
        \section*{some title}
        A text... 
        
        More text...
        
        \includegraphics{example-image-duck}
        \newpage
        A text... 
        
        More text... 
        
        \includegraphics{example-image-duck}
        \newpage
        A text... 
        
        More text... 
        
        \includegraphics{example-image-duck}
        \newpage
        \section*{some title}
        A text... 
        
        More text... 
        
        \includegraphics{example-image-duck}
    \end{document}
    

    enter image description here

    (you shouldn't abuse \\ for line breaks, leave an empty line instead)