summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/logical-markup-utils
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-12 00:44:01 +0000
committerKarl Berry <karl@freefriends.org>2009-05-12 00:44:01 +0000
commitdf90badf1401f7fa12c8b7e0c5d47aab18dc0b94 (patch)
tree0fecaf55c6532880a489aa08af6f8deb1a0a4c9a /Master/texmf-dist/tex/latex/logical-markup-utils
parent93266897611e8f360807b1af71d8969972f62937 (diff)
new latex package logical-markup-utils (10may09)
git-svn-id: svn://tug.org/texlive/trunk@13048 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/logical-markup-utils')
-rw-r--r--Master/texmf-dist/tex/latex/logical-markup-utils/onedash.sty42
-rw-r--r--Master/texmf-dist/tex/latex/logical-markup-utils/quoted.sty84
2 files changed, 126 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/logical-markup-utils/onedash.sty b/Master/texmf-dist/tex/latex/logical-markup-utils/onedash.sty
new file mode 100644
index 00000000000..d9ce40ca245
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/logical-markup-utils/onedash.sty
@@ -0,0 +1,42 @@
+% Copyright (C) 2009 Michał Masłowski
+
+% This file is free software: you can redistribute it and/or modify it
+% under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% This file is distributed in the hope that it will be useful, but
+% WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+% As a special exception, when this file is read by TeX when
+% processing a TeX source document, you may use the result without
+% restriction.
+
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{onedash}[2009/05/09 language-dependent dashes]
+
+% Declare option #1 providing quotes consisting of #2 space, #3
+% character and #4 space after it.
+\newcommand{\onedash@declare}[4]{%
+ \DeclareOption{#1}{%
+ \def\onedash@makeit{%
+ \newcommand{\dash}{#2#3#4}
+ \newcommand{\pdash}{#3#4}}}}
+
+\onedash@declare{american}{}{\textemdash}{\hskip0pt}
+\onedash@declare{british}{~}{\textendash}{\ }
+\onedash@declare{polish}{~}{\textendash}{\ }
+\onedash@declare{polish-emdash}{~}{\textemdash}{\ }
+
+\ExecuteOptions{american}\relax % The default.
+\ProcessOptions\relax
+\onedash@makeit
+
+% Hyphen used in Polish.
+\newcommand\hyph{\kern0pt\discretionary{-}{-}{-}\penalty10000\hskip0pt\relax}
diff --git a/Master/texmf-dist/tex/latex/logical-markup-utils/quoted.sty b/Master/texmf-dist/tex/latex/logical-markup-utils/quoted.sty
new file mode 100644
index 00000000000..0d7f8f0226f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/logical-markup-utils/quoted.sty
@@ -0,0 +1,84 @@
+% Copyright (C) 2009 Michał Masłowski
+
+% This file is free software: you can redistribute it and/or modify it
+% under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% This file is distributed in the hope that it will be useful, but
+% WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+% As a special exception, when this file is read by TeX when
+% processing a TeX source document, you may use the result without
+% restriction.
+
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{quoted}[2009/04/17 language-dependent inline quotes]
+
+% Declare a language for quotes. The arguments are the name of the
+% language and all quote commands: outer left, outer right, inner left
+% and inner right.
+\newcommand{\quoted@declarelanguage}[5]{%
+ \DeclareOption{#1}{%
+ \let\quoted@outerleft=#2%
+ \let\quoted@outerright=#3%
+ \let\quoted@innerleft=#4%
+ \let\quoted@innerright=#5}}
+
+\quoted@declarelanguage{american}
+ \textquotedblleft\textquotedblright
+ \textquoteleft\textquoteright
+
+\quoted@declarelanguage{british}
+ \textquoteleft\textquoteright
+ \textquotedblleft\textquotedblright
+
+\quoted@declarelanguage{german}
+ \quotedblbase\textquotedblleft
+ \guillemotright\guillemotleft
+
+\quoted@declarelanguage{polish}
+ \quotedblbase\textquotedblright
+ \guillemotleft\guillemotright
+
+\ExecuteOptions{american}\relax % The default.
+\ProcessOptions\relax
+
+\newif\ifquoted@inquote\quoted@inquotefalse
+
+% In English literature multi-paragraph dialogue has unmatched quotes
+% -- left one is used on the beginning of each paragraph and right one
+% only at the end of the entire speech. Therefore, separate commands
+% for left and right quotes are necessary.
+\DeclareRobustCommand{\lquote}{%
+ \ifquoted@inquote
+ \quoted@innerleft
+ \else
+ \quoted@outerleft
+ \fi}
+\DeclareRobustCommand{\rquote}{%
+ \ifquoted@inquote
+ \quoted@innerright
+ \else
+ \quoted@outerright
+ \fi}
+
+% Since quotes inside quotes have different style, it is changed by
+% the following command.
+\DeclareRobustCommand{\inquote}{%
+ \ifquoted@inquote
+ \quoted@inquotefalse
+ \else
+ \quoted@inquotetrue
+ \fi}
+
+% On the above commands a command which quotes its argument is
+% based.
+\DeclareRobustCommand*{\quoted}[1]{%
+ \lquote{\inquote#1}\rquote}