]> git.lyx.org Git - features.git/commitdiff
Add module to create hanging paragraphs.
authorRichard Heck <rgheck@comcast.net>
Sun, 23 Sep 2007 05:46:22 +0000 (05:46 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 23 Sep 2007 05:46:22 +0000 (05:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20443 a592a061-630c-0410-9148-cb99ea01b6c8

development/scons/scons_manifest.py
lib/Makefile.am
lib/layouts/hanging.module [new file with mode: 0644]

index 185cd021a10614c7bfa46bb325b990b7c95c47d2..edace2149aab48bb157180c7a60ed9591511874a 100644 (file)
@@ -2709,6 +2709,7 @@ lib_layouts_inc_files = Split('''
 lib_layouts_module_files = Split('''
     lib/layouts/endnotes.module
     lib/layouts/foottoend.module
+    lib/layouts/hanging.module
     lib/layouts/logicalmkup.module
     lib/layouts/theorems-ams.module
     lib/layouts/theorems-ams-withinsec.module
index d2569db76430e36b56261ef93052e76298591181..8f7415728d6e3e79595f2832d8b01cf90a6db756 100644 (file)
@@ -1015,6 +1015,7 @@ dist_layouts_DATA =\
        layouts/svglobal.layout \
        layouts/endnotes.module \
        layouts/foottoend.module \
+       layouts/hanging.module \
        layouts/logicalmkup.module \
        layouts/theorems.inc \
        layouts/theorems-ams.inc \
diff --git a/lib/layouts/hanging.module b/lib/layouts/hanging.module
new file mode 100644 (file)
index 0000000..21cb9ae
--- /dev/null
@@ -0,0 +1,45 @@
+#\DeclareLyXModule{Adds an environment for hanging paragraphs.}{Hanging}
+#Author: Richard 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 5
+
+Style Hanging
+  LatexType Environment
+  LatexName hangparagraphs
+  Align Block
+  Margin Static
+  LeftMargin "MMMM"
+  ParIndent "-MMMM"
+  Preamble
+    \usepackage{ifthen}
+    \newlength{\lyxhang}
+    \IfFileExists{hanging.sty}{
+      \usepackage{hanging}
+      \newenvironment{hangparagraphs}
+        {%
+          \ifthenelse{\lengthtest{\parindent > 0pt}}%
+            {\setlength{\lyxhang}{\parindent}}%
+            {\setlength{\lyxhang}{2em}}%
+          \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
+End