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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply