home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / lyx21041.zip / XFree86 / lib / X11 / lyx / tex / alfa.sty next >
Text File  |  1999-11-17  |  11KB  |  288 lines

  1. %%         Alphanumeric Section Numbering
  2. %% Renamed to 'alfa.sty' to adapt as requested by LyX Team http://www.lyx.org
  3. %% for testing with LyX.
  4. %% 
  5. %% This file is derived from `alphanum.sty', but due to the adaption it is not
  6. %% compatible with it anymore.
  7. %% You are *not* allowed to modify this file without changing its name AND AUTHOR:
  8. %% This is a test release for testing with LyXfor testing with LyX. For evaluation only:
  9. %% 
  10. %%     Are you sure what you are doing? Harmful results are to be expected!
  11. %%     It may destroy data! Your own risk! No responsability at all!
  12. %% 
  13. %% Send bug reports and modifications to: 
  14. %%       Arnd.H.Hanses@rz.ruhr-uni-bochum.de
  15. %% so that they can be included in an eventual public release.
  16. %% Based on original idea in jura.cls by Felix Braun. 
  17. %%
  18. \NeedsTeXFormat{LaTeX2e}[1995/12/01]
  19. \ProvidesPackage{alfa}[1999/09/24 v00.3betanoresonsabilityatall]
  20. \newcommand*{\J@FootnoteSpread}{1}
  21. \DeclareOption{tightfn}{\renewcommand*{\J@FootnoteSpread}{1}}
  22. \DeclareOption{spacedfn}{\renewcommand*{\J@FootnoteSpread}{1.3}}
  23. \AtEndOfClass{\setlength{\footnotesep}{\J@FootnoteSpread\footnotesep}}
  24. \ExecuteOptions{tightfn}
  25. \ProcessOptions\relax
  26.  
  27. %% \LoadClass{scrxxx}    % use Koma script base classes, only tested base
  28.  
  29.  
  30. \newcommand*{\@greek}[1]{\ifcase#1\relax\or$\alpha$\or$\beta$\or
  31. $\gamma$\or$\delta$\or$\varepsilon$\or$\zeta$\or$\eta$\or$\vartheta$\or
  32. $\iota$\or$\kappa$\or$\lambda$\or$\mu$\or$\nu$\or$\xi$\or$o$\or$\pi$\or
  33. $\rho$\or$\sigma$\or$\tau$\or$\upsilon$\or$\varphi$\or$\chi$\or$\psi$\or
  34. $\omega$\else\@ctrerr\fi}
  35. \newcounter{lvla}
  36. \newcounter{lvlb}
  37. \newcounter{lvlc}
  38. \newcounter{lvld}
  39. \newcounter{lvle}
  40. \newcounter{lvlf}
  41. \newcounter{lvlg}
  42. \newcounter{lvlh}
  43. \newcounter{lvli}
  44. \newcounter{lvlj}
  45. \newcounter{lvlk}
  46. \newcounter{lvll}
  47. \renewcommand*{\thelvla}{\J@Number}
  48. \renewcommand*{\thelvlb}{\J@Number}
  49. \renewcommand*{\thelvlc}{\J@Number}
  50. \renewcommand*{\thelvld}{\J@Number}
  51. \renewcommand*{\thelvle}{\J@Number}
  52. \renewcommand*{\thelvlf}{\J@Number}
  53. \renewcommand*{\thelvlg}{\J@Number}
  54. \renewcommand*{\thelvlh}{\J@Number}
  55. \renewcommand*{\thelvli}{\J@Number}
  56. \renewcommand*{\thelvlj}{\J@Number}
  57. \renewcommand*{\thelvlk}{\J@Number}
  58. \renewcommand*{\thelvll}{\J@Number}
  59. \if@twoside
  60. \newcommand*{\lvlamark}[1]{\J@SetCurrent%
  61. \@mkboth{\J@NumberRoot1\J@NumberEnd1\ #1}%
  62. {\J@NumberRoot1\J@NumberEnd1\ #1}}
  63. \newcommand*{\lvlbmark}[1]{\J@SetCurrent%
  64. \@mkboth{\J@NumberRoot1\,\J@NumberRoot2\J@NumberEnd2\ #1}%
  65. {\J@NumberRoot1\,\J@NumberRoot2\J@NumberEnd2\ #1}}
  66. \newcommand*{\lvlcmark}[1]{\J@SetCurrent\markright{\J@Number\ #1}}
  67. \else
  68. \newcommand*{\lvlamark}[1]{\J@SetCurrent%
  69. \markright{\J@NumberRoot1\J@NumberEnd1\ #1}}
  70. \newcommand*{\lvlbmark}[1]{\J@SetCurrent%
  71. \markright{\J@NumberRoot1\,\J@NumberRoot2\J@NumberEnd2\ #1}}
  72. \newcommand*{\lvlcmark}[1]{\J@SetCurrent%
  73. \markright{\J@NumberRoot1\,\J@NumberRoot2\,\J@Number\ #1}}
  74. \fi
  75. \newcommand*{\lvldmark}{\J@SetCurrent\@gobble}
  76. \newcommand*{\lvlemark}{\lvldmark}
  77. \newcommand*{\lvlfmark}{\lvldmark}
  78. \newcommand*{\lvlgmark}{\lvldmark}
  79. \newcommand*{\lvlhmark}{\lvldmark}
  80. \newcommand*{\lvlimark}{\lvldmark}
  81. \newcommand*{\lvljmark}{\lvldmark}
  82. \newcommand*{\lvlkmark}{\lvldmark}
  83. \newcommand*{\lvllmark}{\lvldmark}
  84. \newcounter{tiefe}\setcounter{tiefe}{1}
  85. \setcounter{tocdepth}{12}\setcounter{secnumdepth}{12}
  86. \newcommand*{\J@Number}{\J@NumberRoot{\value{tiefe}}%
  87. \J@NumberEnd{\value{tiefe}}}
  88. \newcommand*{\J@NumberRoot}[1]{\J@INumberRoot{#1}%
  89. {\csname c@lvl\@alph{#1}\endcsname}}
  90. \newcommand*{\J@INumberRoot}[2]{%
  91. \ifcase#1\or
  92. \@Alph{#2}\or
  93. \@Roman{#2}\or
  94. \@arabic{#2}\or
  95. \@alph{#2}\or
  96. \@alph{#2}\@alph{#2}\or
  97. \@greek{#2}\or
  98. \@greek{#2}\@greek{#2}\or
  99. (\@arabic{#2})\or
  100. (\@alph{#2})\or
  101. (\@alph{#2}\@alph{#2})\or
  102. (\@greek{#2})\or
  103. (\@greek{#2}\@greek{#2})\fi}
  104. \newcommand*{\J@NumberEnd}[1]{\ifnum#1<8\ifnum#1<4.\else)\fi\fi}
  105. \newcommand*\l@lvla{\@dottedtocline{1}{0em}{2,5em}}
  106. \newcommand*\l@lvlb{\@dottedtocline{2}{1em}{2,5em}}
  107. \newcommand*\l@lvlc{\@dottedtocline{3}{2em}{2,5em}}
  108. \newcommand*\l@lvld{\@dottedtocline{4}{3em}{2,5em}}
  109. \newcommand*\l@lvle{\@dottedtocline{5}{4em}{2,5em}}
  110. \newcommand*\l@lvlf{\@dottedtocline{6}{5em}{2,5em}}
  111. \newcommand*\l@lvlg{\@dottedtocline{7}{6em}{2,5em}}
  112. \newcommand*\l@lvlh{\@dottedtocline{8}{7em}{2,5em}}
  113. \newcommand*\l@lvli{\@dottedtocline{9}{8em}{2,5em}}
  114. \newcommand*\l@lvlj{\@dottedtocline{10}{9em}{2,5em}}
  115. \newcommand*\l@lvlk{\@dottedtocline{11}{10em}{2,5em}}
  116. \newcommand*\l@lvll{\@dottedtocline{12}{11em}{2,5em}}
  117. \newcommand*{\J@SetCurrent}{\xdef\@currentlabel{{\arabic{lvla}}%
  118. {\arabic{lvlb}}{\arabic{lvlc}}{\arabic{lvld}}{\arabic{lvle}}%
  119. {\arabic{lvlf}}{\arabic{lvlg}}{\arabic{lvlh}}{\arabic{lvli}}%
  120. {\arabic{lvlj}}{\arabic{lvlk}}{\arabic{lvll}}}}
  121. \newcommand*{\toc}{\secdef\J@LongToc\J@ShortToc}
  122. \newcommand*{\J@ShortToc}[1]{\stepcounter{lvl\alph{tiefe}}\J@Number\ %
  123. \addcontentsline{toc}{lvl\alph{tiefe}}%
  124. {\protect\numberline{\J@Number}#1}%
  125. \csname lvl\alph{tiefe}mark\endcsname{#1}\@gobblecr}
  126. \newcommand*{\J@LongToc}[2][]{%
  127. \@startsection{lvl\alph{tiefe}}{\value{tiefe}}{0pt}
  128. {\ifnum\value{tiefe}=1 -4ex plus-1,5ex minus-0,ex\else
  129. -2,7ex plus-0,8ex minus-0,2ex\fi}
  130. {\ifnum\value{tiefe}>7 -1em plus-0,5em\relax\else
  131. 0,6ex plus0,3ex minus0,1ex\fi}
  132. {\normalfont%
  133. \ifnum\value{tiefe}=1\large\else\normalsize\fi
  134. \ifnum\value{tiefe}>7\itshape\else\bfseries\fi}[#1]{#2}}
  135. \renewcommand*{\@seccntformat}[1]{\csname the#1\endcsname\ }
  136. \renewcommand*{\numberline}[1]{#1\ }
  137. \newcommand*{\leveldown}{%
  138. \ifnum\value{lvla}=0%
  139. \PackageWarning{alfa}{\protect\sub\space without
  140. \protect\toc\space}\fi
  141. \ifnum\value{tiefe}=12%
  142. \PackageWarning{alfa}{too many sublevels!! Ignored \protect\sub.
  143. \MessageBreak There will probably be an \protect\levelup\space
  144. without \protect\sub\space warning later on}
  145. \setcounter{tiefe}{11}\fi
  146. \stepcounter{tiefe}}
  147. \newcommand*{\sub}{\leveldown\toc}
  148. \newcommand*{\levelup}{%
  149. \ifnum\value{tiefe}=1%
  150. \PackageWarning{alfa}{\protect\levelup\space without\protect\sub}
  151. \stepcounter{tiefe}\fi
  152. \ifnum\value{lvl\alph{tiefe}}=1%
  153. \PackageWarning{alfa}{only one subitem in level "\J@Number" ending}%
  154. \fi
  155. \setcounter{lvl\alph{tiefe}}{0}
  156. \addtocounter{tiefe}{-1}\par\addvspace{2,7ex plus0,8ex minus1ex}}
  157. \renewcommand*{\@cite}[2][]{#1#2}
  158. \def\@citex[#1]#2{%
  159.   \let\@citea\@empty
  160.   \@cite{\@for\@citeb:=#2\do
  161.     {\@citea\def\@citea{,\penalty\@m\ }%
  162.      \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
  163.      \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
  164.      \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
  165.        \G@refundefinedtrue
  166.        \@latex@warning
  167.          {Citation `\@citeb' on page \thepage \space undefined}}%
  168.          {\csname b@\@citeb\endcsname}}}{#1}}
  169. \renewcommand*{\ref}{%
  170. \@ifstar{\@tempswatrue\J@ref}{\@tempswafalse\J@ref}}
  171. \newcommand*{\J@ref}[1]{%
  172. \expandafter\ifx\csname r@#1\endcsname\relax
  173.  \protect\G@refundefinedtrue
  174.  \nfss@text{\reset@font\bfseries ??}
  175.  \@latex@warning{Reference '#1' on page \thepage \space undefined}%
  176. \else
  177.  \expandafter\J@refX\csname r@#1\endcsname
  178. \fi}
  179. \newcommand*{\J@refX}[1]{\expandafter\J@refXX#1}
  180. \newcommand*{\J@refXX}[2]{%
  181. \ifcat#10
  182.   #1%
  183. \else
  184.   \expandafter\J@refA#1%
  185. \fi}
  186. \newcommand*{\J@refA}[6]{\@tempcnta\@ne%
  187. \J@refP1{#1}0\J@refP2{#2}{#1}\J@refP3{#3}{#2}\J@refP4{#4}{#3}%
  188. \J@refP5{#5}{#4}\J@refP6{#6}{#5}\J@refB#6}
  189. \newcommand*{\J@refB}[7]{\J@refP7{#2}{#1}\J@refP8{#3}{#2}%
  190. \J@refP9{#4}{#3}\J@refP{10}{#5}{#4}\J@refP{11}{#6}{#5}%
  191. \J@refP{12}{#7}{#6}\J@NumberEnd\@tempcnta}
  192. \newcommand*{\J@refP}[3]{%
  193. \if@tempswa%
  194.  \ifnum#2>0\@tempcnta#1\,\J@INumberRoot{#1}{#2}\fi
  195. \else%
  196.  \ifnum#2=\value{lvl\@alph{#1}}%
  197.   \ifnum#1=12\PackageError{alfa}{Self-reference detected!}{You used
  198.     a \protect\ref\space in the same section as the referenced
  199.     \protect\label\MessageBreak That makes no sense!}\fi
  200.  \else
  201.   \ifnum#2>0\@tempcnta#1\@tempswatrue\J@INumberRoot{#1}{#2}\else
  202.    \ifnum#3>0%
  203.    \@tempcnta#1\advance\@tempcnta-1\relax\J@INumberRoot{\@tempcnta}{#3}%
  204.    \fi
  205.   \fi
  206.  \fi
  207. \fi}
  208.  
  209.  
  210. %% Better interface (hints by Jean-Marc Lagouttes and Amir Karger)
  211.  
  212. \newcommand\frontmatter{\newpage\pagenumbering{roman}}
  213. \newcommand\mainmatter{\newpage\pagenumbering{arabic}}
  214. %% \newcommand\endmatter{\newpage\appendix}
  215.  
  216. \newcommand\up{\levelup\toc}
  217. \newcommand\uptwo{\levelup\levelup\toc}
  218. \newcommand\upthree{\levelup\levelup\levelup\toc}
  219. \newcommand\upfour{\levelup\levelup\levelup\levelup\toc}
  220. \newcommand\upfive{\levelup\levelup\levelup\levelup\levelup\toc}
  221. \newcommand\upsix{\levelup\levelup\levelup\levelup\levelup\levelup\toc}
  222. \newcommand\upseven{\levelup\levelup\levelup\levelup\levelup\levelup\levelup\toc}
  223. \newcommand\upeight{\levelup\levelup\levelup\levelup\levelup\levelup\levelup\levelup\toc}
  224. \newcommand\upnine{\levelup\levelup\levelup\levelup\levelup\levelup\levelup\levelup\levelup\toc}
  225. \newcommand\upten{\levelup\levelup\levelup\levelup\levelup\levelup\levelup\levelup\levelup\levelup\toc}
  226. \newcommand\upeleven{\levelup\levelup\levelup\levelup\levelup\levelup\levelup\levelup\levelup\levelup\levelup\toc}
  227.  
  228. \newenvironment{keywords}{%
  229.     \if@twocolumn
  230.       \section*{\keywordname}%
  231.     \else
  232.       \small
  233.       \begin{center}%
  234.         {\bfseries \keywordname\vspace{-.5em}\vspace{\z@}}%
  235.       \end{center}%
  236.       \quotation
  237.     \fi}
  238.     {\if@twocolumn\else\endquotation\fi}
  239. \newcommand\keywordname{Stichworte}     % --> translate Stichworte - keywords
  240.  
  241. \reversemarginpar
  242. %% \long\def\@footnotetext#1{\insert\footins{%
  243. %%     \linespread{\J@FootnoteSpread}\reset@font\footnotesize
  244. %%     \interlinepenalty\interfootnotelinepenalty
  245. %%     \splittopskip\footnotesep
  246. %%     \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
  247. %%     \hsize\columnwidth \@parboxrestore
  248. %%     \protected@edef\@currentlabel{%
  249. %%        \csname p@footnote\endcsname\@thefnmark
  250. %%     }%
  251. %%     \color@begingroup
  252. %%       \@makefntext{%
  253. %%         \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
  254. %%     \color@endgroup}}%
  255. %%  \let\footnotesize\small\let\footnoterule\relax\let\footnote\thanks
  256. %% \setcounter{footnote}{0}\global\let\thanks\relax
  257.  
  258. \newcommand{\CapListEntry}[1]{\def\@CapListEntryFlag{1}\def\@CapListEntryText{#1}}
  259. \def\@CapListEntryFlag{0}
  260. \def\caption#1{\refstepcounter\@captype%
  261.   \ifodd\@CapListEntryFlag%
  262.   \@dblarg{\@caption\@captype}[\@CapListEntryText]{#1}%
  263.   \def\@CapListEntryFlag{0}%
  264.   \else%
  265.   \@dblarg{\@caption\@captype}{#1}%
  266.   \fi}
  267.  
  268. %- clip all graphics (idea: Fred Hucht)
  269. \def\includegraphics{\Gin@cliptrue\Gin@i}
  270. %------------------------------
  271. \newenvironment*{jurabibliography}
  272. {\addchap{\bibname
  273.  \@mkboth{\bibname}{\bibname}}%
  274.  \begin{description}\sloppy}{\end{description}}
  275. \def\jbibitem#1#2#3{\item[#1]\if@filesw
  276.  {\let\protect\noexpand\immediate
  277.  \write\@auxout{\string\bibcite{#3}{#2}}}\fi\ignorespaces}
  278.  
  279. \newenvironment{sachverhalt}
  280. {\addchap{Sachverhalt}%
  281. \@mkboth{Sachverhalt}{Sachverhalt}}{\clearpage}
  282.  
  283. \endinput
  284. %%
  285. %%
  286. %% End of file `alfa.cls'.
  287.  
  288.