Does anyone have a solution to the following problem:
Latex by default indents new paragraphs. But it is actually nicer if it only does so after another paragraph, and not after equations, figures and other objects that leave enough space anyway. The manual solution of adding \noindent or \% is not practical in a large document (I'm writing a book), especially since floating objects move and you never know a priory whether the paragraph will be preceded by another paragraph or not.
Is there any package that solves this problem ?
Thank you for your help,
Ofer
Document Classes ⇒ Indentation of new paragraphs
NEW: TikZ book now 40% off at Amazon.com for a short time.
- pumpkinegan
- Posts: 91
- Joined: Thu May 03, 2007 10:29 pm
Indentation of new paragraphs
What indenting behavior are you referring to? LaTeX does not indent after an equation environment. I presume you have put new lines between your text and equations and figures, for example: This will result in indentation of the paragraph following the equation. The correct way would be:
As for figures, they are floating environments, so it is usually sufficient to insert them in between paragraphs and LaTeX will decide where best to place them. You can force it somewhat with: but my advice would be to just to insert a figure before or after a paragraph where it is referenced.
Code: Select all
Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text.
\begin{equation}
e^{i \pi} = -1
\end{equation}
Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text.
Code: Select all
Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text.
%%--------------------
\begin{equation}
e^{i \pi} = -1
\end{equation}
%%--------------------
Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text. Default text.
Code: Select all
%%---------------------
\begin{figure}[!ht]
...
\end{figure}
%%---------------------
Re: Indentation of new paragraphs
Thank you.
Yet this is not a good solution, because of several reasons:
1. it forces you to make a distinction between a new paragraph that is after an equation, say, and a paragraph that is after another paragraph.
The point is that after the equation/figure it IS a new paragraph, I just don't want it to be indented because there is no need for it.
2. With figures it is even worse. Suppose I take your suggestion and write
text 1.
%
\begin{figure}
...
\end{figure}
%
text 2.
text2 is a new paragraph - it is not a continuation of text1. But since latex will put this float somewhere else, it will cause text2 to appear right after text1, as it belongs to the same paragraph.
What is really needed is a package that knows automatically to indent only after another paragraph. Not after equation, figure, in the beginning of a page etc.
Looking at various text books, I see that people try to achieve this effect sometimes, apparently manually, but most of the time they are inconsistent. This shows me that this is a problem that many people have.
Yet this is not a good solution, because of several reasons:
1. it forces you to make a distinction between a new paragraph that is after an equation, say, and a paragraph that is after another paragraph.
The point is that after the equation/figure it IS a new paragraph, I just don't want it to be indented because there is no need for it.
2. With figures it is even worse. Suppose I take your suggestion and write
text 1.
%
\begin{figure}
...
\end{figure}
%
text 2.
text2 is a new paragraph - it is not a continuation of text1. But since latex will put this float somewhere else, it will cause text2 to appear right after text1, as it belongs to the same paragraph.
What is really needed is a package that knows automatically to indent only after another paragraph. Not after equation, figure, in the beginning of a page etc.
Looking at various text books, I see that people try to achieve this effect sometimes, apparently manually, but most of the time they are inconsistent. This shows me that this is a problem that many people have.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Indentation of new paragraphs
Just insert a switch between the mentioned parts of your source code.
But, as the other suggestions, you have to that after every environment where you don't want the indentation.
Code: Select all
…
\begin{equation}
…
\end{equation}
\noindent
…
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10