Text FormattingLine Distance after '\parbox'

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
maxmax
Posts: 29
Joined: Sat Sep 03, 2011 11:19 am

Line Distance after '\parbox'

Post by maxmax »

Hi all,

i have an example like

Code: Select all

Note: Example text that is in a parbox
      because it is longer than one line
Other text that has a somehow to short distance to the line above

Code: Select all

\documentclass[a4paper,10pt]{article}
\begin{document}
Note: \parbox[t]{4cm}{Example text that is in a parbox because it is longer than one line.}\\
Other text that has a somehow \\to short distance to the line above
\end{document}
Do you know why the distance is too small?
I'd like to have a command like

Code: Select all

\usepackage{linegoal}
\newcommand{\lgbox}[1]{\parbox[t]{\linegoal}{#1}\\}
\newcommand{\note}[1]{Note: \lgbox{#1}}
because I often have such a note in my work. But obviously this looks odd.
Is the parbox the way i used it overall a bad idea? Or exists some command for this matter already?
Last edited by maxmax on Sat Sep 24, 2011 3:18 pm, edited 1 time in total.

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Line Distance after '\parbox'

Post by Stefan Kottwitz »

Hi Max,

welcome to the board!

You could insert a \strut, which is an invisible element with minimum text height and depth, for ensuring the proper line spacing:

Code: Select all

Note: \parbox[t]{4cm}{Example text that is in a parbox
  because it is longer than one line.\strut}\\
Other text that has a somehow \\to short distance to the line above
Stefan
LaTeX.org admin
maxmax
Posts: 29
Joined: Sat Sep 03, 2011 11:19 am

Re: Line Distance after '\parbox'

Post by maxmax »

Thanks again Stefan! :D

I really hope that someday I can return some help to the community, too!
Post Reply