Page LayoutPeriod in front of paragraph with no title

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
jblocher
Posts: 7
Joined: Mon Feb 01, 2010 3:08 pm

Period in front of paragraph with no title

Post by jblocher »

This seems silly, but I'm pretty new, so at least it will be quick to fix.
When I code this:

Code: Select all

\paragraph{} Write your text here
I get this:
. Write your text here

If I use the basic article class, this goes away, but I'm supposed to use a .cls file provided. How do I change this behavior? I'm not ready to dive into .cls files yet.

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
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Period in front of paragraph with no title

Post by gmedina »

Hi,

what's the point of using a \paragraph command with an empty argument? Tell us what's your goal and we could suggest you an alternative solution.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
jblocher
Posts: 7
Joined: Mon Feb 01, 2010 3:08 pm

Re: Period in front of paragraph with no title

Post by jblocher »

I want to start a new paragraph, indented by 0.25in with some extra space after it, like 0.1in, roughly the equivalent of <CR>,<TAB> in a typical word processor.

If I use \\ and then \indent and \setlength{\parindent}{0.25in} I can get the newline with the correct indenting, but the spacing is the same as the text. I want the paragraphs to be a bit separate from each other. \setlength{\parskip}{0.1in} only seems to work with \paragraph{}.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Period in front of paragraph with no title

Post by gmedina »

The command \\ is designed to produce a line break inside a paragraph; do not use it together with a blanck line to increase the vertical separation between paragraphs; it will produce a bad box.

Changing \parskip is also not a good idea (read the l2tabu document to know the reason).

To increase the vertical separation between paragraphs, you can use the commands \smallskip, \medskip or \bigskip, as the following example suggests:

Code: Select all

\documentclass{article}
\usepackage{graphicx}

\begin{document}

paragraph 1 text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

paragraph 2 text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.\smallskip

\noindent paragraph 3 text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.\medskip

\noindent paragraph 4 text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.\bigskip

\noindent paragraph 5 text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\end{document}
Of course, if the separation between paragraphs has been increased, then the indentation is superfluous; you can suppress the indentation for individual paragraphs by using the \noindent command (as I did in my example); if you want to suppress the indentation for every paragraph, then you can add

Code: Select all

\setlength\parindent{0pt}
in the preamble of your document.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
jblocher
Posts: 7
Joined: Mon Feb 01, 2010 3:08 pm

Period in front of paragraph with no title

Post by jblocher »

Thanks. I guess I didn't realize that LaTeX was sensitive to spaces in the code. Because this doesn't work:

Code: Select all

\documentclass{article}
\usepackage{graphicx}

\begin{document}

paragraph 1 text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
paragraph 2 text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.\smallskip
\noindent paragraph 3 text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.\medskip
\noindent paragraph 4 text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.\bigskip
\noindent paragraph 5 text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\end{document}
The only difference is to remove the lines between the paragraphs. I had been writing this way and the above gives me one great big paragraph with odd extra-spaced lines where the skip commands are.

Is it normal that spaces and carriage returns matter in LaTeX code? I'm not used to worrying about them.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Period in front of paragraph with no title

Post by localghost »

jblocher wrote:[...] Is it normal that spaces and carriage returns matter in LaTeX code? I'm not used to worrying about them.
This is quite normal. Explained in every basic LaTeX documentation [1]. So you better get used to it.

[1] View topic: LaTeX Resources for Beginners


Best regards and welcome to the board
Thorsten
Post Reply