summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/hang/hang.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/hang/hang.tex
Initial commit
Diffstat (limited to 'macros/latex/contrib/hang/hang.tex')
-rw-r--r--macros/latex/contrib/hang/hang.tex127
1 files changed, 127 insertions, 0 deletions
diff --git a/macros/latex/contrib/hang/hang.tex b/macros/latex/contrib/hang/hang.tex
new file mode 100644
index 0000000000..35d8787630
--- /dev/null
+++ b/macros/latex/contrib/hang/hang.tex
@@ -0,0 +1,127 @@
+\documentclass[a4paper]{ltxdoc}
+\usepackage{hang}
+\usepackage{polyglossia}
+\setdefaultlanguage{english}
+\setotherlanguage{latin}
+\newenvironment{hangingexample}{\medskip\setlength{\hangingleftmargin}{1em}}{\medskip}
+\newenvironment{labeledexample}{\medskip\setlength{\labeledleftmargin}{1em}}{\medskip}
+\newcommand{\lipsum}{\textlatin{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{2017/02/18 (v.\,2.1)}
+\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{hangingexample}
+\begin{hangingpar}
+\lipsum
+\end{hangingpar}
+\end{hangingexample}
+
+\DescribeMacro{\hangingindent} In the following environments, the indentation
+\meta{length} defaults to |1em|. It is controlled by the |\hangingindent|
+length, which can be changed as follows: \begin{quote}
+|\setlength{\hangingindent}{|\meta{length}|}|
+\end{quote}
+
+\DescribeMacro{\hangingleftmargin} The left margin of the whole hanging
+paragraph or list item equals the |\hangingleftmargin| length, which defaults to
+zero. In the above example, it is set to |1em| with |\setlength|.
+
+\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{hanginglist} The |hanginglist| environment sets one or more
+hanging list items:
+\begin{quote}
+|\begin{hanginglist}| \\
+|\item |\meta{text} \\
+\vdots \\
+|\end{hanginglist}|
+\end{quote}
+
+\pagebreak
+\DescribeMacro{compacthang} The |compacthang| environment sets one or more
+hanging list items 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 a text
+block, which is indented by some \meta{length}:
+
+\begin{labeledexample}
+\begin{labeledpar}{\meta{label}}{\meta{label}}
+\lipsum
+\end{labeledpar}
+\end{labeledexample}
+
+The following environments set the indentation \meta{length} to the width of
+their \meta{widest\textunderscore label} argument.
+
+\DescribeMacro{\labeledleftmargin} The left margin of the whole labeled
+paragraph or list item (including the \meta{label}) equals the
+|\labeledleftmargin| length, which defaults to zero, too. In the above example,
+it is again set to |1em|.
+
+\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:
+\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 without vertical space:
+\begin{quote}
+|\begin{compactlabel}{|\meta{widest\textunderscore label}|}| \\
+|\item[|\meta{label}|]|\meta{text} \\
+\vdots \\
+|\end{compactlabel}|
+\end{quote}
+
+\end{document}