]> git.lyx.org Git - lyx.git/blob - lib/layouts/hanging.module
Remove profiling.py
[lyx.git] / lib / layouts / hanging.module
1 #\DeclareLyXModule{Hanging Paragraphs}
2 #\DeclareCategory{Paragraph Styles}
3 #DescriptionBegin
4 #Adds an environment for hanging paragraphs. 
5 #Hanging paragraph is a paragraph in which the first line is set to the left margin, but all subsequent lines are indented.
6 #DescriptionEnd
7
8 #Author: Richard Kimberly Heck
9
10 #Hanging paragraph code adapted from hanging.sty, available at:
11 # http://www.ctan.org/tex-archive/macros/latex/contrib/hanging/
12 #Copyright Peter R. Wilson.
13 #Released under the LaTeX Project Public License.
14
15 Format 104
16
17 Style Hanging
18   LatexType Environment
19   LatexName hangparagraphs
20   Align Block
21   Margin Static
22   LeftMargin "MMMM"
23   ParIndent "-MMMM"
24   Requires      ifthen
25   Preamble
26     \newlength{\lyxhang}
27     \IfFileExists{hanging.sty}{
28       % Disable all character activation, as this interferes
29       % with other packages and some languages
30       \PassOptionsToPackage{%
31           notcomma,
32           notperiod,
33           notquote,
34           notquery,
35           notexcl,
36           notcolon,
37           notscolon
38       }{hanging}
39       \usepackage{hanging}
40       \newenvironment{hangparagraphs}
41         {%
42           \ifthenelse{\lengthtest{\parindent > 0pt}}%
43             {\setlength{\lyxhang}{\parindent}}%
44             {\setlength{\lyxhang}{2em}}%
45           \par\begin{hangparas}{\lyxhang}{1}%
46         }
47         {\end{hangparas}}
48     }{%else
49       \newenvironment{hangparagraphs}
50         {%
51           \ifthenelse{\lengthtest{\parindent > 0pt}}%
52             {\setlength{\lyxhang}{\parindent}}%
53             {\setlength{\lyxhang}{2em}}%
54           \begin{hangparas}%
55         }
56         {\end{hangparas}}
57       \newcommand{\hangpara}{\hangindent \lyxhang \hangafter 1 \noindent}
58       \newenvironment{hangparas}{\setlength{\parindent}{\z@}
59       \everypar={\hangpara}}{\par}
60     }
61   EndPreamble
62   DocBookTag             para
63   DocBookAttr            role='hanging'
64 End