Browse Source

MRTutil added; defsfaccmacro added

master
Jonathan Spratte 1 year ago
parent
commit
6e8a56c181

BIN
Doc/doc_MRTbundle.pdf View File


+ 1
- 0
Doc/doc_MRTbundle.tex View File

@@ -52,5 +52,6 @@
52 52
 \include{tex/doc_MRTif}
53 53
 \include{tex/doc_MRTwuline}
54 54
 \include{tex/doc_MRTsfacc}
55
+\include{tex/doc_MRTutil}
55 56
 
56 57
 \end{document}

+ 3
- 2
Doc/preamble/doc_macros.tex View File

@@ -10,9 +10,9 @@
10 10
 \newcommand*\cs{\texorpdfstring{\cs@TeXString}{\cs@PDFString}}
11 11
 \protected\def\cs@TeXString#1%>>>
12 12
   {%
13
-    \texttt{\expandafter\eatspace\string\ \detokenize{#1}}%
13
+    \texttt{\cs@PDFString{#1}}%
14 14
   }%<<<
15
-\def\cs@PDFString#1{(macro #1)}
15
+\edef\cs@PDFString#1{\expandafter\eatspace\string\ \noexpand\detokenize{#1}}
16 16
 \protected\def\meta#1{\texttt{$\langle${\itshape\meta@a{#1}}\kern.05em$\rangle$}}
17 17
 \ExplSyntaxOn
18 18
 \newcommand\meta@a[1]%>>>
@@ -404,6 +404,7 @@
404 404
       \versionline{if}
405 405
       \versionline{wuline}
406 406
       \versionline{sfacc}
407
+      \versionline{util}
407 408
     \end{MRTtable}
408 409
   }%<<<
409 410
 \NewDocumentCommand \bverb { v }%>>>

+ 2
- 1
Doc/tex/doc_MRTbeam.tex View File

@@ -348,7 +348,7 @@ The term footnotes relates to the special MRT footnotes in this subsection.
348 348
 
349 349
 \begin{describemacro}{bibliographyframe}%
350 350
   [\meta{*}\oarg{bibfont}\marg{title}\marg{subtitle}]
351
-  Prints the bibliography. The starred variants uses \cs{whiteframestrue}. The
351
+  Prints the bibliography. The starred variant uses \cs{whiteframestrue}. The
352 352
   \meta{bibfont} defaults to \cs{small}, you might give any font related
353 353
   commands here. Both \meta{title} and \meta{subtitle} are optional though
354 354
   delimited by curly braces. \meta{title} defaults to \enquote{Quellen},
@@ -379,6 +379,7 @@ are loaded:
379 379
   \begin{itemize}
380 380
     \item \pkg{helvet}
381 381
     \item \pkg{MRTsfacc}
382
+    \item \pkg{MRTutil}
382 383
     \item \pkg{xparse}
383 384
     \item \TikZ
384 385
     \item \pkg{biblatex} (with URLs being line breakable at any place)

+ 1
- 0
Doc/tex/doc_MRTif.tex View File

@@ -172,3 +172,4 @@ sequence errors containing \texttt{MRTif} in the control sequence's name.
172 172
 \section{Dependencies}
173 173
 \pkg{MRTif} loads the \pkg{pdftexcmds} package to make the \hologo{pdfTeX}
174 174
 primitive \cs{pdfstrcmp} available as \cs{pdf@strcmp} for \hologo{LuaTeX}.
175
+Additionally it uses \pkg{MRTutil}.

+ 82
- 0
Doc/tex/doc_MRTsfacc.tex View File

@@ -156,7 +156,89 @@ recognized.
156 156
     \\
157 157
 \end{MRTtable}%<<<
158 158
 
159
+\section{Additional macros}
160
+The package provides macros to use the accents used in text mode additionally in
161
+maths. Since the placement proves somewhat difficult -- this might be caused by
162
+the bundle's author's insufficient knowledge -- there is no really automated way
163
+to do so with a few macros. Instead you can define macros which will produce a
164
+symbol which is accented by one of the text accents.
165
+
166
+\begin{describemacro}%>>>
167
+  {%
168
+    newsfhatmacro,defsfhatmacro,%
169
+    newsfcheckmacro,defsfcheckmacro,%
170
+    newsftildemacro,defsftildemacro,%
171
+    newsfacutemacro,defsfacutemacro,%
172
+    newsfgravemacro,defsfgravemacro,%
173
+    newsfdotmacro,defsfdotmacro,%
174
+    newsfddotmacro,defsfddotmacro,%
175
+    newsfbrevemacro,defsfbrevemacro,%
176
+    newsfbarmacro,defsfbarmacro%
177
+  }%
178
+  [%
179
+    \sarg{horizontal}\oarg{vertical}\marg{cs}\oarg{type}\hspace{0pt}%
180
+    \marg{symbol}%
181
+  ]
182
+  The difference between the \cs{def...} and the \cs{new...} variant is that
183
+  the former will not check whether the macro \meta{cs} is already defined or
184
+  not. With these macros you can locally create a \meta{cs} that gets displayed
185
+  as \meta{symbol} with an accent based on the text font's variant of the
186
+  accents.  \texttt{hat} uses \cs{^}, \texttt{check} uses \cs{v}, \texttt{tilde}
187
+  uses \cs{~}, \texttt{acute} uses \cs{'}, \texttt{grave} uses \cs{`},
188
+  \texttt{dot} uses \cs{.}, \texttt{ddot} uses \cs{"}, \texttt{breve} uses
189
+  \cs{u} and \texttt{bar} uses \cs{=}.\\
190
+  You can control the horizontal positioning of the accent using
191
+  \meta{horizontal}, which should be a length in |mu|. If you don't provide
192
+  \meta{horizontal} the offset will be determined based on the rules of the used
193
+  variant (see \autoref{sec:sfacc:height} and \autoref{sec:sfacc:list}).
194
+  \meta{vertical} specifies the vertical shift of the accent and should be given
195
+  in |ex|. If \meta{vertical} is not given nothing special will happen (this
196
+  might change in the future -- for now it is best if you specify |0ex| if you
197
+  don't want to change the accents vertical placement).\\
198
+  \meta{type} is the math atom type to be used for the newly created \meta{cs}.
199
+  You could use \cs{mathord}, \cs{mathop}, \cs{mathbin}, \cs{mathrel},
200
+  \cs{mathopen}, \cs{mathclose}, \cs{mathpunct}, \cs{mathinner}, or any other
201
+  macro taking one argument.
202
+\end{describemacro}%<<<
203
+
204
+\begin{describemacro}{newsfaccmacro,defsfaccmacro}%>>>
205
+  [%
206
+    \sarg{horizontal}\oarg{vertical}\marg{cs}\oarg{type}\hspace{0pt}%
207
+    \marg{accent}\marg{symbol}%
208
+  ]
209
+  This is a more general variant of \cs{newsfhatmacro} and the like. With this
210
+  macro you can specify the macro responsible for typesetting the accent using
211
+  the \meta{accent} argument. The specified \meta{accent} should take at most
212
+  one argument and this one will be empty.
213
+\end{describemacro}%<<<
214
+
215
+The results of these macros heavily depend on the used font. For
216
+\cls{MRTthesis}, using \hologo{pdfLaTeX}, the results don't look too bad. For
217
+example one can define a \cs{hateq}:
218
+
219
+\begingroup
220
+\defsfhatmacro[-.3ex]\hateq[\mathrel]=
221
+\begin{verbatim}
222
+\defsfhatmacro[-0.3ex]{\hateq}[\mathrel]{=}
223
+\end{verbatim}%
224
+We use \cs{mathrel} since a |=| is a relation and should be spaced like that.
225
+Additionally we move the accent down by |0.3ex|, which should give a good result
226
+in this case. The following formula uses this \cs{hateq} definition,
227
+|\mathrel{\hat{=}}| and the default |=| for comparison:
228
+\begin{equation*}
229
+  a\hateq a \mathrel{\hat{=}} a = a
230
+\end{equation*}
231
+\endgroup
232
+
233
+Unfortunately these accents don't look good in combination with Greek letters
234
+(see for yourself: $\hat{\alpha}$ vs.
235
+\begingroup\defsfhatmacro[-.1ex]\hatalpha\alpha$\hatalpha$\endgroup), and one
236
+shouldn't mix the two types of accents in a document. The decision which
237
+approach you use is up to you.
238
+
159 239
 \section{Dependencies}
160 240
 \pkg{MRTsfacc} loads the \pkg{MRTif} package and uses its tests
161 241
 \cs{MRTifLetterGTF}, \cs{MRTifFloatTF}, \cs{MRTifStringsMatchXXTF} and
162 242
 \cs{MRTifTwoTokenTF}. It also depends on \pkg{amsmath} being loaded.
243
+Additionally it uses the \pkg{MRTutil} package for some of its macros'
244
+definitions.

+ 7
- 5
Doc/tex/doc_MRTthesis.tex View File

@@ -368,7 +368,7 @@ The following macros are provided:
368 368
 \end{describemacro}
369 369
 \begin{describemacro}{MRTafterhyperref}[\marg{content}]
370 370
   Places \meta{content} after \pkg{hyperref} is loaded. This is important for
371
-  the relative few packages that need to be loaded after \pkg{hyperref}. So if
371
+  the relatively few packages that need to be loaded after \pkg{hyperref}. So if
372 372
   you have one of these, you should use something like
373 373
   \bverb|\MRTafterhyperref{\usepackage{cleveref}}|. This macro has to be used
374 374
   prior to \bverb|\begin{document}|.
@@ -436,10 +436,11 @@ The following macros are provided:
436 436
   head marks, e.\,g.\@ if your section title gets too long.
437 437
 \end{describemacro}
438 438
 \begin{describemacro}{affidavit}
439
-  Prints a chapter ``Eidesstattliche Erklärung'' and the affidavit text (as
440
-  stored in \cs{affidavit@text}) and the location and date, followed by a
441
-  signature line for each author. \cs{maketitle} has to be used prior to it,
442
-  else the lines won't be printed. This is a bug I might fix in the future.
439
+  Prints a chapter ``Eidesstattliche Erklärung'' (stored in \cs{affidavittitle},
440
+  you might redefine it to change the title) and the affidavit text (as stored
441
+  in \cs{affidavittext}) and the location and date, followed by a signature line
442
+  for each author. \cs{maketitle} has to be used prior to it, else the lines
443
+  won't be printed. This is a bug I might fix in the future.
443 444
 \end{describemacro}
444 445
 \begin{describemacro}{mainpart,mainmatter}
445 446
   Switches the formatting from the one at the beginning to the one used in the
@@ -475,6 +476,7 @@ formatting.%
475 476
     \item \pkg{expl3}
476 477
     \item \pkg{xparse}
477 478
     \item \pkg{MRTif}
479
+    \item \pkg{MRTutil}
478 480
     \item \pkg{MRTsfacc}
479 481
     \item \pkg{MRTtab}
480 482
     \item \pkg{MRTwuline}

+ 67
- 0
Doc/tex/doc_MRTutil.tex View File

@@ -0,0 +1,67 @@
1
+\chapter{The \pkg{MRTutil} package}\label{sec:util}
2
+This package provides some utility functions. Those are meant to aid people
3
+defining their own macros and are used throughout other packages of this bundle.
4
+Every macro this package provides is at the code level so there are no real user
5
+facing macros. As a general rule of thumb the user level is therefore moved one
6
+layer down, user facing macros have a single \texttt{@} in their names, while
7
+internal macros have at least two.
8
+
9
+\section{Defining Macros}
10
+Since the author of this bundle often finds the possibilities of the \LaTeX2e
11
+macro family of \cs{newcommand} too restricting, the package provides some
12
+macros which use the syntax of \TeX's \cs{def} but still check whether the macro
13
+is already defined.
14
+
15
+\begin{describemacro}{MRTutil@def,MRTutil@edef}%
16
+  [\oarg{prefixes}\meta{cs}\meta{args}\marg{definition}]
17
+  Those are versions of \cs{def} and \cs{edef}. You can define \meta{prefixes}
18
+  like \cs{long} or \cs{protected}. \meta{cs} is the new control sequence's
19
+  name, \meta{args} is the argument specification and \meta{definition} is the
20
+  replacement text of the macro. Both check whether the macro is already defined
21
+  and will raise an error if they are. They are like a fusion of \cs{newcommand}
22
+  and \cs{def} in that they only define a new command but keep the versatility
23
+  of \cs{def}.
24
+\end{describemacro}
25
+
26
+\section{Optional Argument Parsing}
27
+Since the author really likes what \pkg{xparse} allows in defining macros with
28
+many optional arguments but doesn't want to force the complete \pkg{expl3} onto
29
+the user (since it's huge), if a user is only interested in one or two of the
30
+small packages of this bundle there are some macros in those packages which have
31
+multiple optional arguments. To define those the following macros were created
32
+to provide a very limited subset of \pkg{xparse}'s functionality. Note that none
33
+of the provided macros allow expandable definitions.
34
+
35
+\begin{describemacro}{MRTutil@Oarg}[\marg{default}\marg{continue}]
36
+  checks for a following optional argument in \texttt{[]}. If there is none it
37
+  provides the \meta{default}. \meta{continue} will be executed after the
38
+  argument has been parsed. The value of the optional argument will be provided
39
+  to \meta{continue} in braces (\texttt{\{\}}).
40
+\end{describemacro}
41
+
42
+\begin{describemacro}{MRTutil@oarg}[\marg{continue}]
43
+  Like \cs{MRTutil@Oarg}, but provides a special marker if there is no optional
44
+  argument. You can check whether the special marker was provided with
45
+  \cs{MRTutil@ifmark}.
46
+\end{describemacro}
47
+
48
+\begin{describemacro}{MRTutil@Darg}%
49
+  [\meta{token1}\meta{token2}\marg{default}\marg{continue}]
50
+  Like \cs{MRTutil@Oarg}, but the optional argument should be delimited by
51
+  \meta{token1} and \meta{token2}. So \bverb|\MRTutil@Darg<>{}\foo| will check
52
+  whether there is an optional argument delimited by \texttt{<>} and if there is
53
+  none will use an empty one. The result is provided to \cs{foo}.
54
+\end{describemacro}
55
+
56
+\begin{describemacro}{MRTutil@darg}%
57
+  [\meta{token1}\meta{token2}\marg{continue}]
58
+  Like \cs{MRTutil@darg}, but provides a special marker if there is no optional
59
+  argument. You can check whether the special marker was provided with
60
+  \cs{MRTutil@ifmark}. 
61
+\end{describemacro}
62
+
63
+\begin{describemacro}{MRTutil@ifmark}[\marg{test}\marg{true}\marg{false}]
64
+  Tests whether \marg{test} is the special mark provided by \cs{MRTutil@oarg}
65
+  and \cs{MRTutil@darg} and if so expands to \meta{true}. If not it expands to
66
+  \meta{false}.
67
+\end{describemacro}

+ 1
- 0
Doc/tex/doc_MRTwuline.tex View File

@@ -46,6 +46,7 @@ so by using \pkg{ulem} or \pkg{stackengine}.
46 46
     \item \pkg{stackengine}
47 47
     \item \pkg{scalerel}
48 48
     \item \pkg{MRTif}
49
+    \item \pkg{MRTutil}
49 50
     \item \pkg{ulem} with the \opt{normalem} option
50 51
     \item if the \opt{tUline} option is used:
51 52
       \begin{itemize}

+ 7
- 1
Example_Documents/MRTbeam/example_MRTbeam.tex View File

@@ -5,10 +5,13 @@
5 5
 \occasion{Example}
6 6
 \author[A. Student]{Armer Student}
7 7
 
8
-% The default settings might look ugly
8
+%% The default settings might look ugly; see documentation how to change it
9 9
 \ProgressBartrue
10 10
 \PrependSubsectionstrue
11 11
 
12
+%% add references.bib as resource for biblatex citations
13
+%\addbibresource{references.bib}
14
+
12 15
 \begin{document}
13 16
 \begingroup
14 17
 \OnlyOneTopRuletrue
@@ -34,5 +37,8 @@
34 37
   \end{frame}%<<<
35 38
 \end{whiteframes}
36 39
 
40
+%% Put bibliography here
41
+% \bibliographyframe
42
+
37 43
 
38 44
 \end{document}

+ 6
- 3
Example_Documents/MRTthesis/example_MRTthesis.tex View File

@@ -16,6 +16,9 @@
16 16
     ,sauthor=\textcolor{blue}{A. Student}
17 17
   }
18 18
 
19
+%% add references.bib as resource for biblatex citations
20
+%\addbibresource{references.bib}
21
+
19 22
 \begin{document}
20 23
 \maketitle
21 24
 \affidavit
@@ -32,11 +35,11 @@
32 35
 \include{tex/zusammenfassung}
33 36
 
34 37
 \appendix
35
-% this example doesn't use a bibliography
38
+%% this example doesn't use a bibliography
36 39
 %\printbibliography
37 40
 \clearpage
38
-% because the appendix most likely contains much material for which flushed
39
-% bottom pages won't work or look good, put a \raggedbottom here
41
+%% because the appendix most likely contains much material for which flushed
42
+%% bottom pages won't work or look good, put a \raggedbottom here
40 43
 \raggedbottom
41 44
 \include{tex/anhang}
42 45
 \end{document}

+ 2
- 2
MRTbeam/MRTbeam.cls View File

@@ -1,5 +1,5 @@
1
-\newcommand*\MRTbeam@version{0.0.3}
2
-\newcommand*\MRTbeam@date{2018-11-08}
1
+\newcommand*\MRTbeam@version{0.0.4}
2
+\newcommand*\MRTbeam@date{2019-01-30}
3 3
 
4 4
 \NeedsTeXFormat{LaTeX2e}
5 5
 

+ 23
- 22
MRTbeam/beamerthemeMRTbeam.sty View File

@@ -9,6 +9,7 @@
9 9
 \RequirePackage{tikz}
10 10
 \usetikzlibrary{math}
11 11
 \RequirePackage{xparse}
12
+\RequirePackage{MRTutil}
12 13
 \RequirePackage[%>>> biblatex
13 14
   ,sorting=none%
14 15
   ,backend=biber%
@@ -50,11 +51,11 @@
50 51
     \def\ProcessedArgument{<#1>}%
51 52
   \fi%
52 53
 }
53
-\newcommand*{\MRT@ftn}{}% ordinary MRT-footnotes
54
-\newcommand*{\MRT@ftn@p}{}% persistent MRT-footnotes
55
-\newcommand*{\MRT@ftn@c}{}% citation MRT-footnotes
54
+\MRTutil@def\MRT@ftn{}% ordinary MRT-footnotes
55
+\MRTutil@def\MRT@ftn@p{}% persistent MRT-footnotes
56
+\MRTutil@def\MRT@ftn@c{}% citation MRT-footnotes
56 57
 %<<<
57
-\newcommand*{\@leftfooter}{%>>>
58
+\MRTutil@def\@leftfooter{%>>>
58 59
   \footnotesize%
59 60
   \ifx\@occasion\@empty\else\@occasion\newline\fi
60 61
   \ifx\beamer@shorttitle\@empty
@@ -76,39 +77,39 @@
76 77
     \fi
77 78
   \fi
78 79
 }%<<<
79
-\newcommand*{\@centerfooter}{%>>>
80
+\MRTutil@def\@centerfooter{%>>>
80 81
   \normalsize\ifProgressBar\ProgressBar\fi%
81 82
   \makebox[0pt][c]{\insertframenumber}}%<<<
82
-\newcommand*{\@rightfooter}{%>>>
83
+\MRTutil@def\@rightfooter{%>>>
83 84
   \csuse{MRT@ftn@p}%
84 85
   \csuse{MRT@ftn}%
85 86
   \csuse{MRT@ftn@c}%
86 87
 }%<<<
87
-\newcommand*{\MRTbeam@putlogo}[1]%>>>
88
+\MRTutil@def\MRTbeam@putlogo#1%>>>
88 89
   {%
89 90
     \expandafter\MRTbeam@putlogo@a\expandafter
90 91
       {\csname MRTbeam@#1logo@options\endcsname}
91 92
       {\csname MRTbeam@#1logo\endcsname}%
92 93
   }%<<<
93
-\newcommand*\MRTbeam@putlogo@a[2]%>>>
94
+\MRTutil@def\MRTbeam@putlogo@a#1#2%>>>
94 95
   {%
95 96
     % #1 options (macro)
96 97
     % #2 file (csname)
97 98
     \expandafter\MRTbeam@putlogo@b\expandafter{#2}{#1}%
98 99
   }%<<<
99
-\newcommand*\MRTbeam@putlogo@b[2]%>>>
100
+\MRTutil@def\MRTbeam@putlogo@b#1#2%>>>
100 101
   {%
101 102
     % #1 file (macro)
102 103
     % #2 options (macro)
103 104
     \expandafter\MRTbeam@putlogo@c\expandafter{#1}{#2}%
104 105
   }%<<<
105
-\newcommand*\MRTbeam@putlogo@c[2]%>>>
106
+\MRTutil@def\MRTbeam@putlogo@c#1#2%>>>
106 107
   {%
107 108
     % #1 file (string)
108 109
     % #2 options (macro)
109 110
     \smash{\expandafter\includegraphics\expandafter[#2]{#1}}%
110 111
   }%<<<
111
-\newcommand*{\MRT@tabularT}{\begin{tabular}[t]}
112
+\MRTutil@def\MRT@tabularT{\begin{tabular}[t]}
112 113
 \let\footnoterule\relax
113 114
 \gdef\MRTbeam@Grid@defaults{xstep={0.05\paperwidth},ystep=0.1\paperheight,help lines}
114 115
 \tikzset{MRTbeam@Grid@options/.style={xstep={0.05\paperwidth},ystep={0.1\paperheight},help lines}}
@@ -118,7 +119,7 @@
118 119
     \tl_set:No \ProcessedArgument { #1 }
119 120
   }% <<<
120 121
 \ExplSyntaxOff
121
-\newcommand*{\MRTbeam@frametitle}[1]{%>>>
122
+\MRTutil@def\MRTbeam@frametitle#1{%>>>
122 123
   \ifOnlyOneTopRule% no title if only one top rule
123 124
     \vskip-.101\paperheight
124 125
   \else
@@ -183,7 +184,7 @@
183 184
     }%
184 185
   \insertsubsection}
185 186
 %<<<
186
-\newcommand*{\ColumnsTabularNotes}[1]{\gdef\MRT@ColTabNotes{#1}}
187
+\MRTutil@def\ColumnsTabularNotes#1{\gdef\MRT@ColTabNotes{#1}}
187 188
 \newenvironment*{whiteframes}{\whiteframestrue}{\whiteframesfalse}
188 189
 \NewDocumentCommand{\advisor}{s o m}{%>>>
189 190
   \IfNoValueTF{#2}%
@@ -321,14 +322,14 @@
321 322
   \fi%
322 323
 }%<<<
323 324
 \def\MRT@pbar@start{0}
324
-\newcommand*{\StartOfProgress}{%>>>
325
+\MRTutil@def\StartOfProgress{%>>>
325 326
   \xdef\MRT@pbar@start{\insertframenumber}%
326 327
   \immediate\write\@auxout{%
327 328
     \gdef\noexpand\MRT@pbar@start{\insertframenumber}%
328 329
   }%
329 330
 }%<<<
330 331
 \def\MRT@pbar@end{\inserttotalframenumber}
331
-\newcommand*{\EndOfProgress}{%>>>
332
+\MRTutil@def\EndOfProgress{%>>>
332 333
   \xdef\MRT@pbar@end{\insertframenumber}%
333 334
   \immediate\write\@auxout{%
334 335
     \gdef\noexpand\MRT@pbar@end{\insertframenumber}%
@@ -448,7 +449,7 @@
448 449
   {}%\usebibmacro{postnote}}%
449 450
 %<<<
450 451
 % Untested whether the new version works -- legacy >>>
451
-%\newcommand*{\MRTbeam@ifciteseen@old}{%>>>
452
+%\MRTutil@def\MRTbeam@ifciteseen@old{%>>>
452 453
 %  \ifNoExplicitCite%
453 454
 %    \expandafter\@firstoftwo%
454 455
 %  \else%
@@ -456,7 +457,7 @@
456 457
 %    \expandafter\MRTbeam@ifanyseen@old%
457 458
 %  \fi}%
458 459
 %%<<<
459
-%\newcommand*{\MRTbeam@ifanyseen@old}{%>>>
460
+%\MRTutil@def\MRTbeam@ifanyseen@old{%>>>
460 461
 %  \ifExplicitCiteOnce%
461 462
 %    \expandafter\MRTbeam@temp@if%
462 463
 %  \else%
@@ -464,26 +465,26 @@
464 465
 %  \fi}
465 466
 %%<<<
466 467
 %<<<
467
-\newcommand*{\MRTbeam@ifciteseen}{%>>>
468
-  \ifciteseen%
468
+\MRTutil@def\MRTbeam@ifciteseen{%>>>
469
+  \ifciteseen
469 470
     {\MRTbeam@ifanyseen@a}%
470 471
     {\MRTbeam@ifanyseen@b}%
471 472
 }
472 473
 %<<<
473
-\newcommand*{\MRTbeam@ifentryseen}[1]{%>>>
474
+\MRTutil@def\MRTbeam@ifentryseen#1{%>>>
474 475
   \blx@ifentryseen@global{#1}%
475 476
     {\MRTbeam@ifanyseen@a}%
476 477
     {\MRTbeam@ifanyseen@b}%
477 478
 }
478 479
 %<<<
479
-\newcommand*{\MRTbeam@ifanyseen@a}{%>>>
480
+\MRTutil@def\MRTbeam@ifanyseen@a{%>>>
480 481
   \ifExplicitCiteOnce%
481 482
     \expandafter\@firstoftwo%
482 483
   \else%
483 484
     \expandafter\MRTbeam@ifanyseen@b%
484 485
   \fi}
485 486
 %<<<
486
-\newcommand*{\MRTbeam@ifanyseen@b}{%>>>
487
+\MRTutil@def\MRTbeam@ifanyseen@b{%>>>
487 488
   \ifNoExplicitCite%
488 489
     \expandafter\@firstoftwo%
489 490
   \else%

+ 96
- 88
MRTif/MRTif.sty View File

@@ -1,5 +1,5 @@
1
-\newcommand*\MRTif@version{0.0.5}
2
-\newcommand*\MRTif@date{2019-01-08}
1
+\newcommand*\MRTif@version{0.0.6}
2
+\newcommand*\MRTif@date{2019-01-30}
3 3
 
4 4
 \NeedsTeXFormat{LaTeX2e}
5 5
 
@@ -8,7 +8,7 @@
8 8
     \MRTif@date\space v\MRTif@version\space some if tests originally for MRTbeam
9 9
     and mrtarbeit%
10 10
   ]
11
-\RequirePackage{pdftexcmds}
11
+\RequirePackage{pdftexcmds,MRTutil}
12 12
 
13 13
 % MRTif@fi macros >>>
14 14
 \long\def\MRTif@fiAa#1\fi#2#3{\fi#2}
@@ -28,7 +28,7 @@
28 28
 % <<<
29 29
 
30 30
 \def\endMRTif@argument{\MRTif@IfYouSeeThisContactTheMaintainer}
31
-\newcommand\MRTif@endMRTif@argument[1]% >>>
31
+\MRTutil@def[\long]\MRTif@endMRTif@argument#1% >>>
32 32
   {%
33 33
     \ifx\endMRTif@argument#1%
34 34
       \MRTif@fiAa
@@ -37,7 +37,7 @@
37 37
     \fi
38 38
   }% <<<
39 39
 
40
-\newcommand*\MRTif@groupify@TF[1]% >>>
40
+\MRTutil@def\MRTif@groupify@TF#1% >>>
41 41
   {%
42 42
     \expandafter\long\expandafter\edef\csname MRTif#1GTF\endcsname##1%
43 43
       {%
@@ -46,7 +46,7 @@
46 46
           {\unexpanded\expandafter{\csname MRTif#1TF\endcsname}{##1}}%
47 47
       }%
48 48
   }% <<<
49
-\newcommand*\MRTif@create@TandF[1]% >>>
49
+\MRTutil@def\MRTif@create@TandF#1% >>>
50 50
   {%
51 51
     \expandafter\long\expandafter\edef\csname MRTif#1T\endcsname##1%
52 52
       {%
@@ -61,7 +61,7 @@
61 61
           {\noexpand\@firstofone}%
62 62
       }%
63 63
   }% <<<
64
-\newcommand*\MRTif@create@TandF@twoargs[1]% >>>
64
+\MRTutil@def\MRTif@create@TandF@twoargs#1% >>>
65 65
   {%
66 66
     \expandafter\long\expandafter\edef\csname MRTif#1T\endcsname##1##2%
67 67
       {%
@@ -76,7 +76,7 @@
76 76
           {\noexpand\@firstofone}%
77 77
       }%
78 78
   }% <<<
79
-\newcommand*\MRTif@create@N@TandF[1]% >>>
79
+\MRTutil@def\MRTif@create@N@TandF#1% >>>
80 80
   {%
81 81
     \expandafter\long\expandafter\edef\csname MRTif#1NTF\endcsname##1%
82 82
       {%
@@ -86,7 +86,7 @@
86 86
       }%
87 87
     \MRTif@create@TandF{#1N}%
88 88
   }% <<<
89
-\newcommand*\MRTif@create@N@TandF@twoargs[1]% >>>
89
+\MRTutil@def\MRTif@create@N@TandF@twoargs#1% >>>
90 90
   {%
91 91
     \expandafter\long\expandafter\edef\csname MRTif#1NNTF\endcsname##1##2%
92 92
       {%
@@ -120,17 +120,17 @@
120 120
       }%
121 121
     \MRTif@create@TandF@twoargs{#1nN}%
122 122
   }% <<<
123
-\newcommand*\MRTif@create@TandF@N@TandF[1]% >>>
123
+\MRTutil@def\MRTif@create@TandF@N@TandF#1% >>>
124 124
   {%
125 125
     \MRTif@create@TandF{#1}%
126 126
     \MRTif@create@N@TandF{#1}%
127 127
   }% <<<
128
-\newcommand*\MRTif@create@TandF@N@TandF@twoargs[1]% >>>
128
+\MRTutil@def\MRTif@create@TandF@N@TandF@twoargs#1% >>>
129 129
   {%
130 130
     \MRTif@create@TandF@twoargs{#1}%
131 131
     \MRTif@create@N@TandF@twoargs{#1}%
132 132
   }% <<<
133
-\newcommand\MRTif@notEmpty@noGroup@noSpace[2]% >>>
133
+\MRTutil@def[\long]\MRTif@notEmpty@noGroup@noSpace#1#2% >>>
134 134
   {%
135 135
     \MRTifEmptyTF{#1}
136 136
       {\@secondoftwo}
@@ -145,7 +145,7 @@
145 145
       }%
146 146
   }% <<<
147 147
 % MRTifEmpty >>>
148
-\newcommand\MRTifEmptyTF[1]% >>>
148
+\MRTutil@def[\long]\MRTifEmptyTF#1% >>>
149 149
   {%
150 150
     \if\relax\detokenize{#1}\relax
151 151
       \MRTif@fiAa
@@ -153,31 +153,39 @@
153 153
       \MRTif@fiBb
154 154
     \fi
155 155
   }% <<<
156
-\newcommand\MRTifEmptyT[1]{% >>>
157
-  \if\relax\detokenize{#1}\relax
158
-    \MRTif@fiAy
159
-  \else
160
-    \MRTif@fiBn
161
-  \fi}
162
-% <<<
163
-\newcommand\MRTifEmptyF[1]{% >>>
164
-  \if\relax\detokenize{#1}\relax
165
-    \MRTif@fiAn
166
-  \else
167
-    \MRTif@fiBy
168
-  \fi}
169
-% <<<
170
-\newcommand\MRTifEmptyNTF[1]% >>>
171
-  {\expandafter\MRTifEmptyTF\expandafter{#1}}% <<<
172
-\newcommand\MRTifEmptyNT[1]% >>>
173
-  {\expandafter\MRTifEmptyT\expandafter{#1}}% <<<
174
-\newcommand\MRTifEmptyNF[1]% >>>
175
-  {\expandafter\MRTifEmptyF\expandafter{#1}}% <<<
156
+\MRTutil@def[\long]\MRTifEmptyT#1% >>>
157
+  {%
158
+    \if\relax\detokenize{#1}\relax
159
+      \MRTif@fiAy
160
+    \else
161
+      \MRTif@fiBn
162
+    \fi
163
+  }% <<<
164
+\MRTutil@def[\long]\MRTifEmptyF#1% >>>
165
+  {%
166
+    \if\relax\detokenize{#1}\relax
167
+      \MRTif@fiAn
168
+    \else
169
+      \MRTif@fiBy
170
+    \fi
171
+  }% <<<
172
+\MRTutil@def\MRTifEmptyNTF% >>>
173
+  {%
174
+    \expandafter\MRTifEmptyTF\expandafter
175
+  }% <<<
176
+\MRTutil@def\MRTifEmptyNT% >>>
177
+  {%
178
+    \expandafter\MRTifEmptyT\expandafter
179
+  }% <<<
180
+\MRTutil@def\MRTifEmptyNF% >>>
181
+  {%
182
+    \expandafter\MRTifEmptyF\expandafter
183
+  }% <<<
176 184
 \MRTif@groupify@TF{Empty}
177 185
 \MRTif@create@TandF@N@TandF{EmptyG}
178 186
 % <<<
179 187
 % MRTifGroup >>>
180
-\newcommand\MRTifGroupTF[1]% >>>
188
+\MRTutil@def[\long]\MRTifGroupTF#1% >>>
181 189
   {%
182 190
     \expandafter\MRTifGroup@a\romannumeral-`\.#1.{}\MRTifGroup@endargument
183 191
   }% <<<
@@ -196,7 +204,7 @@
196 204
 \MRTif@create@TandF@N@TandF{Group}
197 205
 % <<<
198 206
 % MRTifGroupNoSpaces >>>
199
-\newcommand\MRTifGroupNoSpacesTF[1]% >>>
207
+\MRTutil@def[\long]\MRTifGroupNoSpacesTF#1% >>>
200 208
   {%
201 209
     \expandafter\MRTifStringsMatchTF\expandafter
202 210
       {\MRTifGroupNoSpaces@a#1\end@MRTifGroupNoSpaces@a}{#1}
@@ -207,11 +215,11 @@
207 215
 \MRTif@create@TandF@N@TandF{GroupNoSpaces}
208 216
 % <<<
209 217
 % MRTifStringsMatch >>>
210
-\newcommand\MRTifStringsMatchTF[2]% >>>
218
+\MRTutil@def[\long]\MRTifStringsMatchTF#1#2% >>>
211 219
   {%
212 220
     \MRTifStringsMatchXXTF{\detokenize{#1}}{\detokenize{#2}}
213 221
   }% <<<
214
-\newcommand\MRTifStringsMatchGTF[2]% >>>
222
+\MRTutil@def[\long]\MRTifStringsMatchGTF#1#2% >>>
215 223
   {%
216 224
     \MRTifGroupTF{#1}
217 225
       {\MRTifStringsMatchGTF#1{#2}}
@@ -225,15 +233,15 @@
225 233
 \MRTif@create@TandF@N@TandF@twoargs{StringsMatchG}
226 234
 % <<<
227 235
 % MRTifStringsMatchXX >>>
228
-\newcommand\MRTifStringsMatchXXTF[2]
236
+\MRTutil@def[\long]\MRTifStringsMatchXXTF#1#2% >>>
229 237
   {%
230 238
     \ifnum\pdf@strcmp{#1}{#2}=0
231 239
       \MRTif@fiAa
232 240
     \else
233 241
       \MRTif@fiBb
234 242
     \fi
235
-  }
236
-\newcommand\MRTifStringsMatchXXGTF[2]% >>>
243
+  }% <<<
244
+\MRTutil@def[\long]\MRTifStringsMatchXXGTF#1#2% >>>
237 245
   {%
238 246
     \MRTifGroupTF{#1}
239 247
       {\MRTifStringsMatchXXGTF#1{#2}}
@@ -247,7 +255,7 @@
247 255
 \MRTif@create@TandF@twoargs{StringsMatchXXG}
248 256
 % <<<
249 257
 % MRTifOneToken >>>
250
-\newcommand\MRTifOneTokenTF[1]% >>>
258
+\MRTutil@def[\long]\MRTifOneTokenTF#1% >>>
251 259
   {%
252 260
     \MRTifEmptyTF{#1}{\@secondoftwo}
253 261
       {%
@@ -263,7 +271,7 @@
263 271
 \MRTif@create@TandF@N@TandF{OneTokenG}
264 272
 % <<<
265 273
 % MRTifOneTokenNoGroup>>>
266
-\newcommand\MRTifOneTokenNoGroupTF[1]% >>>
274
+\MRTutil@def[\long]\MRTifOneTokenNoGroupTF#1% >>>
267 275
   {%
268 276
     \MRTifContainsGroupTF{#1}
269 277
       {\@secondoftwo}
@@ -272,7 +280,7 @@
272 280
 \MRTif@create@TandF@N@TandF{OneTokenNoGroup}
273 281
 % <<<
274 282
 % MRTifTwoToken >>>
275
-\newcommand\MRTifTwoTokenTF[1]% >>>
283
+\MRTutil@def[\long]\MRTifTwoTokenTF#1% >>>
276 284
   {%
277 285
     \MRTifEmptyTF{#1}{\@secondoftwo}
278 286
       {%
@@ -292,7 +300,7 @@
292 300
 \MRTif@create@TandF@N@TandF{TwoTokenG}
293 301
 % <<<
294 302
 % MRTifNumToken>>>
295
-\newcommand\MRTifNumTokenTF[2]% >>>
303
+\MRTutil@def[\long]\MRTifNumTokenTF#1#2% >>>
296 304
   {%
297 305
     \ifnum\MRTtllength{#2}=#1\relax
298 306
       \MRTif@fiAa
@@ -300,25 +308,25 @@
300 308
       \MRTif@fiBb
301 309
     \fi
302 310
   }% <<<
303
-\newcommand\MRTifNumTokenGTF[2]% >>>
311
+\MRTutil@def[\long]\MRTifNumTokenGTF#1#2% >>>
304 312
   {%
305 313
     \MRTifGroupTF{#2}
306 314
       {\MRTifNumTokenGTF{#1}#2}
307 315
       {\MRTifNumTokenTF{#1}{#2}}
308 316
   }% <<<
309
-\newcommand\MRTifNumTokenN@[2]% >>>
317
+\MRTutil@def[\long]\MRTifNumTokenN@#1#2% >>>
310 318
   {%
311 319
     \MRTifNumTokenTF{#2}{#1}%
312 320
   }% <<<
313
-\newcommand\MRTifNumTokenNTF[2]% >>>
321
+\MRTutil@def[\long]\MRTifNumTokenNTF#1#2% >>>
314 322
   {%
315 323
     \expandafter\MRTifNumTokenN@\expandafter{#2}{#1}%
316 324
   }% <<<
317
-\newcommand\MRTifNumTokenGN@[2]% >>>
325
+\MRTutil@def[\long]\MRTifNumTokenGN@#1#2% >>>
318 326
   {%
319 327
     \MRTifNumTokenGTF{#2}{#1}%
320 328
   }% <<<
321
-\newcommand\MRTifNumTokenGNTF[2]% >>>
329
+\MRTutil@def[\long]\MRTifNumTokenGNTF#1#2% >>>
322 330
   {%
323 331
     \expandafter\MRTifNumTokenGN@\expandafter{#2}{#1}%
324 332
   }% <<<
@@ -328,7 +336,7 @@
328 336
 \MRTif@create@TandF@twoargs{NumTokenGN}
329 337
 % <<<
330 338
 % MRTifLetter >>>
331
-\newcommand\MRTifLetterTF[1]% >>>
339
+\MRTutil@def[\long]\MRTifLetterTF#1% >>>
332 340
   {%
333 341
     \MRTifGroupTF{#1}
334 342
       {\@secondoftwo}
@@ -339,7 +347,7 @@
339 347
       }%
340 348
   }% <<<
341 349
 %\MRTif@groupify@TF{Letter}% possible but results in unnecessary group test
342
-\newcommand\MRTifLetterGTF[1]% >>>
350
+\MRTutil@def[\long]\MRTifLetterGTF#1% >>>
343 351
   {%
344 352
     \MRTifGroupTF{#1}
345 353
       {\MRTifLetterGTF#1}
@@ -349,13 +357,13 @@
349 357
           {\@secondoftwo}%
350 358
       }%
351 359
   }% <<<
352
-%\newcommand\MRTifLetter@core[1]% >>>
360
+%\MRTutil@def[\long]\MRTifLetter@core#1% >>>
353 361
 \begingroup
354 362
 \catcode`z=11 % just to make sure z has catcode 11 in the following
355 363
 \def\MRTif@zz
356 364
   {%
357 365
     \endgroup
358
-    \newcommand\MRTifLetter@core[1]
366
+    \MRTutil@def[\long]\MRTifLetter@core##1%
359 367
       {%
360 368
         \ifcat\noexpand##1z%
361 369
           \MRTif@fiAa
@@ -370,7 +378,7 @@
370 378
 \MRTif@create@TandF@N@TandF{LetterG}
371 379
 % <<<
372 380
 % MRTifTokensMatch >>>
373
-\newcommand\MRTifTokensMatchTF[2]% >>>
381
+\MRTutil@def[\long]\MRTifTokensMatchTF#1#2% >>>
374 382
   {%
375 383
     \MRTifGroupTF{#1}
376 384
       {\@secondoftwo}
@@ -380,7 +388,7 @@
380 388
           {\MRTifTokensMatch@a{#1}{#2}}%
381 389
       }%
382 390
   }% <<<
383
-\newcommand\MRTifTokensMatchGTF[2]% >>>
391
+\MRTutil@def[\long]\MRTifTokensMatchGTF#1#2% >>>
384 392
   {%
385 393
     \MRTifGroupTF{#1}
386 394
       {\MRTifTokensMatchGTF#1{#2}}
@@ -390,7 +398,7 @@
390 398
           {\MRTifTokensMatch@a{#1}{#2}}%
391 399
       }%
392 400
   }% <<<
393
-\newcommand\MRTifTokensMatch@a[2]% >>>
401
+\MRTutil@def[\long]\MRTifTokensMatch@a#1#2% >>>
394 402
   {%
395 403
     \MRTifOneTokenTF{#1}
396 404
       {%
@@ -410,13 +418,13 @@
410 418
 \MRTif@create@TandF@N@TandF@twoargs{TokensMatchG}
411 419
 % <<<
412 420
 % MRTifDigit >>>
413
-\newcommand\MRTifDigitTF[1]% >>>
421
+\MRTutil@def[\long]\MRTifDigitTF#1% >>>
414 422
   {%
415 423
     \MRTifOneTokenNoGroupTF{#1}
416 424
       {\MRTifDigit@a{#1}}
417 425
       {\@secondoftwo}%
418 426
   }% <<<
419
-\newcommand\MRTifDigit@a[1]% >>>
427
+\MRTutil@def[\long]\MRTifDigit@a#1% >>>
420 428
   {%
421 429
     \ifx0#1\MRTif@fiAa
422 430
     \else\MRTifDigit@b1#1%
@@ -431,11 +439,11 @@
431 439
     \else\MRTif@fiBb
432 440
     \fi
433 441
   }% <<<
434
-\newcommand\MRTifDigit@b[2]% >>>
442
+\MRTutil@def[\long]\MRTifDigit@b#1#2% >>>
435 443
   {%
436 444
     \fi\ifx#1#2\MRTif@fiAa
437 445
   }% <<<
438
-\newcommand\MRTifDigitGTF[1]% >>>
446
+\MRTutil@def[\long]\MRTifDigitGTF#1% >>>
439 447
   {%
440 448
     \MRTifGroupTF{#1}
441 449
       {\MRTifDigitGTF#1}
@@ -449,13 +457,13 @@
449 457
 \MRTif@create@TandF@N@TandF{DigitG}
450 458
 % <<<
451 459
 % MRTifNumber >>>
452
-\newcommand\MRTifNumberTF[1]% >>>
460
+\MRTutil@def[\long]\MRTifNumberTF#1% >>>
453 461
   {%
454 462
     \MRTif@notEmpty@noGroup@noSpace
455 463
       {#1}
456 464
       {\MRTifNumber@ifSign#1\endMRTif@argument}%
457 465
   }% <<<
458
-\newcommand\MRTifNumber@ifSign[1]% >>>
466
+\MRTutil@def[\long]\MRTifNumber@ifSign#1% >>>
459 467
   {%
460 468
     \ifx+#1%
461 469
       \MRTif@fifiAa
@@ -469,7 +477,7 @@
469 477
     {\MRTifNumber@ifDigit@noend}
470 478
     {\MRTifNumber@ifDigit#1}
471 479
   }% <<<
472
-\newcommand\MRTifNumber@ifDigit[1]% >>>
480
+\MRTutil@def[\long]\MRTifNumber@ifDigit#1% >>>
473 481
   {%
474 482
     \MRTif@endMRTif@argument{#1}
475 483
       {\@firstoftwo}
@@ -479,7 +487,7 @@
479 487
           {\MRTifNumber@false}%
480 488
       }%
481 489
   }% <<<
482
-\newcommand\MRTifNumber@ifDigit@noend[1]% >>>
490
+\MRTutil@def[\long]\MRTifNumber@ifDigit@noend#1% >>>
483 491
   {%
484 492
     \MRTif@endMRTif@argument{#1}
485 493
       {\@secondoftwo}
@@ -498,7 +506,7 @@
498 506
 \MRTif@create@TandF@N@TandF{NumberG}
499 507
 % <<<
500 508
 % MRTifNumberNoSign >>>
501
-\newcommand\MRTifNumberNoSignTF[1]% >>>
509
+\MRTutil@def[\long]\MRTifNumberNoSignTF#1% >>>
502 510
   {%
503 511
     \MRTif@notEmpty@noGroup@noSpace{#1}
504 512
       {\MRTifNumber@ifDigit#1\endMRTif@argument}%
@@ -508,23 +516,23 @@
508 516
 \MRTif@create@TandF@N@TandF{NumberNoSignG}
509 517
 % <<<
510 518
 % MRTifFloat >>>
511
-\newcommand\MRTifFloatTF[1]% >>>
519
+\MRTutil@def[\long]\MRTifFloatTF#1% >>>
512 520
   {%
513 521
     \MRTif@notEmpty@noGroup@noSpace{#1}{\MRTifFloat@a{#1}}
514 522
   }% <<<
515
-%\newcommand\MRTifFloat@a \newcommand\MRTifFloat@ifDot >>>
523
+%\MRTutil@def\MRTifFloat@a \MRTutil@def\MRTifFloat@ifDot >>>
516 524
 \begingroup
517 525
 \catcode`\?=4
518 526
 \def\MRTif@zz
519 527
   {%
520 528
     \endgroup
521
-    \newcommand\MRTifFloat@a[1]% >>>
529
+    \MRTutil@def[\long]\MRTifFloat@a##1% >>>
522 530
       {%
523 531
         \MRTifFloat@ifDot{##1}
524 532
           {\MRTifFloat@withDot##1\MRTifFloat@endargument}
525 533
           {\MRTifNumber@ifSign##1\endMRTif@argument}%
526 534
       }% <<<
527
-    \newcommand\MRTifFloat@ifDot[1]% >>>
535
+    \MRTutil@def[\long]\MRTifFloat@ifDot##1% >>>
528 536
       {%
529 537
         \MRTifFloat@ifDot@a##1.?\MRTifFloat@endargument
530 538
       }% <<<
@@ -554,11 +562,11 @@
554 562
 \MRTif@create@TandF@N@TandF{FloatG}
555 563
 % <<<
556 564
 % MRTifFloatNoSign >>>
557
-\newcommand\MRTifFloatNoSignTF[1]% >>>
565
+\MRTutil@def[\long]\MRTifFloatNoSignTF#1% >>>
558 566
   {%
559 567
     \MRTif@notEmpty@noGroup@noSpace{#1}{\MRTifFloatNoSpace@a{#1}}
560 568
   }% <<<
561
-\newcommand\MRTifFloatNoSpace@a[1]% >>>
569
+\MRTutil@def[\long]\MRTifFloatNoSpace@a#1% >>>
562 570
   {%
563 571
     \MRTifFloat@ifDot{#1}
564 572
       {\MRTifFloatNoSign@withDot#1\MRTifFloatNoSign@endargument}
@@ -579,7 +587,7 @@
579 587
 \MRTif@create@TandF@N@TandF{FloatNoSignG}
580 588
 % <<<
581 589
 % MRTifContainsGroup >>>
582
-\newcommand\MRTifContainsGroupTF[1]% >>>
590
+\MRTutil@def[\long]\MRTifContainsGroupTF#1% >>>
583 591
   {%
584 592
     \expandafter\MRTifContainsGroup@a
585 593
       \MRTifContainsGroup@eat#1{}%
@@ -597,7 +605,7 @@
597 605
 \MRTif@create@TandF@N@TandF{ContainsGroupG}
598 606
 % <<<
599 607
 % MRTifContainsSpace >>>
600
-\newcommand\MRTifContainsSpaceTF[1]% >>>
608
+\MRTutil@def[\long]\MRTifContainsSpaceTF#1% >>>
601 609
   {%
602 610
     \expandafter\MRTifContainsSpace@a
603 611
       \MRTifContainsSpace@eat#1
@@ -614,39 +622,39 @@
614 622
 \MRTif@create@TandF@N@TandF{ContainsSpace}
615 623
 \MRTif@create@TandF@N@TandF{ContainsSpaceG}
616 624
 % <<<
617
-%\newcommand\MRTifTokenInTF[2]% >>>
625
+%\MRTutil@def[\long]\MRTifTokenInTF#1#2% >>>
618 626
   %{%
619 627
     %\
620 628
   %}% <<<
621 629
 %
622 630
 % MRTtllength >>>
623
-\newcommand\MRTtllength@inner[1]% >>>
631
+\MRTutil@def[\long]\MRTtllength@inner#1% >>>
624 632
   {%
625 633
     \MRTif@endMRTif@argument{#1}
626 634
       {\relax}
627 635
       {+1\MRTtllength@inner}%
628 636
   }% <<<
629
-\newcommand\MRTtllength[1]% >>>
637
+\MRTutil@def[\long]\MRTtllength#1% >>>
630 638
   {%
631 639
     \the\numexpr0\MRTtllength@inner#1\endMRTif@argument
632 640
   }% <<<
633
-\newcommand\MRTtllengthN[1]% >>>
641
+\MRTutil@def\MRTtllengthN% >>>
634 642
   {%
635
-    \expandafter\MRTtllength\expandafter{#1}%
643
+    \expandafter\MRTtllength\expandafter%
636 644
   }% <<<
637 645
 % <<<
638 646
 
639 647
 % MRTifFexp >>>
640
-\newcommand\MRTif@endfexp@gobble[1]{ }
641
-\newcommand\MRTif@endfexp@firstofone[1]{ #1}
642
-\newcommand\MRTif@endfexp@firstoftwo[2]{ #1}
643
-\newcommand\MRTif@endfexp@secondoftwo[2]{ #2}
644
-\newcommand\MRTifFexp[1]% >>>
648
+\MRTutil@def[\long]\MRTif@endfexp@gobble#1{ }
649
+\MRTutil@def[\long]\MRTif@endfexp@firstofone#1{ #1}
650
+\MRTutil@def[\long]\MRTif@endfexp@firstoftwo#1#2{ #1}
651
+\MRTutil@def[\long]\MRTif@endfexp@secondoftwo#1#2{ #2}
652
+\MRTutil@def[\long]\MRTifFexp#1% >>>
645 653
   {%
646 654
     \romannumeral-`\0\expandafter\MRTifFexp@a
647 655
     \romannumeral-`\0#1{\MRTifFexp@b} \MRTifFexp@c
648 656
   }% <<<
649
-\newcommand\MRTifFexp@a[1]% >>>
657
+\MRTutil@def[\long]\MRTifFexp@a#1% >>>
650 658
   {%
651 659
     \ifx\MRTifFexp@c#1%
652 660
       \MRTif@fiAa
@@ -660,7 +668,7 @@
660 668
       #1%
661 669
     }
662 670
   }% <<<
663
-\newcommand\MRTifFexp@b[1]% >>>
671
+\MRTutil@def[\long]\MRTifFexp@b#1% >>>
664 672
   {%
665 673
     \ifx\MRTifFexp@c#1%
666 674
       \MRTif@fiAa
@@ -674,15 +682,15 @@
674 682
       \MRTif@endfexp@firstoftwo{#1}%
675 683
     }%
676 684
   }% <<<
677
-\newcommand\MRTifFexp@c% >>>
685
+\MRTutil@def\MRTifFexp@c% >>>
678 686
   { % space ending the inner \romannumeral
679 687
     \MRTif@endfexp@secondoftwo
680 688
   }% <<<
681
-\newcommand\MRTifFexpII[1]% >>>
689
+\MRTutil@def[\long]\MRTifFexpII#1% >>>
682 690
   {%
683 691
     \romannumeral-`\0#1\MRTif@endfexp@firstoftwo\MRTif@endfexp@secondoftwo
684 692
   }% <<<
685
-\newcommand\MRTifFexpI[1]% >>>
693
+\MRTutil@def[\long]\MRTifFexpI#1% >>>
686 694
   {%
687 695
     \romannumeral-`\0#1\MRTif@endfexp@secondoftwo\MRTif@endfexp@gobble
688 696
   }% <<<

+ 51
- 51
MRTsfacc/MRTsfacc.list.helvet.tex View File

@@ -1,56 +1,56 @@
1 1
 \ProvidesFile{MRTsfacc.list.helvet.tex}%
2 2
   [2018-11-06 provides mathaccentV shifts for the helvet font]%
3
-\MRTsfaccShift{a}{4mu}%
4
-\MRTsfaccShift{A}{5.4mu}%
3
+\MRTsfaccShift{a}{2mu}%
4
+\MRTsfaccShift{A}{2.7mu}%
5 5
 \MRTsfaccShift{b}{0mu}%
6
-\MRTsfaccShift{B}{3.5mu}%
7
-\MRTsfaccShift{c}{3mu}%
8
-\MRTsfaccShift{C}{4mu}%
9
-\MRTsfaccShift{d}{6.5mu}%
10
-\MRTsfaccShift{D}{3mu}%
11
-\MRTsfaccShift{e}{3.5mu}%
12
-\MRTsfaccShift{E}{4.4mu}%
13
-\MRTsfaccShift{f}{4.4mu}%
14
-\MRTsfaccShift{F}{4.7mu}%
15
-\MRTsfaccShift{g}{3mu}%
16
-\MRTsfaccShift{G}{4.7mu}%
17
-\MRTsfaccShift{h}{2mu}%
18
-\MRTsfaccShift{H}{4.5mu}%
19
-\MRTsfaccShift{i}{4mu}%
6
+\MRTsfaccShift{B}{1.75mu}%
7
+\MRTsfaccShift{c}{1.5mu}%
8
+\MRTsfaccShift{C}{2mu}%
9
+\MRTsfaccShift{d}{3.25mu}%
10
+\MRTsfaccShift{D}{1.5mu}%
11
+\MRTsfaccShift{e}{1.75mu}%
12
+\MRTsfaccShift{E}{2.2mu}%
13
+\MRTsfaccShift{f}{2.2mu}%
14
+\MRTsfaccShift{F}{2.35mu}%
15
+\MRTsfaccShift{g}{1.5mu}%
16
+\MRTsfaccShift{G}{2.35mu}%
17
+\MRTsfaccShift{h}{1mu}%
18
+\MRTsfaccShift{H}{2.25mu}%
19
+\MRTsfaccShift{i}{2mu}%
20 20
 \MRTsfaccShiftLet{\imath}{i}%
21
-\MRTsfaccShift{I}{5mu}%
22
-\MRTsfaccShift{j}{4mu}%
21
+\MRTsfaccShift{I}{2.5mu}%
22
+\MRTsfaccShift{j}{2mu}%
23 23
 \MRTsfaccShiftLet{\jmath}{j}%
24
-\MRTsfaccShift{J}{7mu}%
25
-\MRTsfaccShift{k}{1mu}%
26
-\MRTsfaccShift{K}{3mu}%
27
-\MRTsfaccShift{l}{5mu}%
28
-\MRTsfaccShift{L}{1.5mu}%
29
-\MRTsfaccShift{m}{4mu}%
30
-\MRTsfaccShift{M}{4.5mu}%
31
-\MRTsfaccShift{n}{3.8mu}%
32
-\MRTsfaccShift{N}{4.5mu}%
33
-\MRTsfaccShift{o}{3.5mu}%
34
-\MRTsfaccShift{O}{4.5mu}%
35
-\MRTsfaccShift{p}{3.5mu}%
36
-\MRTsfaccShift{P}{3.5mu}%
37
-\MRTsfaccShift{q}{3.5mu}%
38
-\MRTsfaccShift{Q}{4.5mu}%
39
-\MRTsfaccShift{r}{3.3mu}%
40
-\MRTsfaccShift{R}{3.5mu}%
41
-\MRTsfaccShift{s}{3mu}%
42
-\MRTsfaccShift{S}{4mu}%
43
-\MRTsfaccShift{t}{3.5mu}%
44
-\MRTsfaccShift{T}{3.5mu}%
45
-\MRTsfaccShift{u}{3.4mu}%
46
-\MRTsfaccShift{U}{4.5mu}%
47
-\MRTsfaccShift{v}{2.5mu}%
48
-\MRTsfaccShift{V}{3.3mu}%
49
-\MRTsfaccShift{w}{2.3mu}%
50
-\MRTsfaccShift{W}{3.3mu}%
51
-\MRTsfaccShift{x}{2.5mu}%
52
-\MRTsfaccShift{X}{3.7mu}%
53
-\MRTsfaccShift{y}{2.5mu}%
54
-\MRTsfaccShift{Y}{3.3mu}%
55
-\MRTsfaccShift{z}{3mu}%
56
-\MRTsfaccShift{Z}{4mu}%
24
+\MRTsfaccShift{J}{3.5mu}%
25
+\MRTsfaccShift{k}{0.5mu}%
26
+\MRTsfaccShift{K}{1.5mu}%
27
+\MRTsfaccShift{l}{2.5mu}%
28
+\MRTsfaccShift{L}{0.75mu}%
29
+\MRTsfaccShift{m}{2mu}%
30
+\MRTsfaccShift{M}{2.25mu}%
31
+\MRTsfaccShift{n}{1.9mu}%
32
+\MRTsfaccShift{N}{2.25mu}%
33
+\MRTsfaccShift{o}{1.75mu}%
34
+\MRTsfaccShift{O}{2.25mu}%
35
+\MRTsfaccShift{p}{1.75mu}%
36
+\MRTsfaccShift{P}{1.75mu}%
37
+\MRTsfaccShift{q}{1.75mu}%
38
+\MRTsfaccShift{Q}{2.25mu}%
39
+\MRTsfaccShift{r}{1.65mu}%
40
+\MRTsfaccShift{R}{1.75mu}%
41
+\MRTsfaccShift{s}{1.5mu}%
42
+\MRTsfaccShift{S}{2mu}%
43
+\MRTsfaccShift{t}{1.75mu}%
44
+\MRTsfaccShift{T}{1.75mu}%
45
+\MRTsfaccShift{u}{1.7mu}%
46
+\MRTsfaccShift{U}{2.25mu}%
47
+\MRTsfaccShift{v}{1.25mu}%
48
+\MRTsfaccShift{V}{1.65mu}%
49
+\MRTsfaccShift{w}{1.15mu}%
50
+\MRTsfaccShift{W}{1.65mu}%
51
+\MRTsfaccShift{x}{1.25mu}%
52
+\MRTsfaccShift{X}{1.85mu}%
53
+\MRTsfaccShift{y}{1.25mu}%
54
+\MRTsfaccShift{Y}{1.65mu}%
55
+\MRTsfaccShift{z}{1.5mu}%
56
+\MRTsfaccShift{Z}{2mu}%

+ 150
- 34
MRTsfacc/MRTsfacc.sty View File

@@ -1,5 +1,5 @@
1
-\newcommand*\MRTsfacc@version{0.0.4}
2
-\newcommand*\MRTsfacc@date{2018-11-07}
1
+\newcommand*\MRTsfacc@version{0.0.5}
2
+\newcommand*\MRTsfacc@date{2019-01-30}
3 3
 
4 4
 \NeedsTeXFormat{LaTeX2e}
5 5
 
@@ -9,6 +9,7 @@
9 9
     helvet and other fonts%
10 10
   ]
11 11
 
12
+\RequirePackage{MRTutil}
12 13
 \RequirePackage{MRTif}
13 14
 \RequirePackage{amsmath}
14 15
 
@@ -18,7 +19,7 @@
18 19
 
19 20
 %% Package options >>>
20 21
 \def\MRTsfacc@share{0.25}
21
-\newcommand\MRTsfaccSet[1]%>>>
22
+\MRTutil@def[\long]\MRTsfaccSet#1%>>>
22 23
   {%
23 24
     \MRTifFloatTF{#1}
24 25
       {\def\MRTsfacc@share{#1}}
@@ -50,7 +51,7 @@
50 51
   \AtBeginDocument% >>>
51 52
     {%
52 53
       \begingroup
53
-      \newcommand*\MRTsfacc@mathaccentV@test[5]% >>>
54
+      \MRTutil@def\MRTsfacc@mathaccentV@test#1#2#3#4#5% >>>
54 55
         {%
55 56
           \ifmmode
56 57
             \gdef\macc@tmp{\macc@depth\@ne}%
@@ -93,7 +94,7 @@
93 94
 \fi
94 95
 % <<<
95 96
 
96
-\newcommand\MRTsfacc@mathaccentV[4]% >>>
97
+\MRTutil@def[\long]\MRTsfacc@mathaccentV#1#2#3#4% >>>
97 98
   {%
98 99
     \global\let\macc@nucleus\@empty
99 100
     \mathaccent"\accentclass@#1#2#3{#4}\macc@nucleus
@@ -106,11 +107,11 @@
106 107
   {%
107 108
     \MRTifStringsMatchXXTF{\MRTsfacc@mathaccentV@detokenized}{#2 }
108 109
   }% <<<
109
-\newcommand\MRTsfacc@mathaccentV@using[1]% >>>
110
+\MRTutil@def[\long]\MRTsfacc@mathaccentV@using#1% >>>
110 111
   {%
111 112
     \expandafter\MRTsfacc@mathaccentV@using@inner\meaning#1 . .\endMRTsfacc@arg
112 113
   }% <<<
113
-\newcommand\MRTsfacc@testnest[2]% >>>
114
+\MRTutil@def[\long]\MRTsfacc@testnest#1#2% >>>
114 115
   {%
115 116
     \MRTifTwoTokenTF{#2}
116 117
       {%
@@ -132,7 +133,7 @@
132 133
       }
133 134
       {\@secondoftwo}%
134 135
   }% <<<
135
-\newcommand\MRTsfacc@testnest@[5]% >>>
136
+\MRTutil@def[\long]\MRTsfacc@testnest@#1#2#3#4#5% >>>
136 137
   {%
137 138
     \MRTsfacc@testknown{#5}
138 139
       {%
@@ -156,7 +157,7 @@
156 157
 %% stupid package for math font is stupid. Have to cure the sickness >>>
157 158
 \if@MRTsfacc@height@
158 159
 % true >>>
159
-  \newcommand*\MRTsfacc@patch@mathaccentV% >>>
160
+  \MRTutil@def\MRTsfacc@patch@mathaccentV% >>>
160 161
     {%
161 162
       \protected\long\def\mathaccentV##1##2##3##4% >>>
162 163
         {%
@@ -170,12 +171,12 @@
170 171
           {\futurelet\next\mathaccentV@a}%
171 172
         }% <<<
172 173
     }% <<<
173
-  \newcommand*\MRTsfacc@kern% >>>
174
+  \MRTutil@def\MRTsfacc@kern% >>>
174 175
     {%
175 176
       \MRTsfacc@share\ht\MRTsfacc@box
176 177
     }% <<<
177
-  \newbox\MRTsfacc@box
178
-  \newcommand*\mathaccentV@a[1]% >>>
178
+  \newsavebox\MRTsfacc@box
179
+  \MRTutil@def\mathaccentV@a#1% >>>
179 180
     {%
180 181
       \expandafter\ifx\next!%
181 182
         \MRTsfacc@fifiATa
@@ -190,7 +191,7 @@
190 191
       {\expandafter\mathaccentV@shifted\mathaccentV@args}
191 192
       {\expandafter\mathaccentV@b\mathaccentV@args{#1}}%
192 193
     }% <<<
193
-  \newcommand*\mathaccentV@b[4]% >>>
194
+  \MRTutil@def\mathaccentV@b#1#2#3#4% >>>
194 195
     {%
195 196
       \MRTifLetterGTF{#4}
196 197
         {\mathaccentV@shifted{#1}{#2}{#3}{#4}}
@@ -200,7 +201,7 @@
200 201
             {\MRTsfacc@mathaccentV{#1}{#2}{#3}{#4}}%
201 202
         }%
202 203
     }% <<<
203
-  \newcommand*\mathaccentV@shifted[4]% >>>
204
+  \MRTutil@def\mathaccentV@shifted#1#2#3#4% >>>
204 205
     {%
205 206
       \mathchoice
206 207
         {\mathaccentV@shifted@a{display}{#1}{#2}{#3}{#4}}
@@ -208,7 +209,7 @@
208 209
         {\mathaccentV@shifted@a{script}{#1}{#2}{#3}{#4}}
209 210
         {\mathaccentV@shifted@a{scriptscript}{#1}{#2}{#3}{#4}}%
210 211
     }% <<<
211
-  \newcommand*\mathaccentV@shifted@a[5]% >>>
212
+  \MRTutil@def\mathaccentV@shifted@a#1#2#3#4#5% >>>
212 213
     {%
213 214
       \setbox\MRTsfacc@box\hbox{$\csname #1style\endcsname#5$}%
214 215
       \MRTsfacc@mathaccentV{#2}{#3}{#4}%
@@ -220,7 +221,7 @@
220 221
     }% <<<
221 222
 \else% <<<
222 223
 % false >>>
223
-  \newcommand*\MRTsfacc@patch@mathaccentV% >>>
224
+  \MRTutil@def\MRTsfacc@patch@mathaccentV% >>>
224 225
     {%
225 226
       \protected\def\mathaccentV##1##2##3##4% >>>
226 227
         {%
@@ -237,23 +238,16 @@
237 238
           }%
238 239
         }% <<<
239 240
     }% <<<
240
-  \newcommand*\MRTsfacc@ifknown[1]% >>>
241
+  \MRTutil@def\MRTsfacc@ifknown#1%>>>
241 242
     {%
242
-      \begingroup
243
-      \expandafter\ifx\csname\MRTsfacc@shift{#1}\endcsname\relax
244
-        \endgroup
245
-        \MRTif@fiAb
246
-      \else
247
-        \endgroup
248
-        \MRTif@fiBa
249
-      \fi
250
-    }% <<<
251
-  \newcommand*\MRTsfacc@mathaccentV@shifted@expandhelper[5]% >>>
243
+      \@ifundefined{\MRTsfacc@shift{#1}}\@secondoftwo\@firstoftwo
244
+    }%<<<
245
+  \MRTutil@def\MRTsfacc@mathaccentV@shifted@expandhelper#1#2#3#4#5% >>>
252 246
     {%
253 247
       \mathaccentV@shifted{#2}{#3}{#4}
254 248
         {\csname\MRTsfacc@shift{#1}\endcsname}{#5}%
255 249
     }% <<<
256
-  \newcommand\mathaccentV@a[4]% >>>
250
+  \MRTutil@def[\long]\mathaccentV@a#1#2#3#4% >>>
257 251
     {%
258 252
       \MRTsfacc@ifknown{#4}
259 253
         {%
@@ -269,7 +263,7 @@
269 263
             {\MRTsfacc@mathaccentV{#1}{#2}{#3}{#4}}%
270 264
         }%
271 265
     }% <<<
272
-  \long\def\mathaccentV@b#1#2#3[#4]#5% >>>
266
+  \MRTutil@def[\long]\mathaccentV@b#1#2#3[#4]#5% >>>
273 267
     {%
274 268
       \MRTsfacc@ifknown{#4}
275 269
         {%
@@ -278,24 +272,26 @@
278 272
         }
279 273
         {\mathaccentV@shifted{#1}{#2}{#3}{#4}{#5}}%
280 274
     }% <<<
281
-  \newcommand\mathaccentV@shifted[5]% >>>
275
+  \MRTutil@def[\long]\mathaccentV@shifted#1#2#3#4#5% >>>
282 276
     {%
283 277
       \MRTsfacc@mathaccentV{#1}{#2}{#3}
284 278
         {%
285 279
           #5%
286 280
           \mkern#4\relax
281
+          \mkern#4\relax
287 282
         }
288 283
       \mkern-#4\relax
284
+      \mkern-#4\relax
289 285
     }% <<<
290
-  \newcommand*\MRTsfacc@shift[1]% >>>
286
+  \MRTutil@def\MRTsfacc@shift#1% >>>
291 287
     {%
292 288
       MRTsfacc@shift@\detokenize{#1}%
293 289
     }% <<<
294
-  \newcommand*\MRTsfaccShift[2]% >>>
290
+  \MRTutil@def\MRTsfaccShift#1#2% >>>
295 291
     {%
296 292
       \expandafter\def\csname \MRTsfacc@shift{#1}\endcsname{#2}%
297 293
     }% <<<
298
-  \newcommand*\MRTsfaccShiftLet[2]% >>>
294
+  \MRTutil@def\MRTsfaccShiftLet#1#2% >>>
299 295
     {%
300 296
       \MRTsfacc@ifknown{#2}
301 297
         {%
@@ -310,7 +306,7 @@
310 306
             }%
311 307
         }%
312 308
     }% <<<
313
-  \newcommand*\MRTsfaccLoadShiftList[1]% >>>
309
+  \MRTutil@def\MRTsfaccLoadShiftList#1% >>>
314 310
     {%
315 311
       \input{MRTsfacc.list.#1.tex}%
316 312
     }% <<<
@@ -318,6 +314,126 @@
318 314
 \fi
319 315
 % <<<
320 316
 
317
+% sfaccmacros >>>
318
+\MRTutil@def[\protected]\defsfaccmacro@a#1#2#3%>>>
319
+  {%
320
+    \MRTutil@oarg{\defsfaccmacro@b{#1}{#2}{#3}}%
321
+  }%<<<
322
+\MRTutil@def[\protected]\defsfaccmacro@b#1#2#3#4#5%>>>
323
+  {%
324
+    \MRTutil@oarg{\defsfaccmacro@c{#1}{#2}{#3}{#4}{#5}}%
325
+  }%<<<
326
+\MRTutil@def[\protected]\defsfaccmacro@c#1#2#3#4#5#6#7%>>>
327
+  {%
328
+    % #1 def type
329
+    % #2 mark/accent
330
+    % #3 horizontal displacement
331
+    % #4 vertical displacement
332
+    % #5 macro name
333
+    % #6 math atom type
334
+    % #7 accent/character
335
+    \MRTutil@ifmark{#2}
336
+      {\defsfaccmacro@d{#1}{#3}{#4}{#5}{#6}{#7}}
337
+      {\defsfaccmacro@d{#1}{#3}{#4}{#5}{#6}{#2}{#7}}%
338
+  }%<<<
339
+\MRTutil@def[\protected]\defsfaccmacro@d#1#2#3#4#5#6#7%>>>
340
+  {%
341
+    % #1 def
342
+    % #2 horizontal displacement
343
+    % #3 vertical displacement
344
+    % #4 macro name
345
+    % #5 math atom type
346
+    % #6 accent macro
347
+    % #7 character
348
+    #1#4%
349
+      {%
350
+        \MRTutil@ifmark{#5}{}{\unexpanded{#5}\bgroup}
351
+        \unexpanded
352
+          {%
353
+            \mathchoice
354
+              {\MRTsfacc@sfaccmacro{#2}{#3}{#6}{#7}\displaystyle}
355
+              {\MRTsfacc@sfaccmacro{#2}{#3}{#6}{#7}\textstyle}
356
+              {\MRTsfacc@sfaccmacro{#2}{#3}{#6}{#7}\scriptstyle}
357
+              {\MRTsfacc@sfaccmacro{#2}{#3}{#6}{#7}\scriptscriptstyle}%
358
+          }%
359
+        \unexpanded{\phantom{#7}}%
360
+        \MRTutil@ifmark{#5}{}{\egroup}%
361
+      }%
362
+  }%<<<
363
+\MRTutil@def[\protected]\MRTsfacc@sfaccmacro#1#2#3#4#5%>>>
364
+  {%
365
+    % #1 horizontal displacement
366
+    % #2 vertical displacement
367
+    % #3 accent macro
368
+    % #4 character
369
+    % #5 mathmode
370
+    \begingroup
371
+    \setbox\MRTsfacc@box\hbox{$#5#4$}%
372
+    \kern.5\wd\MRTsfacc@box
373
+    \MRTutil@ifmark{#1}
374
+      {\MRTsfacc@autokern{}{#4}}
375
+      {\mkern#1}%
376
+    \text%>>>
377
+      {%
378
+        \clap
379
+          {%
380
+            \smash
381
+              {%
382
+                \MRTutil@ifmark{#2}%
383
+                  {#3{}}%
384
+                  {\raise#2\hbox{#3{}}}%
385
+              }%
386
+          }%
387
+      }%<<<
388
+    \kern-.5\wd\MRTsfacc@box
389
+    \MRTutil@ifmark{#1}
390
+      {\MRTsfacc@autokern{-}{#4}}
391
+      {\mkern-#1}%
392
+    \mathrlap{\copy\MRTsfacc@box}%
393
+    \endgroup
394
+  }%<<<
395
+\MRTutil@def[\protected]\MRTsfacc@new@defsfaccmacro#1#2%>>>
396
+  {%
397
+    \MRTutil@def[\protected]#1%
398
+      {\MRTutil@darg<>{\defsfaccmacro@a{\protected\edef}{#2}}}%
399
+  }%<<<
400
+\MRTutil@def[\protected]\MRTsfacc@new@newsfaccmacro#1#2%>>>
401
+  {%
402
+    \MRTutil@def[\protected]#1%
403
+      {\MRTutil@darg<>{\defsfaccmacro@a{\MRTutil@edef[\protected]}{#2}}}%
404
+  }%<<<
405
+\MRTutil@def[\protected]\MRTsfacc@new@sfaccmacro@pair#1#2%>>>
406
+  {%
407
+    \expandafter\MRTsfacc@new@defsfaccmacro\csname defsf#1macro\endcsname{#2}%
408
+    \expandafter\MRTsfacc@new@newsfaccmacro\csname newsf#1macro\endcsname{#2}%
409
+  }%<<<
410
+\MRTsfacc@new@sfaccmacro@pair{acc}\MRTutil@@mark
411
+\MRTsfacc@new@sfaccmacro@pair{hat}\^
412
+\MRTsfacc@new@sfaccmacro@pair{check}\v
413
+\MRTsfacc@new@sfaccmacro@pair{tilde}\~
414
+\MRTsfacc@new@sfaccmacro@pair{acute}\'
415
+\MRTsfacc@new@sfaccmacro@pair{grave}\`
416
+\MRTsfacc@new@sfaccmacro@pair{dot}\.
417
+\MRTsfacc@new@sfaccmacro@pair{ddot}\"
418
+\MRTsfacc@new@sfaccmacro@pair{breve}\u
419
+\MRTsfacc@new@sfaccmacro@pair{bar}\=
420
+\if@MRTsfacc@height@%>>>
421
+  \MRTutil@def[\protected]\MRTsfacc@autokern#1#2%>>>
422
+    {%
423
+      \kern#1\MRTsfacc@kern
424
+    }%<<<
425
+%<<<
426
+\else%>>>
427
+  \newsavebox\MRTsfacc@box
428
+  \MRTutil@def[\protected]\MRTsfacc@autokern#1#2%>>>
429
+    {%
430
+      \MRTsfacc@ifknown{#2}
431
+        {\mkern#1\csname\MRTsfacc@shift{#2}\endcsname}
432
+        {}%
433
+    }%<<<
434
+\fi%<<<
435
+%<<<
436
+
321 437
 \AtBeginDocument{\MRTsfacc@patch@mathaccentV}
322 438
 
323 439
 

+ 20
- 16
MRTthesis/MRTthesis.cls View File

@@ -1,9 +1,9 @@
1
-\newcommand*\MRTthesis@version{0.0.6}
2
-\newcommand*\MRTthesis@date{2018-11-08}
1
+\newcommand*\MRTthesis@version{0.0.7}
2
+\newcommand*\MRTthesis@date{2019-01-30}
3 3
 
4 4
 \NeedsTeXFormat{LaTeX2e}
5 5
 
6
-\RequirePackage{expl3,xparse,MRTif} % absolutely necessary
6
+\RequirePackage{expl3,xparse,MRTif,MRTutil} % absolutely necessary
7 7
 \ProvidesExplClass
8 8
   {MRTthesis}          {\MRTthesis@date}
9 9
   {\MRTthesis@version} {thesis template for MRT - University of Bayreuth}
@@ -473,7 +473,7 @@
473 473
     \includegraphics[height=#1]{#2}
474 474
   }% <<<
475 475
 \cs_generate_variant:Nn \MRTthesis_display_logo_expanded:nn { xx }
476
-\newcommand*\MRTthesis@fntsel[2]{\fontsize{#1bp}{#2bp}\selectfont}
476
+\MRTutil@def\MRTthesis@fntsel#1#2{\fontsize{#1bp}{#2bp}\selectfont}
477 477
 % <<<
478 478
 % \MRTafterhyperref >>>
479 479
 \NewDocumentCommand \MRTafterhyperref { +m }% >>>
@@ -481,7 +481,7 @@
481 481
     \xdef \MRTthesis@after@hyperref 
482 482
       { \unexpanded \expandafter { \MRTthesis@after@hyperref #1 } }
483 483
   }% <<<
484
-\newcommand*\MRTthesis@after@hyperref{}
484
+\MRTutil@def\MRTthesis@after@hyperref{}
485 485
 \MRTafterhyperref% redefine itself after hyperref to throw an error >>>
486 486
   {
487 487
     \cs_set:Npn \MRTafterhyperref #1
@@ -541,7 +541,7 @@
541 541
 \renewcommand*\theequation{\hbox{(\thechapter-\arabic{equation})}}
542 542
 \renewcommand*\thefigure  {\hbox{\thechapter-\arabic{figure}}}
543 543
 \renewcommand*\thetable   {\hbox{\thechapter-\arabic{table}}}
544
-\newcommand*\MRTthesis@setautorefnames% >>>
544
+\MRTutil@def\MRTthesis@setautorefnames% >>>
545 545
   {%
546 546
     \addto\extrasngerman
547 547
       {%
@@ -644,7 +644,7 @@
644 644
     \endgroup
645 645
   }
646 646
 % <<<
647
-\newcommand\MRTthesis@headingsformat[3]%>>>
647
+\MRTutil@def[\long]\MRTthesis@headingsformat#1#2#3%>>>
648 648
   {
649 649
     \begingroup
650 650
     \setbox \MRTthesis@TestBoxA \hbox
@@ -681,7 +681,7 @@
681 681
 % <<<
682 682
 % Sectionformat >>>
683 683
 % I don't know why this works, but it seems working.
684
-\newcommand*\Sectionformat[2]{\MRTthesis@HeadingsUline{#1}}
684
+\MRTutil@def\Sectionformat#1#2{\MRTthesis@HeadingsUline{#1}}
685 685
 % <<<
686 686
 %%==========================================================================<<<
687 687
 
@@ -837,15 +837,15 @@
837 837
     \setuptoc{\@currext}{totoc}%
838 838
   }% <<<
839 839
 %\DeclareTOCStyleEntry[<options>]{<style>}{<section-layer>}
840
-\newcommand*\MRTthesis@chapter@dotfill% >>>
840
+\MRTutil@def\MRTthesis@chapter@dotfill% >>>
841 841
   {%
842 842
     \def\@dotsep{0.072}\TOCLineLeaderFill[\textbf{.}]%
843 843
   }% <<<
844
-\newcommand*\MRTthesis@section@dotfill% >>>
844
+\MRTutil@def\MRTthesis@section@dotfill% >>>
845 845
   {%
846 846
     \def\@dotsep{0.072}\TOCLineLeaderFill
847 847
   }% <<<
848
-\newcommand*\MRTthesis@toc@default@all% >>>
848
+\MRTutil@def\MRTthesis@toc@default@all% >>>
849 849
   {%
850 850
     pagenumberbox=\makebox%
851 851
     ,dynnumwidth=true%
@@ -877,7 +877,7 @@
877 877
 %% affidavit >>>
878 878
 %%=============================================================================
879 879
 \ExplSyntaxOff%>>>
880
-\newcommand*\affidavittext@base% >>>
880
+\MRTutil@def\affidavittext@base% >>>
881 881
   {%
882 882
     Hiermit versichere ich an Eides statt, dass ich die vorliegende Arbeit
883 883
     selbst\"andig und unter Angabe aller Hilfsmittel und Referenzen angefertigt
@@ -885,7 +885,7 @@
885 885
     Arbeit, die st\"andig eingeflossen sind und daher nicht im Einzelnen
886 886
     nachgewiesen werden.%
887 887
   }% <<<
888
-\newcommand*\affidavittext@usagerights% >>>
888
+\MRTutil@def\affidavittext@usagerights% >>>
889 889
   {%
890 890
     Der Universit\"at Bayreuth, vertreten durch den Lehrstuhl f\"ur Mess- und
891 891
     Regeltechnik (Prof. Dr.-Ing. Fischerauer), habe ich das Nutzungs- und
@@ -897,20 +897,24 @@
897 897
     einverstanden. Ich erkl\"are ferner, dass ich die Inhalte der Arbeit
898 898
     meinerseits nicht ohne Zustimmung des Lehrstuhls publizieren werde.%
899 899
   }% <<<
900
-\newcommand*\affidavittext@degree% >>>
900
+\MRTutil@def\affidavittext@degree% >>>
901 901
   {%
902 902
     Hiermit erkl\"are ich, dass ich die vorliegende Arbeit mit dem Thema
903 903
     „\csname l_MRTthesis_title_tl\endcsname“ noch nicht anderweitig zur
904 904
     Erlangung eines akademischen Grades eingereicht habe.%
905 905
   }% <<<
906 906
 \ExplSyntaxOn%<<<
907
-\NewExpandableDocumentCommand \affidavittext {}% >>>
907
+\MRTutil@def\affidavittext% >>>
908 908
   {
909 909
     \affidavittext@base
910 910
     \bool_if:NF \l_MRTthesis_no_usage_bool { \par \affidavittext@usagerights }
911 911
     \bool_if:NF \l_MRTthesis_no_degree_bool { \par \affidavittext@degree }
912 912
   }% <<<
913
-\NewDocumentCommand \affidavit {}% >>>
913
+\MRTutil@def\affidavittitle%>>>
914
+  {
915
+    Eidesstattliche~Erkl\"arung
916
+  }%<<<
917
+\MRTutil@def[\protected]\affidavit% >>>
914 918
   {
915 919
     \cleardoublepage
916 920
     \chapter*{Eidesstattliche~Erkl\"arung}

+ 69
- 0
MRTutil/MRTutil.sty View File

@@ -0,0 +1,69 @@
1
+\newcommand*\MRTutil@version{0.0.1}
2
+\newcommand*\MRTutil@date{2019-01-30}
3
+
4
+\NeedsTeXFormat{LaTeX2e}
5
+
6
+\ProvidesPackage{MRTutil}
7
+  [%
8
+    \MRTutil@date\space v\MRTutil@version\space provides some utility macros for
9
+    the MRTbundle%
10
+  ]
11
+
12
+%% def macros >>>
13
+\@ifdefinable\MRTutil@def@%>>>
14
+  {%
15
+    \protected\def\MRTutil@def@#1%
16
+      {\@ifnextchar[{\MRTutil@def@a#1}{\MRTutil@def@a#1[]}}%
17
+  }%<<<
18
+\@ifdefinable\MRTutil@def@a%>>>
19
+  {%
20
+    \long\def\MRTutil@def@a#1[#2]#3#4#{\MRTutil@def@b#1{#2}#3{#4}}%
21
+  }%<<<
22
+\@ifdefinable\MRTutil@def@b%>>>
23
+  {%
24
+    \protected\long\def\MRTutil@def@b#1#2#3#4#5{#2#1#3#4{#5}}%
25
+  }%<<<
26
+\@ifdefinable\MRTutil@def%>>>
27
+  {%
28
+    \protected\def\MRTutil@def{\MRTutil@def@\def}
29
+  }%<<<
30
+\MRTutil@def[\protected]\MRTutil@edef%>>>
31
+  {%
32
+    \MRTutil@def@\edef
33
+  }%<<<
34
+% <<<
35
+
36
+%% opt arg parsing >>>
37
+\MRTutil@def\MRTutil@@mark{\MRTutil@@mark}
38
+\MRTutil@def[\long]\MRTutil@ifmark#1%>>>
39
+  {%
40
+    \ifx\MRTutil@@mark#1%
41
+      \MRTif@fiAa
42
+    \else
43
+      \MRTif@fiBb
44
+    \fi
45
+  }%<<<
46
+\MRTutil@def[\protected\long]\MRTutil@Oarg#1#2%>>>
47
+  {%
48
+    \@ifnextchar[{\MRTutil@Oarg@{#2}}{\MRTutil@Oarg@{#2}[{#1}]}%
49
+  }%<<<
50
+\MRTutil@def[\long]\MRTutil@Oarg@#1[#2]%>>>
51
+  {%
52
+    #1{#2}%
53
+  }%<<<
54
+\MRTutil@def[\protected]\MRTutil@oarg%>>>
55
+  {%
56
+    \MRTutil@Oarg\MRTutil@@mark
57
+  }%<<<
58
+\MRTutil@def[\protected\long]\MRTutil@Darg#1#2#3#4%>>>
59
+  {%
60
+    \long\def\MRTutil@Darg@##1#1##2#2{##1{##2}}%
61
+    \@ifnextchar#1{\MRTutil@Darg@{#4}}{\MRTutil@Darg@{#4}#1{#3}#2}%
62
+  }%<<<
63
+\MRTutil@def[\protected\long]\MRTutil@darg#1#2%>>>
64
+  {%
65
+    \MRTutil@Darg#1#2\MRTutil@@mark
66
+  }%<<<
67
+% <<<
68
+
69
+\endinput

+ 10
- 10
MRTwuline/MRTwuline.sty View File

@@ -1,9 +1,9 @@
1
-\newcommand*\MRTwuline@version{0.0.1}
2
-\newcommand*\MRTwuline@date{2018-06-01}
1
+\newcommand*\MRTwuline@version{0.0.2}
2
+\newcommand*\MRTwuline@date{2019-01-30}
3 3
 
4 4
 \NeedsTeXFormat{LaTeX2e}
5 5
 
6
-\RequirePackage{expl3,xparse,stackengine,scalerel,MRTif}
6
+\RequirePackage{expl3,xparse,stackengine,scalerel,MRTif,MRTutil}
7 7
 \PassOptionsToPackage{normalem}{ulem}
8 8
 \RequirePackage{ulem}
9 9
 \ProvidesExplPackage
@@ -52,8 +52,8 @@
52 52
       { \markoverwith { \rule [ #1 ] { 0.25ex } { 0.185ex } } }
53 53
     \ULon{#2}
54 54
   }
55
-\newcommand*\MRTwuline@mathheight{0.21ex}%
56
-\newcommand*\MRTwuline@textheight{-0.42ex}%
55
+\MRTutil@def\MRTwuline@mathheight{0.21ex}%
56
+\MRTutil@def\MRTwuline@textheight{-0.42ex}%
57 57
 % <<<
58 58
 
59 59
 % \tUline >>>
@@ -62,10 +62,10 @@
62 62
   \RequirePackage{tikz}
63 63
   \usetikzlibrary{calc}
64 64
   \RequirePackage{tikzpagenodes}
65
-  \newcommand*\MRTwuline@tUline@width{0.185ex}
65
+  \MRTutil@def\MRTwuline@tUline@width{0.185ex}
66 66
   \newlength\MRTwuline@tUline@length
67 67
   \newcount\MRTwuline@tUline@count
68
-  \newcommand*\MRTwuline@gettikzxy[3]% >>>
68
+  \MRTutil@def\MRTwuline@gettikzxy#1#2#3% >>>
69 69
     % https://tex.stackexchange.com/a/58590/121799
70 70
     {%
71 71
       \tikz@scan@one@point\pgfutil@firstofone#1\relax
@@ -73,7 +73,7 @@
73 73
       \xdef#3{\the\pgf@y}%
74 74
     }% <<<
75 75
   \tikzset{MRTwuline@tUline/.style={line width=\MRTwuline@tUline@width}}
76
-  \newcommand*\MRTwuline@EmptyOProcessor[2]% >>>
76
+  \MRTutil@def\MRTwuline@EmptyOProcessor#1#2% >>>
77 77
     {%
78 78
       \MRTifEmptyTF{#2}%
79 79
         {\def\ProcessedArgument{#1}}%
@@ -124,7 +124,7 @@
124 124
         \fi
125 125
       \end{tikzpicture}%
126 126
     }% <<<
127
-  \newcommand*\tUline@drawMultipleLines[2]% >>>
127
+  \MRTutil@def\tUline@drawMultipleLines#1#2% >>>
128 128
     {%
129 129
       \MRTwuline@tUline@length=#2
130 130
       \MRTwuline@tUline@count=1
@@ -141,7 +141,7 @@
141 141
       \advance\MRTwuline@tUline@count by 1
142 142
       \repeat
143 143
     }% <<<
144
-  \newcommand*\tUline@drawBtoE[1]% >>>
144
+  \MRTutil@def\tUline@drawBtoE#1% >>>
145 145
     {%
146 146
       \draw[MRTwuline@tUline]
147 147
         ($(Begin.base)+(0,#1)$) -- ($(Begin.base -| EastLine)+(0,#1)$)

Loading…
Cancel
Save