Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am typesetting a manual, that uses normal indentation for paragraphs. The pages have a lot of figures and tables and I would like to have the paragraph after tables and figures to have no indentation. Currently I just use \noindent, but I am sure there is an easier way?

Can anyone explain how this is achieved after sections? It might give me a pointer as to how to write a macro to do this.

share|improve this question
8  
I am not quite sure what you are trying to do. Are you including figures and tables using the standard LaTeX mechanism as floats? In that case, you will not know where the figure will end up. Are you trying to make LaTeX, every time it automatically inserts a figure right before a paragraph, to not indent the paragraph? How are you going to distinguish between a situation where there is a figure at the top of the page and a paragraph starts right after it, and a situation where the paragraph continues from the previous page? –  Jan Hlavacek Sep 1 '10 at 17:08
    
I understand the almost impossible request (due to the floating mechanism). I am trying to make any paragraphs that start after a table or figure to have no first line indentation. After all TeX is Turing complete, there must be a way to do it! –  Yiannis Lazarides Sep 1 '10 at 19:04
    
Why would you want to do this? (The question is neither sarcastic, nor rhetorical.) As @Jan says, without the indent, how is the reader to distinguish a paragraph that begins right after a figure from a paragraph that LaTeX interrupts with a figure and where, by chance, the first post-figure line of the continuing paragraph happens to also start a sentence? –  vanden Sep 1 '10 at 21:30
    
I don't know about if not indenting text is typographically correct when using floats, but I do find irritating that any paragraph right after a quotation environment (specially if it has left and right margin) is indented. –  Hugo S Ferreira Sep 2 '10 at 1:19
1  
A quick workaround is to add a % to the line separating the figure from the following text, to ensure that the text after the figure does not start a new paragraph. –  András Salamon Sep 2 '10 at 8:30

4 Answers 4

up vote 9 down vote accepted

You asked how it is done for sections: \section uses \@afterheading which puts code in \everypar so that it suppress the indentation in the first paragraph and then reset its own content to empty for the following paragraphs. The LaTeX kernel also has a \@doendpe command which is e.g. used by lists to suppress the indentation after the list if there is no empty line/\par following. Here two examples how you could use this code yourself (but I doubt that they can be used in the case of real floats.)

 \documentclass{article}
 \usepackage{lipsum}

 \makeatletter
 %Variant 1:
 \newif\ifafterpar
 \newcommand\afterparnoindent{%
   \afterpartrue
   \everypar{%
     \ifafterpar
       \afterparfalse
       {\setbox\z@\lastbox}%
     \else
       \everypar{}%
     \fi}}

 %Variant 2:
 % will suppress indentation if there is no
 % empty line behind \afterparnoindent
 %\renewcommand\afterparnoindent{\par\@doendpe}
 \makeatother
 \begin{document}

 \lipsum[1]

 abc\afterparnoindent

 first paragraph \lipsum[1]

 the next \lipsum[1]

 \end{document}
share|improve this answer

In any 'normal' application of TeX, the main text and the float boxes are both created independently before they are combined to create actual pages. So by the time it is known where the floats will go on the final combined page, the body text paragraphs have already been typeset, and there is no way to re-indent them.

So unless you only use 'here' floats, manual \noindent is the way to go for floats.

For 'here' floats, section heads and display blocks like quotations it is possible to do this programmatically. I know that this is possible in principle because ConTeXt does it, but I do not know whether there is a LaTeX package or configuration option for such cases.

share|improve this answer
5  
My brain baulks even considering an algorithm in which TeX goes back and retypesets the paragraphs after floats have been inserted :) –  Will Robertson Sep 2 '10 at 9:23
    
Wouldn't it be possible to typeset each paragraph twice, with and without indentation, save the various boxes, and then choose between the two versions when putting floats and text together? (Yes, it is a crazy idea :).) –  Bruno Le Floch Jan 2 '11 at 9:43
    
@Bruno Theoretically: yes, but you would end up having to do your own page breaking completely, as the version with and without the indentation could have different number of lines. Combined with the need to update marks etc., that would soon become a major project. –  Taco Hoekwater Jan 3 '11 at 9:09
    
The paragraph with no indentation will be shorter, so it could be possible to replace the indented paragraph by the non-indented one once the pagebreak is fixed, then add glue between every line to accomodate for the reduction in the size of the paragraph. Well, if someone is crazy... –  Bruno Le Floch Jan 3 '11 at 14:09

This is similar to the question Suppress indentation after environment in LaTeX.

The first answer there works for quotations, and may contribute to a good answer for tables and figures that do NOT float around (ie, placed directly into the text rather than inside a float environment).

share|improve this answer

I'm not sure what you are looking for, but have you tried to use parskip?

\usepackage[parfill]{parskip}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.