summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/hang/hang.tex
blob: a536fa7290638aa17f431dbb4dae1be000fac3b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
\documentclass[a4paper]{ltxdoc}
\usepackage{hang}
\newenvironment{example}{\medskip\small}{\medskip}
\newcommand{\lipsum}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.}
\setlength{\parindent}{1em}
\setlength{\leftmargini}{\parindent}
\frenchspacing
\sloppy

\begin{document}
\title{\textsf{hang} -- environments for hanging \\
paragraphs and list items}
\author{Andreas Nolda}
\date{2014/07/31 (v.\,1.0)}
\maketitle

\noindent The \textsf{hang} package provides environments for hanging paragraphs
and list items. In addition, it defines environments for labeled paragraphs and
list items.

\section{Hanging paragraphs and list items}

A \emph{hanging} paragraph or list item is a text block where all lines but the
first one are indented by some \meta{length}:

\begin{example}
\begin{hangingpar}
\lipsum
\end{hangingpar}
\end{example}

\noindent In the following environments, the indentation \meta{length} is equal
to |\leftmargini|, which can be changed as follows:
\begin{quote}
|\setlength{\leftmargini}}{|\meta{length}|}|
\end{quote}

\subsection{Hanging paragraphs}

\DescribeMacro{hangingpar} The |hangingpar| environment sets \emph{single}
hanging paragraphs:
\begin{quote}
|\begin{hangingpar}| \\
\meta{text} \\
|\end{hangingpar}|
\end{quote}

\subsection{Hanging list items}

\DescribeMacro{hangingpar} The |hanginglist| environment sets one or more
hanging list items, with effectively zero left margin:
\begin{quote}
|\begin{hanginglist}| \\
|\item|\meta{text} \\
\vdots \\
|\end{hanginglist}|
\end{quote}

\DescribeMacro{compacthang} The |compacthang| environment sets one or more
hanging list items, with zero left margin and without vertical space:
\begin{quote}
|\begin{compacthang}| \\
|\item|\meta{text} \\
\vdots \\
|\end{compacthang}|
\end{quote}

\section{Labeled paragraphs and list items}

A \emph{labeled} paragraph or list item consist of a \meta{label} and an
indented text block:

\begin{example}
\begin{labeledpar}{\meta{label}}{\meta{label}}
\lipsum
\end{labeledpar}
\end{example}

\noindent The following environments set the indentation to the width of their
\meta{widest\textunderscore label} argument.

\subsection{Labeled paragraphs}

\DescribeMacro{labeledpar} The |labeledpar| environment sets \emph{single}
labeled paragraphs:
\begin{quote}
|\begin{labeledpar}{|\meta{widest\textunderscore label}|}{|\meta{label}|}| \\
\meta{text} \\
|\end{labeledpar}|
\end{quote}

\subsection{Labeled list items}

\DescribeMacro{labeledlist} The |labeledlist| environment sets one or more
labeled list items, with effectively zero left margin:
\begin{quote}
|\begin{labeledlist}{|\meta{widest\textunderscore label}|}| \\
|\item[|\meta{label}|]|\meta{text} \\
\vdots \\
|\end{labeledlist}|
\end{quote}

\DescribeMacro{compactlabel} The |compactlabel| environment sets one or more
labeled list items, with zero left margin and without vertical space:
\begin{quote}
|\begin{compactlabel}{|\meta{widest\textunderscore label}|}| \\
|\item[|\meta{label}|]|\meta{text} \\
\vdots \\
|\end{compactlabel}|
\end{quote}

\end{document}