File: hanging.module

package info (click to toggle)
lyx 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 138,444 kB
  • sloc: cpp: 244,268; ansic: 106,398; xml: 72,791; python: 39,384; sh: 7,666; makefile: 6,584; pascal: 2,143; perl: 2,101; objc: 1,084; tcl: 163; sed: 16
file content (64 lines) | stat: -rw-r--r-- 1,881 bytes parent folder | download
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
#\DeclareLyXModule{Hanging Paragraphs}
#\DeclareCategory{Paragraph Styles}
#DescriptionBegin
#Adds an environment for hanging paragraphs. 
#Hanging paragraph is a paragraph in which the first line is set to the left margin, but all subsequent lines are indented.
#DescriptionEnd

#Author: Richard Kimberly Heck

#Hanging paragraph code adapted from hanging.sty, available at:
# http://www.ctan.org/tex-archive/macros/latex/contrib/hanging/
#Copyright Peter R. Wilson.
#Released under the LaTeX Project Public License.

Format 111

Style Hanging
  LatexType Environment
  LatexName hangparagraphs
  Align Block
  Margin Static
  LeftMargin "MMMM"
  ParIndent "-MMMM"
  Requires	ifthen
  Preamble
    \newlength{\lyxhang}
    \IfFileExists{hanging.sty}{
      % Disable all character activation, as this interferes
      % with other packages and some languages
      \PassOptionsToPackage{%
          notcomma,
          notperiod,
          notquote,
          notquery,
          notexcl,
          notcolon,
          notscolon
      }{hanging}
      \usepackage{hanging}
      \newenvironment{hangparagraphs}
        {%
          \ifthenelse{\lengthtest{\parindent > 0pt}}%
            {\setlength{\lyxhang}{\parindent}}%
            {\setlength{\lyxhang}{2em}}%
          \par\begin{hangparas}{\lyxhang}{1}%
        }
        {\end{hangparas}}
    }{%else
      \newenvironment{hangparagraphs}
        {%
          \ifthenelse{\lengthtest{\parindent > 0pt}}%
            {\setlength{\lyxhang}{\parindent}}%
            {\setlength{\lyxhang}{2em}}%
          \begin{hangparas}%
        }
        {\end{hangparas}}
      \newcommand{\hangpara}{\hangindent \lyxhang \hangafter 1 \noindent}
      \newenvironment{hangparas}{\setlength{\parindent}{\z@}
      \everypar={\hangpara}}{\par}
    }
  EndPreamble
  DocBookTag             para
  DocBookAttr            role='hanging'
End