2

Is there any way to automatically remove any indentation of text right after \includegraphics or a \begin{center} environment is used ? Consider the following MWE pertaining to the use of \begin{center}:

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\begin{document}
Some text...
\includegraphics{some_graphic.png}
Moar text...

\begin{center}
Some centered text...
\par\end{center}

Moar text...

\end{document}

I don't want any of the "moar text" to be automatically indented. Using each time a \noindent is not an option.

(This answered question of mine might be of relevance, since there it is explained how to remove indentation of those lines start star with a specific object - in contrast here indentation has to be removed from those lines which are after some specific objects.)

Thanks a lot for any help!

1
  • ! Undefined control sequence. l.8 \includegraphics Jan 14, 2015 at 12:30

1 Answer 1

4

Neither \includegraphics nor center cause indentation so really there is nothing to remove. The indent is added at the start of a paragraph, that is, after a blank line or (equivalently) \par that ends a paragraph.

If you do not want to start a paragraph, avoid using \par

Neither Moar is indented here:

enter image description here

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb,graphicx}
\begin{document}
Some text...
\includegraphics{example-image}
Moar text...
\begin{center}
Some centered text...
\end{center}
Moar text...

\end{document}

(Please post example code in a form that runs without error when copied)

0

You must log in to answer this question.

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