I use indentation of the first line for paragraphs. When a new paragraph starts after a code listing (or some other figure), this looks a bit unpleasant to me. What is the typographical convention for this? Is it OK to use \noindent
to supress the indentation?
The typographical convention is to indent the paragraph following a figure (even a display figure). The reason is simple, suppose you have a figure on top of the page and text underneath it, there is nothing signalling that this is the beginning of a new paragraph or the start of a sentence from a paragraph that ended at the previous page. (La)TeX incorporates paragraph indentation in this fashion as a default.
Even when images are placed in the middle, it is good typography to be consistent and they do not look "out of place", if you treat the figures properly. Here is such an example from a statistics book.
\noindent
would work but actually latex goes to a lot of trouble working out if figures and displayed lists etc are between paragraphs or mid-paragraph, and not indenting in the latter case. So if you are getting indentation where you don't want it, then probably you have spurious blank line somewhere signaling the start of a paragraph at a point that you want to consider mid-paragraph.
While I agree entirely with David Carlisle's answer, when it comes to reading my own .tex
files, /I/ like to have some blank space between the start and end of a list or figure or table (etc., etc.) since I find it makes for better reading of the `.tex. file. But you certainly don't want to 'start' a new paragraph where it is inappropriate. So I usually do one of two things:
paragraph text:
%
%
\begin{itemize}
...
\end{itemize}
%
%
resumption of paragraph text....
or I use \noindent
and use plain blank lines to break everything up. I am not consistent across documents, but I tend to be consistent within a document as to which one I use.
-
Depending on your settings, leaving a blank line will also change spacing. I'm not sure how lists are handled, but it can definitely change how math is displayed. – Caramdir Apr 27 '12 at 21:58
-
@Caramdir -- a fair point. I never do math so I have no idea what effect my 'solution' would have. – jon Apr 27 '12 at 22:02
TeX
will know it is not a new paragraph. If that doesnt do, I will move the figure. This clears up the look in the file and you will not do any local fixes. – zeroth Jan 24 '12 at 22:02\noindent
would be correct. – Peter Grill Jan 25 '12 at 2:09rds
's suggestion, you could also indent the listing. – user10274 Jan 25 '12 at 8:29