summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/shipunov/qqru-shipunov.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/shipunov/qqru-shipunov.sty')
-rw-r--r--Master/texmf-dist/tex/latex/shipunov/qqru-shipunov.sty56
1 files changed, 56 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/shipunov/qqru-shipunov.sty b/Master/texmf-dist/tex/latex/shipunov/qqru-shipunov.sty
new file mode 100644
index 00000000000..5697764dce3
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/shipunov/qqru-shipunov.sty
@@ -0,0 +1,56 @@
+% Author: Alexey B. Shipunov (dactylorhiza@gmail.com)
+% Companion Perl script: txt2qq.pl
+
+\ProvidesPackage{qqru}%
+ [2019/10/04 v0.32 Universal quotes for Russian and English]
+
+\newif\if@QQRU
+\DeclareOption{ru}{\@QQRUtrue}
+\DeclareOption{en}{\@QQRUfalse}
+\newif\if@CONVERT
+\DeclareOption{convert}{\@CONVERTtrue}
+\DeclareOption{noconvert}{\@CONVERTfalse}
+
+\ExecuteOptions{ru,nconvert}
+\ProcessOptions
+
+\if@QQRU
+
+ \def\<{<<}
+ \def\>{>>}
+
+\else
+
+ \def\<{``}
+ \def\>{''}
+
+\fi
+
+\if@CONVERT
+
+{%
+\catcode`\"=\active
+\catcode`\@=11
+\gdef\beginconvertquotes{%
+ \global\catcode`\"=\active
+ \global\chardef\dq=`\"
+ \global\let\dblqu@te=L
+ }
+\gdef"{%
+ \ifinner\else\ifvmode\let\dblqu@te=L\fi\fi
+ \if L\dblqu@te\<\global\let\dblqu@te=R%
+ \else
+ \let\xxx=\spacefactor
+ \>\global\let\dblqu@te=L%
+ \spacefactor\xxx
+ \fi
+ }
+}
+
+\gdef\endconvertquotes{%
+ \catcode`\"=12
+ }
+
+\AtBeginDocument{\beginconvertquotes}
+
+\else\fi