views:

2106

answers:

4

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?

A: 

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
A: 

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:

dmckee
+1  A: 

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

webjunkie
A: 

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.