diff options
author | Karl Berry <karl@freefriends.org> | 2011-08-12 15:32:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-08-12 15:32:52 +0000 |
commit | 2cea258fda0365adce50be5a29fcd9d87fb6868f (patch) | |
tree | a528e3829ac6bdb849103102317065452120b0c8 /Master/texmf-dist/tex/latex/quoting | |
parent | 8b2864e5e56bf67ac61ff644c72cb5575ff1135c (diff) |
new latex package quoting (11aug11)
git-svn-id: svn://tug.org/texlive/trunk@23512 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/quoting')
-rw-r--r-- | Master/texmf-dist/tex/latex/quoting/quoting.sty | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/quoting/quoting.sty b/Master/texmf-dist/tex/latex/quoting/quoting.sty new file mode 100644 index 00000000000..15066be7d1d --- /dev/null +++ b/Master/texmf-dist/tex/latex/quoting/quoting.sty @@ -0,0 +1,124 @@ +%% +%% This is file `quoting.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% quoting.dtx (with options: `package') +%% +%% Copyright (C) 2011 by Thomas Titz <thomas.titz@chello.at> +%% +%% Permission is granted to distribute and/or modify this work under the +%% terms of the LaTeX Project Public License (LPPL), version 1.3c or +%% later. +%% +%% The LPPL maintenance status of this work is "maintained". +%% +%% This work consists of the files quoting.dtx, quoting.ins and README +%% and the derived files quoting.pdf and quoting.sty. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{quoting} + [2011/08/08 v0.1 Consolidated environment for displayed text] +\RequirePackage{etoolbox,kvoptions} +\SetupKeyvalOptions{family=quo,prefix=quo@} +\newcommand*{\quotingfont}{} +\define@key{quo}{font}{% + \def\quotingfont{\csname #1\endcsname}% +} +\define@key{quo}{font+}{% + \appto{\quotingfont}{\csname #1\endcsname}% +} +\DeclareStringOption[\leftmargin]{leftmargin} +\DeclareStringOption[\quo@leftmargin]{rightmargin} +\newlength{\quo@toppartop} +\deflength{\quo@toppartop}{\topsep + \partopsep} +\DeclareStringOption[\quo@toppartop]{vskip} +\DeclareBoolOption{listvskip} +\DeclareBoolOption{noorphanfirst} +\DeclareBoolOption{noorphanafter} +\define@key{quo}{noorphans}[true]{% + \setbool{quo@noorphanfirst}{#1}% + \setbool{quo@noorphanafter}{#1}% +} +\ProcessKeyvalOptions* +\newcommand*{\quotingsetup}[1]{\setkeys{quo}{#1}} +\newbool{quo@afterquo} +\newbool{quo@afterquoclub} +\newcommand*{\quo@doendquoclub}{% + \ifbool{quo@afterquoclub}{% + \clubpenalty=\@clubpenalty + \everypar{}% + }{% + \booltrue{quo@afterquoclub}% + \clubpenalty=\@M + }% +} +\newcommand*{\quo@doendquo}{% + \booltrue{@endpe}% + \def\par{% + \@restorepar + \everypar{\quo@doendquoclub}% + \par + \boolfalse{@endpe}% + \global\boolfalse{quo@afterquo}% + }% + \everypar{% + {\setbox\z@\lastbox}% + \quo@doendquoclub + \boolfalse{@endpe}% + \global\boolfalse{quo@afterquo}% + }% +} +\newenvironment{quoting}[1][]{% + \setkeys{quo}{#1}% + \list{}{% + \ifbool{quo@listvskip}{% + }{% + \setlength{\topsep}{\quo@vskip}% + \setlength{\partopsep}{\z@}% + }% + \setlength{\itemindent}{% + \ifbool{vmode}{% + \ifbool{quo@afterquo}{% + \z@ + }{% + \ifbool{@nobreak}{% + \ifbool{@afterindent}{% + \parindent + }{% + \z@ + }% + }{% + \parindent + }% + }% + }{% + \z@ + }% + }% + \setlength{\leftmargin}{\quo@leftmargin}% + \setlength{\rightmargin}{\quo@rightmargin}% + \setlength{\listparindent}{\parindent}% + \setlength{\parsep}{\parskip}% + }% + \item\relax + \ifbool{quo@noorphanfirst}{% + \global\booltrue{@nobreak}% + }{% + }% + \quotingfont +}{% + \endlist + \boolfalse{@endpe}% + \ifbool{quo@noorphanafter}{% + \aftergroup\quo@afterquoclubfalse + }{% + \aftergroup\quo@afterquoclubtrue + }% + \global\booltrue{quo@afterquo}% + \aftergroup\quo@doendquo +} +\endinput +%% +%% End of file `quoting.sty'. |