32

The default style for my document is that paragraphs are indented. That's fine. But I need no indentation for paragraphs that follow a figure or other objects.

Using \noindent manually does not work well, because you don't know which paragraph will follow the figure in the final output (LaTeX places figures automatically).

So I need paragraphs that follow figures in the output to not be indented (in the tex source you can't see which ones that would be). How can that be achieved?

webjunkie
  • 6,891
  • 7
  • 46
  • 43
  • What happens when a figure falls in the middle of a paragraph? – David Z Feb 12 '09 at 19:36
  • There still shouldn't be any indentation in that case. But I don't think LaTeX ever does that, it rather puts the figure on a separate page. – webjunkie Feb 12 '09 at 19:45
  • If TeX isn't turing complete, this is not a programming question. – Adam Davis Feb 12 '09 at 19:48
  • 1
    TeX _is_ Turing complete. And is used in some inline documentation specifications. And (less relevant, I'll admit) writing large documents _feels_ like programming. Cheers. – dmckee --- ex-moderator kitten Feb 12 '09 at 19:54
  • How about not indenting *any* paragraphs? Ie, change the style to use a bit of vertical whitespace and no indentation for new paragraphs. (I'm also curious why you care about indentation after figures.) – dreeves Feb 13 '09 at 23:37
  • You can use `[H]` as its placement specifier for figures to place the figure exactly where it is in the LaTeX code. – saviok Apr 12 '14 at 10:56
  • 6
    I'm voting to close this question as off-topic because it belongs on http://tex.stackexchange.com/. – Dave Jarvis Oct 07 '15 at 22:20

6 Answers6

28

Looks like checking which paragraphs come after figures and putting \noindent in front of everyone manually is the only way to do this.

webjunkie
  • 6,891
  • 7
  • 46
  • 43
10

I usally just put "\\" just after the figure.

chikuba
  • 4,229
  • 6
  • 43
  • 75
2

This seems like a very strange request (as well as difficult to satisfy). The figure environment is for objects which are related to, but not part of the text stream.

Here are some suggestions for alternative approaches you might consider:

  • If you insist, you can exert some modest control of the figure placement. See Problem with float and pictures in LaTex.

  • You could increase the amount of white-space separating figures and the body of text. Lookup \textfloatsep, \intextsep, \abovecaptionskip, and \belowcaptionskip.

  • You could try some of the tools in the float or wrapfig packages.

Community
  • 1
  • 1
dmckee --- ex-moderator kitten
  • 98,632
  • 24
  • 142
  • 234
2

My publisher requires the same thing (so the suggestions as not-indenting no paragraph or not doing such a strange thing is out of question). \

I did not find any automatic solution. Instead, I placed as many figures as possible to top or bottom of the page and then manually inserted \noindent after all figures that are placed inline Unfortunately, since the 'h' flag is only a recommendation one has to compile, check output, place indent, compile, check output not place indent, took me about 1 hour for a book of 300 pages.

1

You can put \setlength{\parindent}{0em} before \begin{document}. I use the following:

\setlength{\parident}{0em}
\setlength{\parskip}{1cm}
\begin{document}
  .............

Note that \parskip sets the spacing between paragraphs to 1cm.

Ð..
  • 298
  • 5
  • 18
1

It's been a while since I got deep into latex, so I hope it's ok if I just offer a rough idea - and I'm not at all sure it will work:

IIRC, latex allows you to define your own counters. You could change the figure formatting environment to increment a custom counter, then make the paragraph code set a conditional indent (only if counter equals 1), and subsequently make it reset the counter.

(can't find my latex book either, my wife took it!)

Edit: more thoughts on this - have a look at the topnumber/bottomnumber counters, which are used by Latex to count how many floats it has placed on a page. You will want to use a very similar structure.

yungchin
  • 1,519
  • 2
  • 15
  • 17