Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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

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.

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.

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top