]> git.lyx.org Git - lyx.git/blob - lib/layouts/hanging.module
typo.
[lyx.git] / lib / layouts / hanging.module
1 #\DeclareLyXModule{Hanging}
2 #DescriptionBegin
3 #Adds an environment for hanging paragraphs.
4 #DescriptionEnd
5
6 #Author: Richard Heck
7
8 #Hanging paragraph code adapted from hanging.sty, available at:
9 # http://www.ctan.org/tex-archive/macros/latex/contrib/hanging/
10 #Copyright Peter R. Wilson.
11 #Released under the LaTeX Project Public License.
12
13 Format 6
14
15 Style Hanging
16   LatexType Environment
17   LatexName hangparagraphs
18   Align Block
19   Margin Static
20   LeftMargin "MMMM"
21   ParIndent "-MMMM"
22   Requires      ifthen
23   Preamble
24     \newlength{\lyxhang}
25     \IfFileExists{hanging.sty}{
26       \usepackage{hanging}
27       \newenvironment{hangparagraphs}
28         {%
29           \ifthenelse{\lengthtest{\parindent > 0pt}}%
30             {\setlength{\lyxhang}{\parindent}}%
31             {\setlength{\lyxhang}{2em}}%
32           \begin{hangparas}{\lyxhang}{1}%
33         }
34         {\end{hangparas}}
35     }{%else
36       \newenvironment{hangparagraphs}
37         {%
38           \ifthenelse{\lengthtest{\parindent > 0pt}}%
39             {\setlength{\lyxhang}{\parindent}}%
40             {\setlength{\lyxhang}{2em}}%
41           \begin{hangparas}%
42         }
43         {\end{hangparas}}
44       \newcommand{\hangpara}{\hangindent \lyxhang \hangafter 1 \noindent}
45       \newenvironment{hangparas}{\setlength{\parindent}{\z@}
46       \everypar={\hangpara}}{\par}
47     }
48   EndPreamble
49 End