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.

How should I have an image? I don't want to interrupt the flow of the text ie no bad intentation. How many enters?

This is line, first line. 
\includegraphics{SecondLineWithoutExtraEnterMessesThingsWhy?.jpg} 
Third Line.

Puzzles

  1. Considering picture -element as text creates awkward situations: why do I need an extra Enter before the image here to look good? Example here.

  2. The same problem as earlier is with equations, I cannot understand why I need an extra enter before equation -block or any other block such as figure when trying to write text with non-intercepted flow. If I don't do this, the blocks move to very odd places. Why?

share|improve this question
    
Linewidth/paperwidth/textwidth here -- not sure whether affecting indentation, apparently not, anyway we discussed this a moment ago. –  hhh Nov 21 '12 at 23:38
1  
Your added comments show some misunderstandings I do not mean that you should consider images to be text I mean LaTeX does, The TeX layout can not tell the difference between an image and \mbox{hello} the behaviour is exactly the sameAlso a single "enter" is just the same as a space you can use them or not to lay out your source file it does not affectthe typeset result. Two enters (a blank line) causes a paragraph break which should be used when you want a new paragraph (a logical rather than viual distinction). –  David Carlisle Nov 22 '12 at 0:01
    
Answer to puzzle 1 and 2 by David: > "Two enters (a blank line) causes a paragraph break which should be used when you want a new paragraph (a logical rather than viual distinction)." This is something that still bothers me, perhaps it is just like that. I hope David will incorporate this thing more clearly into his answer so I can remove this, thanks. –  hhh Nov 22 '12 at 0:10
add comment

1 Answer

up vote 7 down vote accepted

The typesetting of an image is handled exactly same way as that of a letter (say X)

This is line, first line. 
X
Third Line.

Is a single paragraph equivalent to a source of

This is line, first line. X Third Line.

TeX may insert line breaks around the X or not according to its normal paragraph line breaking rules.

This is line, first line. 
\begin{center}
X
\end{center}
Third Line.

Breaks the paragraph with a centered displayed X. Changing center to flushleft would be the same but flush left.

This is line, first line. 
\begin{center}
X
\end{center}

Third Line.

is as above but now Third Line starts a new paragraph so may get different vertical spacing and/or indentation depending on the document settings.

If theimage is much larger than an X the usual form is to wrap it in

\begin{figure}
 X
 \caption{the letter x}
\end{figure}

Then LaTeX will "float" the figure to a suitable point to avoid bad page breaks.


Note that except in special environments like verbatim TeX always treats a single newline exactly like a space. So in your TeX source you can use newlines to improve the look.

An equation is typically entered

Some words
\begin{equation}
a + b
\end{equation}
more words

But TeX would see the same input from

Some words \begin{equation} a + b \end{equation} more words

or from

Some
words
\begin{equation}
a
+
b
\end{equation}
more
words

It is two consecutive newlines (a blank line) that causes different behaviour.

Some words.

More words.

is two paragraphs but while this typically forces a line break and possibly some additional vertical space and possibly indent More depending on the document class, it should be viewed as a logical markup of a paragraph not a way to force a vertical space in the output. It might be typeset as

¶Some words. ¶More words.

all on one line in some special document class layouts.

share|improve this answer
    
what about the Enter before the includegraphics or figure? What is the difference to the Enter after includegraphics? I often mess up with bad looking indentation after image, intercepting the flow of writing -- now I see it much claerer with linewidth, creating surprises due to odd Enters. –  hhh Nov 21 '12 at 23:16
    
a blank line causes a paragraph in TeX. So if you put a blank line before an X or before an \includegraphics the same thing happens you get additional vertical space if \parskip is non zero and the X or image is indented if \parindent is non zero. If you put a blank line after the X it means that the line after the X is starting a paragraph so may get vertical space or indent again depending on \parindent and \parskip –  David Carlisle Nov 21 '12 at 23:21
    
Don't think about the visual layout, think in terms of the logical paragraph structure. If the first line and the third line are part of the same paragraph there should be no blank line between them, if they are different paragraphs there should be a blank line between them. The image probably does not change that logical distinction –  David Carlisle Nov 21 '12 at 23:23
    
"¶Some words. ¶More words.", shoud it be "Some words.¶¶More words."? –  hhh Nov 22 '12 at 0:55
    
No. Two paragraphs each starting with a Pilcrow (¶) which is a traditional paragraph marker symbol. I've never seen two Pilcrows used together as you show, why do you ask? –  David Carlisle Nov 22 '12 at 1:13
show 1 more comment

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.