summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pecha
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-13 00:02:18 +0000
committerKarl Berry <karl@freefriends.org>2006-01-13 00:02:18 +0000
commitcbe299856975f45856616a363d84c24107636b1c (patch)
treeb2770e56af1487e39b4929a0ef723f3dfb520c9c /Master/texmf-dist/tex/latex/pecha
parentd7dd51fd716e6c78e75e2e8bef4cade6ebaf58de (diff)
pecha
git-svn-id: svn://tug.org/texlive/trunk@1186 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pecha')
-rw-r--r--Master/texmf-dist/tex/latex/pecha/ctibmantra.sty422
-rw-r--r--Master/texmf-dist/tex/latex/pecha/pecha.cls740
2 files changed, 1162 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/pecha/ctibmantra.sty b/Master/texmf-dist/tex/latex/pecha/ctibmantra.sty
new file mode 100644
index 00000000000..fce11659fcc
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pecha/ctibmantra.sty
@@ -0,0 +1,422 @@
+%\iffalse (Meta-Kommentar)
+% Eine Zusammenstellung von mir häufig gebrauchter
+% Mantra-Stacks für die Erstellung tibetischer Texte.
+% \fi
+% \title{\TibTeX Mantra Tibetan Mantra Stack for \TibTeX}
+% \date{11. November 2004}
+% \author{Dieter Jäger}
+% Version 0.1
+% Copyright 2004 by Dieter Jäger
+% License: GPL
+%
+\ProvidesPackage{ctibmantra}[2004/01/22 V0.0.2 Tibetan Mantra Stacks for ctib]
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{twoopt}
+\RequirePackage{relsize}
+\RequirePackage{calc}
+
+\newlength\ct@a
+\newlength\ct@b
+\newlength\ct@c
+
+% Let's be flexible with languages
+\newcommand{\inlang}[2]{\ifx#1\lang #2\fi}
+
+% choose language for margin notes
+% en, de, tib
+\def\langen{en}
+\def\langde{de}
+\def\langit{it}
+\def\langfr{fr}
+\def\langtib{tib}
+
+% define \def\lang{en} in your main document and use it like
+% \inlang{\langen}{The English text}
+% The text only will be printed if \lang is set to "en"
+% The same with any other language
+
+
+% \section{Erstellen eigener Mantra-Stacks}
+% \begin{quote}|\chstack[h][v]{c1}{c2}|\end{quote}
+% ermöglicht eine vereinfachte Eingabe von solchen Stacks:
+% Es stellt zwei Buchstaben übereinander dar. Dabei wird der
+% Buchstabe ,,c2'' angehoben und ,,c1'' quasi druntergeschoben
+% Mit dem optionalen Parameter ,,v'' kann die Anhebung von ,,c2''
+% angepaßt werden. Der ebenfalls optionale Parameter ,,h'' erlaubt
+% es, die horizontale Position von ,,c1'' anzupassen
+%
+%
+\def\nob{\noboundary\nolinebreak}
+\newcommandtwoopt{\ust}[4][0pt][0pt]{%
+ {\frenchspacing x\notsheg % fix spacing
+ \setlength{\ct@a}{#1}
+ \setlength{\ct@b}{#2}
+ \advance \ct@a by -0.4em
+ \advance \ct@b by 0.6ex
+ \mbox{\raise\ct@b\hbox{\nob#4\nob}\kern\ct@a\hbox{\nob#3\nob}}
+}}
+
+% \begin{quote}|\clstack{h}{v}{c1}{c2}|\end{quote}
+% ermöglicht eine vereinfachte Eingabe von solchen Stacks:
+% Es stellt zwei Buchstaben übereinander dar. Dabei wird der
+% Buchstabe ,,c2'' abgesenkt und ,,c1'' quasi darübergeschoben
+% Mit dem optionalen Parameter ,,v'' kann die Absenkung von ,,c2''
+% angepaßt werden. Der ebenfalls optionale Parameter ,,h'' erlaubt
+% es, die horizontale Position von ,,c1'' anzupassen
+%
+\newcommandtwoopt{\dst}[4][0pt][0pt]{%
+ {\frenchspacing x\notsheg
+ \setlength{\ct@a}{#1}
+ \setlength{\ct@b}{#2}
+ \advance \ct@a by -1em
+ \advance \ct@b by 0.4ex
+ \mbox{\nob\lower\ct@b\hbox{\nob#4\nob}\kern\ct@a\hbox{\nob#3\nob}}
+}}
+
+% a new try, currently not useable :-(
+\newcommandtwoopt{\tibStack}[4][0pt][0pt]{%
+{\frenchspacing%
+ \setlength{\ct@a}{#1}
+ \setlength{\ct@a}{#2}
+ \addtolength{\ct@a}{\widthof{#3}}
+ \addtolength{\ct@b}{\heightof{#3}}
+ \mbox{\nob\lower\ct@b\hbox{\nob#4\nob}\kern-\ct@a\hbox{\nob#3\nob}}
+}}
+
+\newcommandtwoopt{\tibVStack}[4][0pt][0pt]{%
+{\frenchspacing%
+ \setlength{\ct@a}{#1}
+ \setlength{\ct@b}{#2}
+ \addtolength{\ct@a}{\widthof{#3}}
+ \addtolength{\ct@c}{\heightof{#4}}
+ \advance \ct@b by 0.6ex
+ \advance \ct@a by -0.5\ct@c
+ \mbox{\raise\ct@b\hbox{\nob#4\nob}\kern-\ct@a\hbox{\nob#3\nob}}
+}}
+
+
+
+% lot's of small chars
+\def\smallga{\char71}
+\def\smallta{\char84}
+\def\smallpa{\char80}
+\def\smallna{\char78}
+\def\smallda{\char68}
+\def\smallha{\char72}
+\def\smallka{\char75}
+\def\smallnya{\char83}
+\def\smalltsa{\char90}
+\def\smallma{\char77}
+\def\smallha{\char72}
+
+\def\yata{\char89}
+\def\wata{\char87}
+\def\dengu{xe}
+\def\gigu{xi}
+\def\naro{xo}
+\def\shabkyu{xu}
+
+
+\def\ix{\char73}
+\def\ing{\char125}
+\def\ixng{\char127}
+\def\eng{\char126}
+\def\ong{\char124}
+
+% some helper makros
+%\newcommand{\vh}[3]{\raise#1em\hbox{\hskip#2em#3\notsheg}x}
+
+%\def\V#1#2{\noboundary{\ooalign{\noboundary#1\noboundary\cr\lower1.15\fontdimen5\font\hbox{#2\noboundary}}}}
+
+\newcommand{\skipTsheg}{\notsheg\hskip 0.2em\tibTsheg}
+
+
+% Consonants with subscribed achung (sorted after the latin alphabet!)
+\def\A{\kern0.4em\dst[-0.6em][-0.3em]a`}
+\def\Aa{\mbox{\kern0.05em\A\tibRnambcad}\kern0.25em}
+\def\bA{\dst[-0.07em][-0.25ex]{ba}{`}}
+\def\bE{\ust[-0.4em]{ba}{\char69}}
+\def\bI{\dst[0em][-0.2ex]{be}{`}}
+\def\dA{\dst{da}{`}}
+\def\dI{\mbox{\dst[-0.1em][0ex]{di}{`}}}
+\def\dzA{\dst[0em][-0.3ex]{dza}{`}}
+\def\Ee{\ust[-0.6em]{\aa}{\char69}}
+\def\gA{\kern0.2em\dst[-0.25em]{ga}{`}}
+\def\hA{\kern-0.2em\dst{ha}{`}}
+\def\hE{\ust[-0.4em]{ha}{\char69}}
+\def\hO{\ust[-1em]{ha}{\char79}}
+\def\I{\kern0.4em\dst[-0.6em][-0.3ex]{ai}{`}\kern0.2em}
+\def\khA{\kern0.1em\dst[-0.3em][-0.4ex]{kha}{`}}
+\def\kA{\dst[-0.1em]{ka}{`}}
+\def\kI{\dst[-0.2em]{ki}{`}\kern-0.1em}
+\def\lI{\dst[-0.2em][-0.33ex]{li}{`}}
+\def\mA{\dst[-0.2em][-0.4ex]{ma}{`}}
+\def\nA{\ust[-0.6em][-1ex]{na}{`}}
+\def\nE{\ust[-0.3em]{na}{\char69}}
+\def\nI{\dst{ni}{`}}
+\def\Oo{\ust[-0.7em][0.05ex]{\dst[-0.55em][-0.3ex]{a}{`}}{\char79}}
+\def\pA{\dst[0em][-0.3ex]{pa}{`}}
+\def\pU{\kern-0.2em\dst[-0.1em][0.2ex]{\dst[0em][-0.3ex]{p}{`}}{xu}\kern-0.2em}
+\def\rA{\dst[-0.1em][-0.5ex]{ra}{`}\kern-0.1em}
+\def\rI{\dst[-0.2em][-0.4ex]{ri}{`}}
+\def\rU{\dst[-0.2em][-0.4ex]{ra}{`}}
+\def\sA{\kern0.2em\dst[-0.3em][-0.3ex]{sa}{`}}
+\def\shA{\dst[-0.3em]{sha}{`}}
+\def\shI{\dst[-0.3em]{shi}{`}}
+\def\tA{\dst[0.1em][0.2ex]{ta}{`}}
+\def\thA{\dst[0em][-0.1ex]{tha}{`}}
+\def\thI{\dst{ti}{`}}
+\def\tI{\dst{ti}{`}}
+\def\U{\kern0.2em\dst[-0.4em][-0.3ex]{a}{\char86}}
+\def\wA{\kern0.1em\dst[-0.3em][0.17ex]{wa}{`}}
+
+
+
+% rotated letters with achung
+\def\dxA{\kern-0.2em\dst[0.05em][-0.2ex]{dxa}`}
+\def\dxI{\dst{dxi}{`}}
+\def\dxU{\dst{\dxA}{\char18}}
+\def\shxA{\kern0.2em\dst{shxa}{`}\kern-0.2em}
+\def\shxE{\dst[-0.05em]{shxe}{`}}
+\def\swA{\kern0.1em\dst[-0.15em]{swa}{`}}
+
+% stacks with achung
+\def\bhA{\dst[0.07em][0.5ex]{bha}{{\smaller `}}}
+\def\dhA{\dst[0.1em][0.4ex]{dha}{\smaller `}}
+\def\dhI{\dst[0pt][0.4ex]{dhi}{`}}
+\def\dhU{\dst{\dst[-0.1em][0.4ex]{\dst[0.1em][0.2ex]{\smallda}{\smallha}}{{\smaller`}}}{\char21}}
+\def\hrI{\dst[0em][0.1ex]{hri}{`}}
+\def\hrih{\hrI}
+\def\shrI{\dst[-0.32em][0.2ex]{shri}{`}}
+\def\txwa{\dst[0.5em][0.2ex]{tx}{\wata}}
+\def\txwA{\kern-0.2em\mbox{\dst[0em][0.35ex]{\dst[0.6em]{txa}{\smaller\wata}}{\smaller `}}}
+\def\txwAm{\ust[-0.25em]{\txwA}{\tibRjessungaro}}
+\def\txwam{\txwAm}
+
+% better kerning for don
+\def\don{do\notsheg\kern-0.4em n}
+
+% stacks using Snaldan
+\def\achungu{\ust[-0.3em]{'u}{\tibSnaldan}}
+\def\bang{\ust[-0.4em]{ba}{\tibSnaldan}}
+\def\bham{\ust[-0.5em]{bha}{\tibSnaldan}}
+\def\bhrUm{\ust[-0.6ex]{\dst[-0.1em][0.4ex]{\dst[0.07em][0.5ex]{ba}{\hrA}}{\char22}}{\tibSnaldan}}
+\def\droom{\bhrUm}
+\def\ddroom{\mbox{.\kern0.2em\bhrUm\tibRnambcad}}
+\def\hang{\ust[-0.4em]{ha}{\tibSnaldan}}
+\def\gteryang{\ust[-0.6em]{\tibGteryigmgotr}{\tibSnaldan}}
+%\def\hung{\fbox{\kern-0.2em\dst{{\ust[-0.5em]{\dst{ha}{`}}{\tibSnaldan}}}{\char19}\kern-0.2em}}
+\def\hung{\kern-0.2em\dst{{\ust[-0.5em]{\dst[0em][0.02ex]{ha}{`}}{\tibSnaldan}}}{\char19}\kern-0.2em}
+\def\khang{\ust[-0.5em]{kha}{\tibSnaldan}}
+\def\mum{\ust[-0.4em]{mu}{\tibSnaldan}}
+\def\rang{\ust[-0.25em]{ra}{\tibSnaldan}\kern-0.3em}
+\def\trAng{\ust[-0.5em]{\dst{tra}{`}}{\tibSnaldan}}
+\def\yang{\kern0.2em\ust[-0.5em]{ya}{\tibSnaldan}}
+
+% stacks using Rjessungaro
+\def\ang{\ust[-0.5em]{a}{\tibRjessungaro}}
+\def\bam{\ust[-0.25em]{ba}{\tibRjessungaro}}
+\def\dam{\ust[-0.2em]{da}{\tibRjessungaro}}
+\def\dyam{\ust[-0.5em]{\dya}{\tibRjessungaro}}
+\def\ham{\kern0.15em\ust[-0.3em]{ha}{\tibRjessungaro}}
+\def\hum{\hung}
+\def\kam{\ust[-0.35em]{ka}{\tibRjessungaro}}
+\def\kem{\ust[-0.7em]{ka}{\eng}}
+\def\keng{\kem}
+\def\kham{\kern0.15em\ust[-0.35em]{kha}{\tibRjessungaro}}
+\def\khrom{\ust[-0.35em][0.25ex]{khro}{\tibRjessungaro}\kern-0.2em}
+\def\kingka{ki\notsheg\kern-0.15em\ngka}
+\def\lam{\kern0.2em\ust[-0.4em]{la}{\tibRjessungaro}}
+\def\lyam{\kern0.2em\ust[-0.5em]{\dst[0em][-0.6ex]{la}{\char89}}{\tibRjessungaro}}
+\def\mam{\ust[-0.3em]{ma}{\tibRjessungaro}}
+\def\nam{\ust[-0.35em]{\dst{na}{`}}{\tibRjessungaro}}
+\def\ram{\ust[-0.2em]{ra}{\tibRjessungaro}\kern-0.3em}
+\def\rgham{\kern0.15em\ust[-0.45em]{\rgha}{\tibRjessungaro}}
+\def\sang{\kern0.2em\ust[-0.4em]{sa}{\tibRjessungaro}}
+\def\sham{\ust[-0.5em]{sha}{\tibRjessungaro}}
+\def\sum{\ust[-0.3em]{su}{\tibRjessungaro}}
+\def\tam{\ust[-0.15em]{ta}{\tibRjessungaro}}
+\def\tatam{\ust[-0.2em]{\tata}{\tibRjessungaro}}
+\def\tram{\ust[-0.3em]{tra}{\tibRjessungaro}}
+\def\ttam{\tatam}
+\def\wam{\mbox{\kern0.3em\ust[-0.5em]{wa}{\tibRjessungaro}}}
+\def\yam{\kern0.2em\ust[-0.35em]{ya}{\tibRjessungaro}}
+\def\yang{\ust[-0.4em]{ya}{\tibRjessungaro}}
+
+% stacks using Nyizlanaada
+\def\althung{\kern-0.2em\dst{{\ust[-0.5em]{\dst[0em][0.02ex]{ha}{`}}{\tibNyizlanaada}}}{\char19}\kern-0.2em}
+
+% other stacks not in standard ctib/dtib
+\def\bhayo{\kern-0.2em\dst[0.2em][0.4ex]{bo}{hya}\kern-0.3em}
+%\def\bhya{\dst[0.2em][0.4ex]{ba}{hya}\kern0.1em}
+%\def\bhyo{\kern-0.2em\dst[0.2em][0.4ex]{bo}{hya}\kern-0.3em}
+\def\ddha{\dst[0.2em][0.2ex]{\smallda}{dha}}
+\def\ddhe{\kern0.1em\dst[0em][0.2ex]{\ust[-0.3em][-0.6ex]{\smallda}{xe}}{dha}\kern-0.2em}
+\def\ddhi{\dst[0.em][0.2ex]{\ust[-0.45em][-0.6ex]{\smallda}{xi}}{dha}\kern-0.2em}
+\def\ddho{\dst[-0.2em][0.3ex]{{\ust[-0.9em][-0.6ex]{\smallda}{xo}}}{dha}}
+\def\dga{\dst[0.15em][0.3ex]{\smallda}{\smallga}}
+\def\dhra{\kern-0.35em\dst[0.2em][0.2ex]{\smallda}{{\smaller hra\notsheg}}}
+\def\dma{\kern-0.1em\dst[0.15em][0.35em]{da}{ma}\kern0.1em}
+\def\dme{\dma\kern-1em\dengu\notsheg\kern0.15em}
+\def\dmi{\dma\kern-1em\gigu\notsheg\kern0.15em}
+\def\dmo{\dma\kern-1.25em\naro\notsheg\kern-0.1em}
+\def\drix{\ust[-0.45em]{dra}{\ix}}
+\def\dhu{dhu}
+\def\dhya{\dst[0.1em][0.2ex]{\char68}{\smaller hya}}
+\def\dya{\kern0.1em\dst[0.15em][-0.15ex]{da}{\smaller \yata}}
+\def\dznyA{\dst[0em][0.5ex]{\dst[0.2em][0.3ex]{dza}{\char83}}{`}\kern-0.15em}
+\def\dzwa{\kern0.2em\dst[0.35em][-0.3ex]{dz}{\wata}\kern-0.2em}
+\def\ghna{\kern0.25em\dst[0em][1.1ex]{gha}{\smallna}}
+\def\ghra{\dst[0.05em][0.3ex]{\smallga}{hra}}
+\def\ghri{\dst[0.05em][0.3ex]{\smallga}{hra}\nolinebreak\kern-1em~xi\notsheg}
+\def\hrA{\dst[0em][0.1ex]{hra}{\smaller `}}
+\def\hna{\dst[0.15em][0.4ex]{\smallha}{\smallna}}
+\def\hne{\hna\kern-0.9em\dengu}
+\def\hring{\ust[-0.75em]{\hrA}{\ing}}
+\def\kki{\dst[0.05em][0.4ex]{ki}{ka}}
+\def\kka{\dst[0.05em][0.4ex]{ka}{ka}}
+\def\kmo{\dst[0em][0.3ex]{ko}{ma}\kern-0.2em}
+\def\ksha{\raise0.1ex\hbox{\smaller\dst[0em][0.3ex]{ka}{sha}}}
+\def\kshxa{\dst{\smallka}{\smaller\smaller shxa}}
+\def\kta{\kern0.2em\dst[0.1em][0.3ex]{\char75}{\char84}}
+\def\kto{\kta\kern-1.2em\naro\notsheg\kern-0.2em}
+\def\ling{\ust[-0.8em]{la}{\char125}}
+\def\lle{\dst[-0.1em][0.4ex]{le}{la}}
+\def\mme{\dst[0.1em][0.35ex]{me}{ma}}
+\def\mla{\dst[0.1em][0.4ex]{ma}{la}}
+\def\mrix{\kern-0.1em\ust[-0.55em]{mra}{\char73}}
+\def\nda{\dst[0.25em][0.5ex]{na}{{\smaller da\notsheg}}}
+\def\ndA{\dst[0em][0.5ex]{\nda}{\smaller `}}
+\def\ndha{\dst[0.25em][0.3ex]{\char78}{dha}}
+\def\ndhe{\dst[0.25em][0.3ex]{\char78}{dha}\kern-0.8em\dengu}
+\def\ndri{\dst[0em][0.7ex]{ni}{dr}}
+\def\ndxa{\dst[0.25em][0.4ex]{na}{\smaller dxa}}
+\def\ndxi{\kern-0.1em\dst[0.2em][0.4ex]{ni}{dxa}}
+\def\ngga{\kern-0.2em\dst[0.2em][0.5ex]{ng}{\smallga}}
+\def\nxdxa{\dst[0.3em][0.5ex]{nxa}{\smaller dxa}}
+\def\ngha{\kern-0.1em\dst[0.2em][0.45ex]{nga}{\smallha}}
+\def\ngka{\dst[0.15em][0.4ex]{\char81}{\char75}}
+\def\ngta{\dst[0.2em][0.3ex]{\char81}{\char84}}
+\def\nna{\dst[0.3em][0.3ex]{\smallna}{\smallna}}
+\def\nrix{\kern-0.2em\ust[-0.5em]{nra}{\ix}}
+\def\nta{\dst[0.28em][0.35em]{\smallna}{\smallta}}
+\def\nte{\mbox{xe\kern-1em\dst[0.3em][0.4ex]{\char78}{\char84}}}
+\def\nting{\kern-0.2em\ust[-0.6em]{\nta}{\ing}}
+\def\ntra{\kern-0.15em\dst[0.35em][0.2ex]{\smallna}{\smaller tra}}
+\def\ntsa{\dst[0.1em][0.4ex]{\smallna}{\smalltsa}\kern0.25em}
+\def\ntu{\dst{\kern-0.15em\dst[0.3em][0.3ex]{\char78}{\char84}}{\char17}}
+\def\nydza{\dst[0em][0.5ex]{\char83}{dza}}
+\def\nytsa{\dst[-0.1em][0.4ex]{\smallnya}{\smalltsa}\kern0.1em}
+\def\pda{\dst[0.1em][0.2ex]{\smallpa}{\smallda}}
+\def\pheem{\ust[-0.9em]{{\ust[-0.4em]{pha}{\char69}}}{\char24}}
+\def\shxpe{\dst[0.15em][0.4ex]{shxe}{pa}}
+\def\rya{\dst[0em][0.3ex]{r}{y}}
+\def\rshe{\kern-0.2em\dst[0.2em]{re}{\smaller sha}}
+\def\rdha{\raise0.05em\hbox{\dst[0.3em][0.6ex]{\smaller rda}{\smallha}}}
+\def\rgha{\dst[0.2em][0.6ex]{rga}{\smallha}}
+\def\rmA{\kern0.15em\dst[-0.15em][-0.05ex]{rma}{`}}
+\def\rshxa{\raise0.1ex\hbox{\dst[-0.1em][0.1ex]{\smaller ra}{\smaller shxa}\kern-0.1em}}
+\def\shlo{\dst[0em][0.5ex]{sho}{\char76}}
+\def\shta{\dst[0.3em][0.3ex]{shxa}{\smaller txa}}
+\def\spha{\dst[0.05em][0.35ex]{sa}{pha}}
+\def\shwA{\dst[-0.25em][0.2ex]{shwa}{`}}
+\def\shthxa{\kern0.15em\dst[-0.05em][0.4ex]{sha}{\smaller thxa}}
+\def\shxtxa{\mbox{\dst[0.2em][0.6ex]{shx}{tx}}}
+\def\shxtxA{\kern0.3em\dst[-0.15em][0.6ex]{\shxtxa}{{\smaller \smaller `}}}
+\def\shxtxing{\kern-0.2em\ust[-0.6em][0.05ex]{\shxtxa}{\ing}}
+\def\sphu{\raise0.05ex\hbox{\dst[0.1em][0.3ex]{\smaller sa}{\smaller pha}}}
+\def\stwa{\dst[0.3em][0.3ex]{\dst[0.2em][0.3ex]{sa}{\smallta}}{\wata}}
+\def\sya{\dst[0em][-0.55ex]{sa}{\yata}}
+\def\tma{\dst[0.2em][0.4ex]{\smallta}{\smallma}}
+\def\tstsha{\dst[-0.05em][0.3ex]{\smalltsa}{\smaller tsha}}
+\def\tstshi{\tstsha\kern-1em\gigu}
+\def\tna{\dst[0.3em][0.4ex]{\char84}{\char78}}
+\def\taya{\dst[0.45em]{\mbox{ta\notsheg}}{\smaller\smaller\smaller\yata}\notsheg}
+\def\tpa{\dst[0.2em][0.35ex]{\smallta}{\smallpa}}
+\def\tata{\dst[0.3em][0.35ex]{\char84}{\char84}}
+\def\tta{\tata}
+\def\ttaa{\dst[0em][0.4ex]{\tta}{{\smaller`}}}
+\def\ttA{\ttaa}
+
+% mantra syllables
+\def\akarshxaya{a ka \rshxa, ya}
+\def\amrita{\mbox{a \mrix, ta\notsheg}}
+\def\anurakto{a nu ra \kto}
+\def\argham{a\notsheg\rgham}
+\def\atmako{\aa \tma, ko\notsheg}
+\def\balingta{ba\notsheg\ling, ta\notsheg}
+\def\bhAndxa{\mbox{\bhA\ndxa}}
+\def\bhandxa{\mbox{bha\notsheg\ndxa}}
+\def\bhandha{\mbox{bha\notsheg\ndha}}
+\def\bighnan{\mbox{bi\notsheg{\ghna}n\notsheg}}
+\def\bhuddha{\mbox{bhu\notsheg\ddha}}
+\def\bushxtxing{\mbox{bu\notsheg\shxtxing}}
+\def\dhAkinI{\mbox{\dhA, ki \nI}}
+\def\dharmA{\mbox{dha\notsheg\rmA}}
+\def\dushxtxAn{\mbox{du\notsheg{\shxtxA}\kern-0.15em n\notsheg}}
+\def\dzwala{\mbox{\dzwa, la}}
+\def\gandhe{\mbox{ga\notsheg\ndhe}}
+\def\gindris{gi\notsheg{\ndri}s}
+\def\ghrihne{\mbox{\ghri\hne}}
+\def\hayagriwa{hya \ghri, wa\notsheg}
+\def\khatxwAm{\mbox{kha \txwAm}}
+\def\kIlaya{\kI, la ya\notsheg}
+\def\krodhra{\mbox{kro\notsheg\dhra}}
+\def\dznyAna{\mbox{\dznyA, na\notsheg}}
+\def\mandA{\mbox{ma\notsheg\ndA}}
+\def\mandxala{\mbox{ma\notsheg\ndxa la\notsheg}}
+\def\mangga{\mbox{ma\notsheg\ngga}}
+\def\manggalam{\mangga, \lam}
+\def\mangha{\mbox{ma\notsheg\ngha}}
+\def\muntra{\mbox{mu\notsheg\ntra}}
+\def\munytsa{\mbox{mu\notsheg\nytsa}}
+\def\pAdyam{\mbox{\pA\dyam}}
+\def\padma{\mbox{pa\notsheg\dma}\kern-0.2em}
+\def\padme{\mbox{pa\notsheg\dme}\kern-0.2em}
+\def\padmi{\mbox{pa\notsheg\dmi}\kern-0.2em}
+\def\padmo{\mbox{pa\notsheg\dmo}\kern-0.2em}
+\def\pandxi{\mbox{pa\notsheg\ndxi}}
+\def\panytsa{pa\notsheg\nytsa}
+\def\pushxpe{\mbox{pu\notsheg\shxpe}}
+\def\rakmo{\mbox{ra\notsheg\kmo}}
+\def\rakshxa{\mbox{ra\notsheg\kshxa}}
+\def\rakta{\mbox{ra\notsheg\kern-0.15em\kta}}
+\def\rakto{\mbox{ra\notsheg\kern-0.15em\kto}}
+\def\ratna{\mbox{ra\notsheg\tna}}
+\def\spharana{\spha, ra na\notsheg}
+\def\shapda{\mbox{sha\notsheg\pda}}
+\def\shanting{\mbox{sha\notsheg\nting}}
+\def\shuddho{\mbox{shu\notsheg\ddho}}
+\def\shuddhe{\mbox{shu\notsheg\ddhe}}
+\def\shwAna{\mbox{\shwA,na}}
+\def\siddhi{\mbox{si\notsheg\ddhi}}
+\def\singha{\mbox{si\notsheg\ngha}}
+\def\shinting{\mbox{\shI\notsheg\kern-0.1em\ust[-0.2em]{\nta}{\tibRjessungaro}}}
+\def\tishthxa{ti\notsheg\shthxa}
+\def\tsitta{\mbox{tsi\notsheg\kern-0.2em\tta}}
+\def\utpal{\mbox{u\notsheg{\tpa}l\notsheg}}
+\def\udgate{\mbox{u\notsheg\dga, te\notsheg}}
+\def\utsishta{u \tstshi, \shta}
+\def\vajra{badzra}
+\def\wAn{{\mbox{\wA}n\notsheg}}
+
+% common Mantras
+\def\MArgam{\om, badzra \argham, \pAdyam, \pushxpe, \dhU pe, \A, lo ke \gandhe, \nE, wi \dya, \shapda, pra \thI, \tstsha, ya \swA, \hA. }
+
+%\def\MConsonants{ka kha ga gha nga. tsa tsha dza dzha nya. txa thxa dxa dxha nxa. ta tha da dha na. pa pha ba bha ma. ya ra la wa. sha shxa sa ha kshxa}
+
+\def\MConsonants{ka kha ga gha nga. tsa tsha dza dzha nya. txa thxa dxa dxha nxa. ta tha da dha na. pa pha ba bha ma. ya ra la wa. sha shxa sa ha kshxa}
+
+\def\MOmAhHung{\om, \Aa \hung: }
+
+\def\MVajraGuru{\om, \Aa \althung, badzra gu ru \padma, \siddhi, \althung: }
+
+\def\MMani{\om, ma ni \padme, \hung: }
+
+\def\MInterdependence{\om, ye \dharmA, he tu pra bha \wA, he tu \nte \shxA, \nta, \thA, ga to hya wa dat te \shxA, \ntsa, yo ni ro dha e \wam, \bA, \dI, ma \hA, shra ma na \sA, \hA. }
+
+\def\MVajraKilaya{\om, badzra \kI, li \kI la ya sarba \bighnan, \bam, \hung, phatx. \mbox{dza\tibRnambcad} \hung, \Aa\K}
+
+\def\MVocals{a \A. i \I. u \U. ri \rI. li \lI. e~\Ee. o \Oo. \ang, a}
+
+\def\MVocalsConsonants{\MVocals. \MConsonants}
diff --git a/Master/texmf-dist/tex/latex/pecha/pecha.cls b/Master/texmf-dist/tex/latex/pecha/pecha.cls
new file mode 100644
index 00000000000..0507186effb
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pecha/pecha.cls
@@ -0,0 +1,740 @@
+%\iffalse (Meta-Kommentar)
+% Eine Klasse zur Erstellung von Tibetischen Texten mit \TibTeX
+% \fi
+% \title{Eine \LaTeX2e~Klasse zur Erstellung tibetischer Texte mit \TibTeX}
+% \author{Dieter Jäger}
+% Version 0.1 - 10.11.2004
+% Copyright 2004 by Dieter Jäger
+% License: GPL
+
+\ProvidesClass{pecha}[2004/11/10 v0.1 Tibetan Pecha document class]
+\NeedsTeXFormat{LaTeX2e}
+% Tibetan language package
+\RequirePackage{ctib}
+
+% This is needed to be able to do the margin texts
+\RequirePackage{rotating}
+
+
+% Set page dimensons
+% All the page sizes from the standard classes
+% But a5 or b5 may not be very usefull
+
+\DeclareOption{a4pecha3}
+ {\setlength\paperwidth {297mm}
+ \setlength\paperheight {70mm}}
+\DeclareOption{a4pecha2}
+ {\setlength\paperwidth {297mm}
+ \setlength\paperheight {140mm}}
+\DeclareOption{a4paper}
+ {\setlength\paperwidth {297mm}%
+ \setlength\paperheight {210mm}}
+\DeclareOption{a5pecha3}
+ {\setlength\paperwidth {210mm}%
+ \setlength\paperheight {47mm}}
+\DeclareOption{a5pecha2}
+ {\setlength\paperwidth {210mm}%
+ \setlength\paperheight {74mm}}
+\DeclareOption{a5paper}
+ {\setlength\paperwidth {210mm}%
+ \setlength\paperheight {148mm}}
+\DeclareOption{b5pecha3}
+ {\setlength\paperwidth {250mm}%
+ \setlength\paperheight {49.3mm}}
+\DeclareOption{b5pecha2}
+ {\setlength\paperwidth {250mm}%
+ \setlength\paperheight {74mm}}
+\DeclareOption{b5pecha3}
+ {\setlength\paperwidth {250mm}%
+ \setlength\paperheight {58.67mm}}
+\DeclareOption{b5pecha2}
+ {\setlength\paperwidth {250mm}%
+ \setlength\paperheight {88mm}}
+\DeclareOption{b5paper}
+ {\setlength\paperwidth {250mm}%
+ \setlength\paperheight {176mm}}
+\DeclareOption{letterpecha3}
+ {\setlength\paperwidth {11in}%
+ \setlength\paperheight {2.83in}}
+\DeclareOption{letterpecha2}
+ {\setlength\paperwidth {11in}%
+ \setlength\paperheight {4.25in}}
+\DeclareOption{letterpaper}
+ {\setlength\paperwidth {11in}%
+ \setlength\paperheight {8.5in}}
+\DeclareOption{legalpecha3}
+ {\setlength\paperwidth {14in}%
+ \setlength\paperheight {2.83in}}
+\DeclareOption{legalpecha2}
+ {\setlength\paperwidth {14in}%
+ \setlength\paperheight {4.25in}}
+\DeclareOption{legalpaper}
+ {\setlength\paperwidth {14in}%
+ \setlength\paperheight {8.5in}}
+\DeclareOption{executivepaper}
+ {\setlength\paperwidth {10.5in}%
+ \setlength\paperheight {2.42in}}
+\DeclareOption{executivepaper}
+ {\setlength\paperwidth {10.5in}%
+ \setlength\paperheight {3.625in}}
+\DeclareOption{executivepaper}
+ {\setlength\paperwidth {10.5in}%
+ \setlength\paperheight {7.25in}}
+
+% This is from the book class
+% May be changed in future ...
+\newcommand\@ptsize{0}
+\DeclareOption{8pt}{\renewcommand\@ptsize{8}}
+\DeclareOption{9pt}{\renewcommand\@ptsize{9}}
+\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
+\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
+\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
+
+\@lowpenalty 51
+\@medpenalty 151
+\@highpenalty 301
+
+%\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
+%\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
+%\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
+%\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
+%\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
+%\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
+%\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
+%\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
+%\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
+
+
+% option "rotate", standard: do not do that
+% If set the class will rotate the even pages by 180 degrees
+\newif\if@pecharotate
+\@pecharotatefalse
+
+% standard page frame, using double lines
+\def\@pageframe#1{\@doubleframe{#1}}
+\newif\if@fsingle
+\@fsinglefalse
+\newif\if@ffancy
+\@ffancyfalse
+
+\newlength\@rulers
+
+\DeclareOption{rotate}{\@pecharotatetrue}
+\DeclareOption{fancyframe}{
+ \global\@fsingletrue\global\@ffancytrue
+ \global\def\@pageframe#1{\@fancyframe{#1}}
+}
+\DeclareOption{doubleframe}{\@fsinglefalse \global\@rulers=9.2pt \global\def\@pageframe#1{\@doubleframe{#1}}}
+\DeclareOption{simplefram}{\global\@rulers=1.6pt \global\def\@pageframe#1{\@fsingletrue \@singleframe{#1}}}
+
+% The pageheight can be adjusted a little bit
+\newlength\pecha@pheight
+\DeclareOption{narrowpage}{\setlength\pecha@pheight{26ex}}
+\DeclareOption{mediumpage}{\setlength\pecha@pheight{28ex}}
+\DeclareOption{widepage}{\setlength\pecha@pheight{33ex}}
+\DeclareOption{extrawide}{\setlength\pecha@pheight{36ex}}
+
+\newif\if@septitle
+\@septitlefalse
+\DeclareOption{septitle}{\global\@septitletrue}
+
+\ExecuteOptions{doubleframe,letterpaper,10pt,mediumpage}
+\ProcessOptions
+
+
+\renewcommand{\baselinestretch}{0.7}
+\ifnum\@ptsize < 3
+ \input{bk1\@ptsize.clo}
+ \setlength\lineskip{1\p@}
+ \setlength\normallineskip{1\p@}
+% \renewcommand\baselinestretch{}
+ \setlength\parskip{0\p@ \@plus \p@}
+\else
+ \input{size\@ptsize.clo}
+ \setlength\lineskip{\p@}
+ \setlength\normallineskip{\p@}
+% \renewcommand\baselinestretch{}
+ \setlength\parskip{\p@}
+\fi
+
+
+\ifx\pdftexversion\undefined
+ \special{papersize=\the\paperwidth,\the\paperheight}
+ \special{! /landplus90 true store}
+\else
+ \setlength\pdfpagewidth{\paperwidth}
+ \setlength\pdfpageheight{\paperheight}
+ \RequirePackage{times}
+\fi
+
+\setlength{\textheight}{\pecha@pheight}
+
+\newlength{\@marginht}
+\newlength{\@margindp}
+\newlength{\@marginsep}
+
+\newlength{\@pechadim}
+\newlength{\@titledim}
+\newlength{\@pechawidth}
+\newlength{\@@textwidth} % speichert Textbreit für fancy
+\newlength{\@titlewidth}
+\newlength{\pechamargin}
+\setlength{\pechamargin}{0.6in}
+
+\newcounter{pechasheet}
+\setcounter{pechasheet}{\@ne}
+\@marginht 3ex
+\@margindp 1ex
+
+\@pechadim 6em % Abstand zu den Rändern
+\advance\@pechadim by \@rulers % Summe der dicke aller vertikalen Linien
+\advance\@pechadim by 2\@marginht % Höhe der Randboxen
+\advance\@pechadim by 2\@margindp % Tiefe der Randboxen
+
+\textwidth\paperwidth
+\advance\textwidth by - 2\pechamargin % Abstand zu Papierrand, 0.6in beidseitig
+\@pechawidth\textwidth
+\@titledim 0.2\textwidth
+\advance\textwidth by - \@pechadim
+
+\@titlewidth\textwidth
+\advance\@titlewidth by - \@titledim
+
+\@@textwidth=\textwidth
+\if@ffancy
+ \advance\textwidth by - 12em % fancy Rahmen haben breite Ränder
+\fi
+
+\headheight 0pt
+\headsep 0pt
+\marginparsep 0pt
+\marginparwidth 0pt
+\footskip 0pt
+\marginparpush 0pt
+
+\topmargin \paperheight
+\advance\topmargin by - \textheight
+\advance\topmargin by -0.5 \topmargin
+\advance\topmargin by - 1.1in
+%\advance\topmargin by - 1.2in
+
+\oddsidemargin \paperwidth
+\advance \oddsidemargin by - \@pechawidth
+\advance \oddsidemargin by - 0.5 \oddsidemargin
+%\advance \oddsidemargin by - 1in
+\advance \oddsidemargin by - 1.5\pechamargin
+\evensidemargin \oddsidemargin
+
+\pagenumbering{arabic}
+\sloppy
+%\raggedright
+\parindent=0pt
+\parskip12pt
+
+% Some dimensons I will need
+
+\newbox\@pbox
+\newbox\@obox
+
+
+
+% Some usefull and simple macros
+\newcommand{\tibsmall}[1]{{\footnotesize \begin{tib} #1\end{tib}}}
+
+
+% Translate numerals from 1 to 99 into words
+% numeraly >=100 stay as is
+\def\tibnumeral#1{
+\ifnum #1<100
+ \ifcase #1
+ % 1-10
+ \or gcig \or gnyis \or gsum \or bzhi \or lnga
+ \or drug \or bdun \or b-rgyad \or dgu
+ \or bcu
+ % 11-20
+ \or {bcu gcig} \or {bcu gnyis} \or {bcu gsum} \or {bcu bzhi} \or {bco lnga}
+ \or {bcu drug} \or {bcu bdun} \or {bco b-rgyad} \or {bcu dgu} \or {nyi zhu}
+ % 21 - 30
+ \or {nyi zhu tsa gcig} \or {nyi zhu tsa gnyis} \or {nyi zhu tsa gsum}
+ \or {nyi zhu tsa bzhi} \or {nyi zhu tse lnga} \or {nyi zhu tsa drug}
+ \or {nyi zhu tsa bdun} \or {nyi zhu tsa b-rgyad} \or {nyi zhu tsa dgu}
+ \or {gsum bcu}
+ % 31 - 40
+ \or {gsum bcu so gcig} \or {gsum bcu so gnyis} \or {gsum bcu so gsum}
+ \or {gsum bcu so bzhi} \or {gsum bcu so lnga} \or {gsum bcu so drug}
+ \or {gsum bcu so bdun} \or {gsum bcu so b-rgyad} \or {gsum bcu so dgu}
+ \or {bzhi bcu}
+ % 41 - 50
+ \or {bzhi bcu zhe gcig} \or {bzhi bcu zhe gnyis} \or {bzhi bcu zhe gsum}
+ \or {bzhi bcu zhe bzhi} \or {bzhi bcu zhe lnga} \or {bzhi bcu zhe drug}
+ \or {bzhi bcu zhe bdun} \or {bzhi bcu zhe b-rgyad} \or {bzhi bcu zhe dgu}
+ \or {lnga bcu}
+ % 51 - 60
+ \or {lnga bcu nga gcig} \or {lnga bcu nga gnyis} \or {lnga bcu nga gsum}
+ \or {lnga bcu nga bzhi} \or {lnga bcu nge lnga} \or {lnga bcu nga drug}
+ \or {lnga bcu nga bdun} \or {lnga bcu nga b-rgyad} \or {lnga bcu nga dgu}
+ \or {drug bcu}
+ % 61 - 70
+ \or {drug bcu re gcig} \or {drug bcu re gnyis} \or {drug bcu re gsum}
+ \or {drug bcu re bzhi} \or {drug bcu re lnga} \or {drug bcu re drug}
+ \or {drug bcu re bdun} \or {drug bcu re b-rgyad} \or {drug bcu re dgu}
+ \or {bdun bcu}
+ % 71 - 80
+ \or {bdun bcu don gcig} \or {bdun bcu don gnyis} \or {bdun bcu don gsum}
+ \or {bdun bcu don bzhi} \or {bdun bcu don lnga} \or {bdun bcu don drug}
+ \or {bdun bcu don bdun} \or {bdun bcu don b-rgyad} \or {bdun bcu don dgu}
+ \or {b-rgyad bcu}
+ % 81 -90
+ \or {b-rgyad bcu rgya gcig} \or {b-rgyad bcu rgya gnyis}
+ \or {b-rgyad bcu rgya gsum}
+ \or {b-rgyad bcu rgya bzhi} \or {b-rgyad bcu rgya lnga}
+ \or {b-rgyad bcu rgya drug}
+ \or {b-rgyad bcu rgya bdun} \or {b-rgyad bcu rgya b-rgyad}
+ \or {b-rgyad bcu rgya dgu}
+ \or {dgu bcu}
+ % 91 - 99
+ \or {dgu bcu go gcig} \or {dgu bcu go gnyis} \or {dgu bcu go gsum}
+ \or {dgu bcu go bzhi} \or {dgu bcu go lnga} \or {dgu bcu go drug}
+ \or {dgu bcu go bdun} \or {dgu bcu go b-rgyad} \or {dgu bcu go dgu}
+ \fi
+\else
+ #1
+\fi
+}
+
+% Makros to create the right and left margin texts
+
+\def\@oleft{}
+\def\@@oleft{}
+\def\@eleft{}
+\def\@eright{}
+\def\@oright{}
+\def\@oddright{}
+\def\@evenright{}
+\def\@evenleft{}
+\def\@oddleft{}
+\def\@theleft{}
+\def\@theright{}
+
+\newcommand{\oddleft}[2]{\global\def\@oleft{#1}\global\def\@@oleft{#2}}
+\newcommand{\oddright}[1]{\global\def\@oright{#1}}
+\newcommand{\evenleft}[1]{\global\def\@eleft{#1}}
+\newcommand{\evenright}[1]{\global\def\@eright{#1}}
+
+
+% Print a title page (default: none)
+\newif\if@pechatitle
+\@pechatitlefalse
+
+
+% Title page (similar to book.cls)
+\def\title#1{\gdef\@title{#1}}
+\def\@title{\@latex@error{No \noexpand\title given}\@ehc}
+
+% vertical double line
+\def\@doubleruler{\vrule\kern1.5pt\vrule}
+
+
+% ignore standard chapter marks
+\newcommand{\paragraph}[1]{}
+\newcommand{\subparagraph}[1]{}
+\newcommand{\section}[1]{\medskip}
+\newcommand{\subsection}[1]{}
+\newcommand{\subsubsection}[1]{}
+\newcommand{\chapter}[1]{\bigskip}
+\newcommand{\part}[1]{\bigskip}
+
+\newcommand{\newsheet}{\clearpage\ifodd\c@page\else
+ \hbox{}\newpage\fi}
+
+% Titlepage environment
+\newenvironment{titlepage}{%
+ \newsheet
+ \setcounter{page}\@ne
+}%
+{%
+ \if@septitle
+ \newsheet
+ \setcounter{page}\@ne
+ \setcounter{pechasheet}{\@ne}
+ \else
+ \newpage
+ \fi
+}
+
+% Print a title page with the typical frame
+\newcommand{\maketitle}
+{
+ \global\@pechatitletrue
+ \setbox\@pbox\hbox{\parbox{\@titlewidth}{\begin{center}\@title\par\end{center}}}
+ % Beautify short titles
+ %\ifdim\ht\@pbox < 2.5ex \ht\@pbox=2.5ex \dp\@pbox=1.25ex\fi
+ % Calculate offsets to center the title page
+ \setlength\@tempdima{\textwidth}
+ \advance\@tempdima by - 12pt
+ \advance\@tempdima by - 10em
+ \advance\@tempdima by - \wd\@pbox
+ \advance\@tempdima by - 0.5\@tempdima
+ \ifdim\@tempdima < 0em \setlength\@tempdima{0em}\fi
+ \setlength\@tempdimb{\textheight}
+ \advance\@tempdimb - 4pt
+ \advance\@tempdimb - 5em
+ \advance\@tempdimb by - \ht\@pbox
+ \advance\@tempdimb by - \dp\@pbox
+ \advance\@tempdimb by - 0.5 \@tempdimb
+ \ifdim\@tempdimb < 0em \setlength\@tempdimb{0em}\fi
+ \begin{titlepage}
+ \hbox{
+ \kern\@tempdima
+ \vbox{%
+ \kern\@tempdimb
+ \hrule
+ \hbox{%
+ \vrule\kern1.5pt
+ \vbox{\kern1.5pt\hrule
+ \hbox{\vrule
+ \if@septitle
+ \kern2em
+ \else
+ \pecha@numtitle
+ \fi
+ \vbox{\kern2.5em\hrule
+ \hbox{\vrule\kern1.5pt
+ \vbox{\kern1.5pt\hrule
+ \hbox{\vrule\kern4em\@doubleruler\kern2em\@doubleruler
+ \kern1em\box\@pbox\kern1ex
+ \@doubleruler\kern2em\@doubleruler\kern4em\vrule
+ }
+ \hrule\kern1.5pt}\kern1.5pt\vrule
+ }\hrule\kern2.5em
+ }\kern2.5em\vrule
+ }\hrule\kern1.5pt
+ }\kern1.5pt\vrule
+ }\hrule\vfill
+ }\hfill
+ }
+ \end{titlepage}
+}
+
+% print sheet number on title page
+
+\def\pecha@numtitle{
+ \setlength{\@tempdimc}{\textheight}
+ \advance \@tempdimc by - 2\@tempdimb
+ \advance \@tempdimc by - 1em
+ \if@septitle
+ \else
+ \setbox\@obox\hbox{
+ \hbox to \@tempdimc{
+ \scriptsize\tib\@oleft~\hss\tib\tibnumeral{\thepechasheet}\hss\@@oleft
+ }}
+ \ht\@obox=\@marginht
+ \dp\@obox=\@margindp
+ \kern\dp\@obox
+ \begin{turn}{-90}
+ \kern-\@tempdimc\kern-0.8em\box\@obox
+ \end{turn}
+ \fi
+}
+
+\def\pecha@titlepage#1{
+ \box#1
+ \global\@pechatitlefalse
+}
+
+
+% The left "header" on odd pages
+\def\@oddleft{%
+ \setbox\@pbox\hbox{
+ \hbox to \textheight{
+ \scriptsize\tib\@oleft\hss\tib\tibnumeral{\thepechasheet}\hss\@@oleft
+ }}
+ \ht\@pbox=\@marginht
+ \dp\@pbox=\@margindp
+ \begin{turn}{-90}
+ \kern-\textheight\kern-1em\box\@pbox
+ \end{turn}
+}
+
+% the left "header" on even pages
+\def\@evenleft{%
+ \setbox\@pbox\hbox{
+ \hskip-\textheight\kern-1em\hbox to \textheight{
+ \scriptsize\tib\hss\@eleft\hss
+ }
+ }
+ \ht\@pbox=\@marginht
+ \dp\@pbox=\@margindp
+ \begin{turn}{-90}
+ \box\@pbox
+ \end{turn}
+}
+
+% The right "header" on odd pages
+\def\@oddright{%
+ \setbox\@pbox\hbox{
+ \hbox to \textheight{
+ \footnotesize\hss\kern1em\@oright\hss}}
+ \ht\@pbox=\@marginht
+ \dp\@pbox=\@margindp
+ \begin{turn}{90}
+ \box\@pbox
+ \end{turn}
+}
+
+% The right "header" on even pages
+\def\@evenright{%
+ \setbox\@pbox\hbox{
+ \hbox to \textheight
+ {\footnotesize\hss\kern1em\@eright\hss}}
+ \ht\@pbox=\@marginht
+ \dp\@pbox=\@margindp
+ \begin{turn}{90}
+ \box\@pbox
+ \end{turn}
+}
+
+% The left "header" on odd pages
+\def\@oddfancy{
+ \setbox\@pbox\hbox{
+ \hbox to \textheight{
+ \footnotesize\tib\@oleft\hss\tibnumeral{\thepechasheet}\hss\@@oleft
+ }}
+ \ht\@pbox=\@marginht
+ \dp\@pbox=\@margindp
+ \begin{turn}{-90}
+ \hskip-\textheight\kern-1em\box\@pbox
+ \end{turn}
+}
+
+% the left "header" on even pages
+\def\@evenfancy{
+ \setbox\@pbox\hbox{
+ \hskip-\textheight\kern-1em\hbox to \textheight{
+ \footnotesize\tib\hss\@eleft\hss\
+ }
+ }
+ \ht\@pbox=\@marginht
+ \dp\@pbox=\@margindp
+ \begin{turn}{-90}
+ \box\@pbox
+ \end{turn}
+
+}
+
+
+% section{Die Ausgabefunktionen}
+% Um die Pecha-typischen Textrahmen zu erzeugen, wurde die
+% LaTeX Ausgaberoutine umgeschrieben.
+% Kopf- und Fußzeilen machen bei Pechas keinen Sinn,
+% deshalb werden sie ausgelassen.
+% Dafür übernehmen die linken und rechten Ränder
+% eine ähnliche Funktion.
+%
+% Klassenoptionen:
+% Seiten können derzeit in drei unterschiedlichen
+% Stilen ausgegeben werden:
+% Mit folgenden Klassenoptionen kann die Ausgabe
+% beeinflußt werden:
+% doubleframe
+% Wird von dieser Klasse als Standardrahmen verwendet.
+% Der Textrahmen besteht aus einer Doppellinie.
+% singleframe
+% Entspricht eher dem originalen tibetischen Stil:
+% Der Text wird von einem einfachen Textrahmen umgeben.
+% fancyframe
+% Diese Option kann mit einer der vorangehenden Optionen
+% kombiniert werden. Sie bewirkt, daß die ersten drei
+% Seiten von einem besonderen Rahmen umgeben werden.
+% Die restlichen Seiten werden mit doppeltem oder
+% einfachen Rahmen ausgegeben.
+%
+% Die Seiten werden mit Hilfe des geometry-Pakets korrekt
+% auf die Mitte des Blattes positioniert.
+% Auch der linke Offset für die Buchbindung
+% muß wieder abgezogen werden, damit die Seiten
+% auf Vor- und Rückseite gleich positioniert werden.
+%
+% Das Paket "rotating" wird benutzt, um die
+% Randzeilen hochkant darzustellen.
+% Außerdem ermöglicht die Klassenoption "rotate" es,
+% jede gerade Seite um 180 Grad gedreht darzustellen,
+% was beim Ausdruck auf Duplexdruckern hilfreich sein kann.
+
+% |@doubleframe|
+% Dieses Makro erzeugt einen pechatypischen Doppelrahmen
+% um die Textbox in Argument #1
+\def\@doubleframe#1{
+ \hbox{\vrule %left outer line
+ \vbox{\hrule\kern1.5pt % top outer line
+ \hbox{\kern1.5pt\vrule % left inner line
+ \vbox{\hrule % top inner line
+ \hbox{
+ \vbox{
+ \hbox{
+ \@theleft % left box content
+ \@doubleruler\kern0.5em % left box inner margin
+ \vbox{
+ \kern1.5ex
+ \box#1
+ \kern1.5ex
+ }
+ %\kern0.5em
+ \@doubleruler % right box inner margin
+ \@theright}
+ } % right box content
+ }\hrule % right inner line
+ }\vrule\kern1.5pt % lower inner line
+ }\kern1.5pt\hrule % right outer line
+ }\vrule % lower outer line
+ }
+}
+
+% |@singleframe|
+% Dieses Makro erzeugt einen pechatypischen einfachen Rahmen
+% um die Textbox in Argument #1
+
+\def\@singleframe#1{
+ \hbox{\vrule
+ \vbox{\hrule
+ \hbox{
+ \vbox{
+ \hbox{
+ \@theleft
+ \vrule\kern0.5em
+ \vbox{
+ \kern1.5ex
+ \box#1
+ \kern1.5ex
+ }
+ %\kern0.5em
+ \vrule
+ \@theright}}
+ }\hrule
+ }\vrule
+ }
+}
+
+% |@fancyframe|
+% Dieses Makro erzeugt einen pechatypischen Rahmen
+% um die Textbox in Argument #1.
+% Hier wird auf den ersten ein besonderer Rahmen erstellt,
+% alle folgenden Seiten werden je nach Option (simple,fancy oder
+% standard,fancy) in einem einfachen oder einem doppelten Rahmen
+% ausgegeben.
+\def\@fancyframe#1{
+% \ifnum\thepage > 2
+% \global\@ffancyfalse
+% \if@fsingle
+% \global\def\@pageframe{\@singleframe#1}
+% \else
+% \global\def\@pageframe{\@doubleframe#1}
+% \fi
+% \global\addtolength\textwidth{-12em}
+% \global\addtolength\linewidth{-12em}
+% \fi
+ \hbox{\vrule
+ \vbox{\hrule\kern1.5pt
+ \hbox{\kern1.5pt\vrule
+ \vbox{\hrule\kern2em
+ \hbox{
+ \ifodd\c@page
+ \@oddfancy
+ \else
+ \@evenfancy
+ \fi
+ \vrule
+ \vbox{\hrule\kern1.5pt
+ \hbox{\kern1.5pt
+ \vrule
+ \vbox{
+ \hrule
+ \hbox{
+ \kern4em\@doubleruler\kern2em\@doubleruler\kern0.5em
+ \vbox{
+ %\kern0.5em
+ \box#1}
+ \@doubleruler\kern2em\@doubleruler\kern4em
+ }
+ \hrule
+ }\vrule\kern1.5pt
+ }\kern1.5pt\hrule
+ }\vrule\kern2em
+ }\kern2em\hrule
+ }\vrule\kern1.5pt
+ }\kern1.5pt\hrule
+ }\vrule
+ }
+}
+
+
+% |pecha@outputpage|
+% Das ist die neu geschriebene Ausgaberoutine
+% Derzeit kann sie folgendes:
+% Ausgabe einer Titelseite (muß beim Pecha von hier aus geschehen)
+% Ausgabe einer einfachen Textseite mit beliebigem Inhalt im
+% Pecha-Doppelrahmen
+% Ausgabe der linken Randzeilen im Pecha-Stil
+% Ausgabe von rechten Randzeilen, voreingestellt
+% auf die Seitennummer. Man kann geradseitige und
+% ungeradseitige rechte können mit den Makros
+% |\oddright| und |\evenright| unabhängig von einander
+% eingestellt werden.
+
+\def\@outputpage{\pecha@outputpage}
+
+\def\pecha@outputpage{%
+ \begingroup
+ \let\protect\noexpand
+ \set@typeset@protect % otherwise fonts cannot be changed here
+ \reset@font
+ \normalsize
+ \normalsfcodes
+ \@parboxrestore
+ % a hack for empty pages: These need to be framed properly
+ \ifodd\count\z@
+ \let\@themargin\oddsidemargin
+ \else
+ \let\@themargin\evensidemargin
+ \fi
+ \setbox\@outputbox\vbox{\hfil\box\@outputbox\hfil}
+ \if@pechatitle
+ \setbox\@outputbox\hbox{\pecha@titlepage{\@outputbox}}
+ \else
+ \ifodd\c@page
+ \let\@theleft\@oddleft
+ \let\@theright\@oddright
+ \setbox\@outputbox\hbox{\@pageframe{\@outputbox}}
+ \else
+ \let\@theleft\@evenleft
+ \let\@theright\@evenright
+ \if@pecharotate
+ \setbox\@outputbox\hbox{%
+ %\hskip3pt %I don't know why I do need this!
+ \begin{turn}{180}
+ \@pageframe{\@outputbox}
+ \end{turn}
+ }
+ \else
+ \setbox\@outputbox\hbox{\@pageframe{\@outputbox}}
+ \fi
+ \stepcounter{pechasheet}
+ \fi
+ \fi
+ \shipout\vbox{%
+ \let\label\@gobble
+ \let\index\@gobble
+ \let\glossary\@gobble
+ \baselineskip \footskip
+ \@begindvi
+ \vskip \topmargin
+ \moveright\@themargin
+ \box\@outputbox
+ }
+ \set@typeset@protect
+ \endgroup
+ \stepcounter{page}%
+}
+
+\endinput
+