summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hang
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-05-13 21:33:22 +0000
committerKarl Berry <karl@freefriends.org>2015-05-13 21:33:22 +0000
commit7d00fa0a4bf524d8ce252a3948a7a49baaa15f17 (patch)
tree7ffa4782ac3c262a05013522b98e6c06776c999c /Master/texmf-dist/tex/latex/hang
parent9f28862d6cb8fd41c321dae74aba8d5603b2ccc2 (diff)
hang (13may15)
git-svn-id: svn://tug.org/texlive/trunk@37383 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/hang')
-rw-r--r--Master/texmf-dist/tex/latex/hang/hang.sty68
1 files changed, 41 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/hang/hang.sty b/Master/texmf-dist/tex/latex/hang/hang.sty
index 137478befc3..6933b6bbf60 100644
--- a/Master/texmf-dist/tex/latex/hang/hang.sty
+++ b/Master/texmf-dist/tex/latex/hang/hang.sty
@@ -1,9 +1,9 @@
-\ProvidesPackage{hang}[2014/07/31 v1.0 Hanging paragraphs and list items]
+\ProvidesPackage{hang}[2015/05/13 v2.0 Hanging paragraphs and list items]
-% Copyright (C) 2014 Andreas Nolda
+% Copyright (C) 2015 Andreas Nolda
% Author: Andreas Nolda <andreas@nolda.org>
-% Version: 1.0
+% Version: 2.0
% This work may be distributed and/or modified under the conditions of the LaTeX
% Project Public License, either version 1.3 of this license or (at your option)
@@ -11,31 +11,57 @@
% http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all
% distributions of LaTeX version 2005/12/01 or later.
+\newlength{\hangingindent}
+\newlength{\hangingleftmargin}
+\newlength{\labeledleftmargin}
+
+\setlength{\hangingindent}{1em}
+\setlength{\hangingleftmargin}{\z@}
+\setlength{\labeledleftmargin}{\z@}
+
+\newenvironment{hangingpar}%
+ {\begin{list}{}%
+ {\setlength{\leftmargin}{\hangingleftmargin}%
+ \addtolength{\leftmargin}{\hangingindent}%
+ \setlength{\itemindent}{-\hangingindent}%
+ \setlength{\partopsep}{\z@}%
+ \setlength{\parsep}{\z@}%
+ \setlength{\itemsep}{\z@}%
+ \setlength{\topsep}{\z@}}
+ \item{}}%
+ {\end{list}}
+
\newenvironment{hanginglist}%
{\begin{list}{}%
- {\setlength{\leftmargin}{0.5\leftmargini}%
- \setlength{\itemindent}{-0.5\leftmargini}%
+ {\setlength{\leftmargin}{\hangingleftmargin}%
+ \addtolength{\leftmargin}{\hangingindent}%
+ \setlength{\itemindent}{-\hangingindent}%
\setlength{\partopsep}{\z@}}}%
{\end{list}}
\newenvironment{compacthang}%
{\begin{list}{}%
- {\setlength{\leftmargin}{0.5\leftmargini}%
- \setlength{\itemindent}{-0.5\leftmargini}%
+ {\setlength{\leftmargin}{\hangingleftmargin}%
+ \addtolength{\leftmargin}{\hangingindent}%
+ \setlength{\itemindent}{-\hangingindent}%
\setlength{\partopsep}{\z@}%
\setlength{\parsep}{\z@}%
\setlength{\itemsep}{\z@}}}%
{\end{list}}
-\newenvironment{hangingpar}%
+\newenvironment{labeledpar}[2]%
{\begin{list}{}%
- {\setlength{\leftmargin}{0.5\leftmargini}%
- \setlength{\itemindent}{-0.5\leftmargini}%
+ {\renewcommand{\makelabel}[1]{##1\hfil}%
+ \settowidth{\labelwidth}{#1}%
+ \setlength{\labelsep}{1em}%
+ \setlength{\leftmargin}{\labeledleftmargin}%
+ \addtolength{\leftmargin}{\labelwidth}%
+ \addtolength{\leftmargin}{\labelsep}%
\setlength{\partopsep}{\z@}%
\setlength{\parsep}{\z@}%
\setlength{\itemsep}{\z@}%
\setlength{\topsep}{\z@}}
- \item{}}%
+ \item[#2]{}}%
{\end{list}}
\newenvironment{labeledlist}[1]%
@@ -43,7 +69,8 @@
{\renewcommand{\makelabel}[1]{##1\hfil}%
\settowidth{\labelwidth}{#1}%
\setlength{\labelsep}{1em}%
- \setlength{\leftmargin}{\labelwidth}%
+ \setlength{\leftmargin}{\labeledleftmargin}%
+ \addtolength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\partopsep}{\z@}}}%
{\end{list}}
@@ -53,23 +80,10 @@
{\renewcommand{\makelabel}[1]{##1\hfil}%
\settowidth{\labelwidth}{#1}%
\setlength{\labelsep}{1em}%
- \setlength{\leftmargin}{\labelwidth}%
+ \setlength{\leftmargin}{\labeledleftmargin}%
+ \addtolength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\partopsep}{\z@}%
\setlength{\parsep}{\z@}%
\setlength{\itemsep}{\z@}}}%
{\end{list}}
-
-\newenvironment{labeledpar}[2]%
- {\begin{list}{}%
- {\renewcommand{\makelabel}[1]{##1\hfil}%
- \settowidth{\labelwidth}{#1}%
- \setlength{\labelsep}{1em}%
- \setlength{\leftmargin}{\labelwidth}%
- \addtolength{\leftmargin}{\labelsep}%
- \setlength{\partopsep}{\z@}%
- \setlength{\parsep}{\z@}%
- \setlength{\itemsep}{\z@}%
- \setlength{\topsep}{\z@}}
- \item[#2]{}}%
- {\end{list}}