2008-01-09 18:51:02 +00:00
|
|
|
#\DeclareLyXModule{Hanging}
|
|
|
|
#DescriptionBegin
|
|
|
|
#Adds an environment for hanging paragraphs.
|
|
|
|
#DescriptionEnd
|
|
|
|
|
2007-09-23 05:46:22 +00:00
|
|
|
#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.
|
|
|
|
|
2008-01-07 16:59:10 +00:00
|
|
|
Format 6
|
2007-09-23 05:46:22 +00:00
|
|
|
|
|
|
|
Style Hanging
|
|
|
|
LatexType Environment
|
|
|
|
LatexName hangparagraphs
|
|
|
|
Align Block
|
|
|
|
Margin Static
|
|
|
|
LeftMargin "MMMM"
|
|
|
|
ParIndent "-MMMM"
|
2008-01-07 17:32:47 +00:00
|
|
|
Requires ifthen
|
2007-09-23 05:46:22 +00:00
|
|
|
Preamble
|
|
|
|
\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
|