GeneralNo indent for following paragraph

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
jkh107
Posts: 6
Joined: Thu Jun 21, 2007 10:54 pm

No indent for following paragraph

Post by jkh107 »

I'm trying to make a command that adds a small space with three asterisks in to divide parts of a long document up without using section headings. So far, I have come up with:

Code: Select all

\newcommand{\starspace}{%
\begin{center}%
* $qquad$ * $qquad *%
\end{center}%
}
which produces the correct spacing and asterisks. However, the paragraph following the \starspace command is indented and I would rather it wasn't. This can be overcome by adding \noindent to that paragraph, but I'd like the \starspace command to remove the indentation of the following paragraph automatically. Does anyone know how to do this?

Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
countbela666
Posts: 64
Joined: Thu Apr 26, 2007 2:44 pm

No indent for following paragraph

Post by countbela666 »

Hi,

I'm afraid I am unable to verify your problem. The following minimum working example does not show any indented paragraphs:

Code: Select all

\documentclass{article}
\def\x{text text text text text text text text }
\def\text{\x\x\x\x\x\x\x\x\x\x\x}
\newcommand{\starspace}{%
\begin{center}%
* \hspace{1em} * \hspace{1em} *%  math mode cmd \quad is equivalent to hspace of one em quad 
\end{center}%
}
\begin{document}
  \text\par
  \text
  \starspace
  \text\text\par
  \text
  \starspace
  \text\text
\end{document}
Regards
Marcel
Listen to me children of the night, beyond the doors of darkness you will find
a thousand worlds for you to see here, take my hand and follow me...
jkh107
Posts: 6
Joined: Thu Jun 21, 2007 10:54 pm

No indent for following paragraph

Post by jkh107 »

The example you gave does not indent the following paragraph, but the following slight modification does:

Code: Select all

\documentclass{article}
\def\x{text text text text text text text text }
\def\text{\x\x\x\x\x\x\x\x\x\x\x}
\newcommand{\starspace}{%
\begin{center}%
* \hspace{1em} * \hspace{1em} *%  math mode cmd \quad is equivalent to hspace of one em quad
\end{center}%
}
\begin{document}
  \text\par
  \text

  \starspace

  \text\text\par
  \text
  \starspace
  \text\text
\end{document}
When the paragraphs either side of the \starspace are separated by blank lines, the paragraph following the \starspace is indented. Perhaps I should just make sure that there are no blank lines, though it makes the division less easy to see in the source file.
User avatar
countbela666
Posts: 64
Joined: Thu Apr 26, 2007 2:44 pm

No indent for following paragraph

Post by countbela666 »

Of course there will be an indentation of the next paragraph if you insert a blank line in your code. A blank line (as well as the \par command) says LaTeX to start a new paragraph which is used to be indented by default.

If you need this blank line for means of source code structuring you have to mask the end of line with a comment symbol:

Code: Select all

...
\text\par
\text
%
\starspace
%
\text\text\par
\text
...
Regards
Marcel
Listen to me children of the night, beyond the doors of darkness you will find
a thousand worlds for you to see here, take my hand and follow me...
jkh107
Posts: 6
Joined: Thu Jun 21, 2007 10:54 pm

Re: No indent for following paragraph

Post by jkh107 »

That's a really simple solution - I really should of thought of that myself! Thanks, that really helped.
Post Reply