Text FormattingCombine '\hangindent' with flushleft/raggedright

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
jagged
Posts: 4
Joined: Sun Sep 04, 2011 12:35 pm

Combine '\hangindent' with flushleft/raggedright

Post by jagged »

High together,

I have the following macros:

Code: Select all

\newsavebox{\sabox}
\savebox{\sabox}{%
  {\sffamily\bfseries See also}%
  \quad%
}
\newlength{\sahi}
\settowidth{\sahi}{\usebox{\sabox}}

\newcommand{\seealso}{%
  \raggedright%
  \hangindent=\sahi%
  \usebox{\sabox}%
}
In the actual document I intended to use it like

Code: Select all

\seealso \bifref{this}, \bifref{that}.
Of course, the raggedright stays effective after that, so I group it like

Code: Select all

{
  \seealso \bifref{this}, \bifref{that}.
}
But then the items in the following lines (the lists are usually longer than two entries) are not indented.

As the subject suggests, I already attempted flushleft instead of raggedright and the environment version, too. I also tried grouping via a newly defined environment.

Last not least I cannot pass the items in an argument to \seealso, because hyperref complains then.

I also tried list and description environments, but nothing helped. Well, that weren't the favourite way anyway...

So, anyone having an idea? Thanks in advance, and best regards,

Jagged

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply