You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

doc_macros.tex 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. \makeatletter
  2. \newcommand*\pkg[1]{\textrm{#1}}
  3. \newcommand*\pkgWopt[2]{\opt{[#2]}\penalty500\pkg{#1}}
  4. \newcommand*\cls[1]{\textrm{#1}}
  5. \newcommand*\TikZ{\pkg{Ti\textit{k}Z}}
  6. \newcommand*\env[1]{\texttt{#1}}
  7. \newcommand*\opt[1]{\texttt{#1}}
  8. \newcommand*\file[1]{\texttt{\detokenize{#1}}}
  9. \long\def\eatspace#1 #2{#1#2}
  10. \newcommand*\cs{\texorpdfstring{\cs@TeXString}{\cs@PDFString}}
  11. \protected\def\cs@TeXString#1%>>>
  12. {%
  13. \texttt{\expandafter\eatspace\string\ \detokenize{#1}}%
  14. }%<<<
  15. \def\cs@PDFString#1{(macro #1)}
  16. \protected\def\meta#1{\texttt{$\langle$\textit{\meta@a{#1}}$\rangle$}}
  17. \ExplSyntaxOn
  18. \newcommand\meta@a[1]%>>>
  19. {
  20. \group_begin:
  21. \tl_set:Nn \l_docMRTbundle_tmp_tl { #1 }
  22. \regex_replace_once:nnN { \d+$ } { \c{textsubscript} \cB{ \0 \cE} }
  23. \l_docMRTbundle_tmp_tl
  24. \l_docMRTbundle_tmp_tl
  25. \group_end:
  26. }%<<<
  27. \ExplSyntaxOff
  28. \newcommand*\metaEnclosed[3]{\texttt{#1}\meta{#2}\texttt{#3}}
  29. \newcommand*\marg[1]{\metaEnclosed\{{#1}\}}
  30. \newcommand*\oarg[1]{\metaEnclosed[{#1}]}
  31. \newcommand*\barg[1]{\metaEnclosed({#1})}
  32. \newcommand*\sarg[1]{\metaEnclosed<{#1}>}
  33. \newcommand*\carg[2]{\texttt{(}\meta{#1},\meta{#2}\texttt{)}}
  34. \newcommand*\tfarg{\texttt{\textit{TF}}}
  35. \newcommand*\luaxetex%>>>
  36. {%
  37. \luaxe{}%
  38. }%<<<
  39. \newcommand*\luaxelatex%>>>
  40. {%
  41. \luaxe{La}%
  42. }%<<<
  43. \newcommand*\luaxe[1]%>>>
  44. {%
  45. \@ifstar
  46. {\hologo{Lua#1TeX} and \hologo{Xe#1TeX}}
  47. {\hologo{Lua#1TeX} or \hologo{Xe#1TeX}}%
  48. }%<<<
  49. \ExplSyntaxOn
  50. \int_new:N \g_docMRTbundle_dsctable_lines_int
  51. \int_new:N \l_docMRTbundle_fakeit_level_int
  52. \int_set:Nn \l_docMRTbundle_fakeit_level_int { -\c_one }
  53. \dim_new:N \l_docMRTbundle_dscmac_widest_dim
  54. \dim_new:N \l_docMRTbundle_dscmac_indent_dim
  55. \dim_new:N \l_docMRTbundle_fakeit_indent_dim
  56. \tl_new:N \l_docMRTbundle_tmp_tl
  57. \clist_new:N \l_docMRTbundle_fakeit_symbols_clist
  58. \clist_set:Nn \l_docMRTbundle_fakeit_symbols_clist% >>>
  59. {
  60. \textbullet
  61. ,\normalfont\bfseries\textendash
  62. ,\textasteriskcentered
  63. ,\textperiodcentered
  64. }% <<<
  65. \clist_new:N \l_docMRTbundle_bverb_both_points_clist
  66. \clist_new:N \l_docMRTbundle_bverb_pre_points_clist
  67. \clist_new:N \l_docMRTbundle_bverb_post_points_clist
  68. \clist_set:Nx \l_docMRTbundle_bverb_both_points_clist%>>>
  69. {
  70. =
  71. }%<<<
  72. \clist_set:Nx \l_docMRTbundle_bverb_pre_points_clist%>>>
  73. {
  74. [
  75. ,(
  76. ,\char_generate:nn { `\{ } { 12 }
  77. ,\char_generate:nn { `\\ } { 12 }
  78. }%<<<
  79. \clist_set:Nx \l_docMRTbundle_bverb_post_points_clist%>>>
  80. {
  81. \char_generate:nn { `\} } { 12 }
  82. ,)
  83. ,]
  84. }%<<<
  85. \cs_new:Nn \__docMRTbundle_dscmac_end:%>>>
  86. {
  87. \par
  88. \int_compare:nNnT { \prevgraf } < { \g_docMRTbundle_dsctable_lines_int }
  89. {
  90. \expandafter\dscremaininglines\expandafter
  91. {
  92. \expandafter \numexpr
  93. \int_use:N \g_docMRTbundle_dsctable_lines_int - \prevgraf
  94. \relax
  95. }
  96. }
  97. }%<<<
  98. \MRTafterhyperref%>>>
  99. {
  100. \hbox_set:Nn \l_tmpa_box { \cs{PrependSubsectionsfalse} }
  101. \dim_set:Nn \l_docMRTbundle_dscmac_widest_dim { \box_wd:N \l_tmpa_box }
  102. \dim_set:Nn \l_docMRTbundle_dscmac_indent_dim
  103. { \l_docMRTbundle_dscmac_widest_dim - \marginparwidth }
  104. }%<<<
  105. \cs_new:Nn \docMRTbundle_dscmacTF_table_element:n% >>>
  106. {
  107. \exp_args:Nx \cs{\l_docMRTbundle_macro_name_tl #1}\tfarg\\
  108. }% <<<
  109. \cs_new_protected:Nn \docMRTbundle_dscmacTF_widest:n% >>>
  110. {
  111. \hbox_set:Nn \l_tmpa_box
  112. { \exp_args:Nx \cs{\l_docMRTbundle_macro_name_tl #1}\tfarg }
  113. \dim_compare:nNnT
  114. \l_docMRTbundle_dscmac_widest_dim < { \box_wd:N \l_tmpa_box }
  115. {
  116. \dim_set:Nn \l_docMRTbundle_dscmac_widest_dim
  117. { \box_wd:N \l_tmpa_box }
  118. }
  119. }% <<<
  120. \NewDocumentEnvironment { describemacroTF } { o m O{} }% >>>
  121. {
  122. \par\noindent
  123. \int_gzero:N \g_docMRTbundle_dsctable_lines_int
  124. \hspace*{-\dimexpr\marginparwidth+\marginparsep\relax}
  125. \IfNoValueTF { #1 }
  126. { \seq_set_split:Nnn \l_tmpa_seq { , } { } }
  127. { \seq_set_split:Nnn \l_tmpa_seq { , } { ,#1 } }
  128. \tl_set:Nn \l_docMRTbundle_macro_name_tl { #2 }
  129. \seq_map_function:NN \l_tmpa_seq \docMRTbundle_dscmacTF_widest:n
  130. \begin{minipage}[t][0pt]{\l_docMRTbundle_dscmac_widest_dim}
  131. \raggedleft
  132. \noindent
  133. \begin{tabular}[t]{@{}l@{}}
  134. \toprule
  135. \seq_map_function:NN \l_tmpa_seq \docMRTbundle_dscmacTF_table_element:n
  136. \bottomrule
  137. \end{tabular}
  138. \end{minipage}
  139. \hspace*{\marginparsep}
  140. \begin{minipage}[t]
  141. {
  142. \dimexpr
  143. \textwidth + \marginparwidth - \l_docMRTbundle_dscmac_widest_dim
  144. \relax
  145. }
  146. \vspace*{.5\baselineskip}
  147. \raggedright
  148. \setbox0\hbox{\texttt{\space\space}}
  149. \@hangfrom{Usage:~\hskip\wd0}\hskip-\wd0
  150. \cs{#2}\tfarg\hskip0pt\texttt{#3}\hskip0pt\marg{true}\hskip0pt\marg{false}
  151. \vspace*{.5\baselineskip}
  152. \end{minipage}\\
  153. \hangindent \l_docMRTbundle_dscmac_indent_dim
  154. \noindent
  155. \ignorespaces
  156. }
  157. {\__docMRTbundle_dscmac_end:}% <<<
  158. \cs_new:Nn \docMRTbundle_dscmac_table_element:n% >>>
  159. {
  160. \int_gincr:N \g_docMRTbundle_dsctable_lines_int
  161. \exp_args:Nx \cs{\l_docMRTbundle_macro_name_tl #1}\\
  162. }% <<<
  163. \cs_new:Nn \docMRTbunndle_dscmac_multiple_mac:n% >>>
  164. {
  165. \int_gincr:N \g_docMRTbundle_dsctable_lines_int
  166. \cs { #1 } \\
  167. }% <<<
  168. \cs_new_protected:Nn \docMRTbundle_dscmac_widest:n% >>>
  169. {
  170. \hbox_set:Nn \l_tmpa_box
  171. { \exp_args:Nx \cs{\l_docMRTbundle_macro_name_tl #1} }
  172. \dim_compare:nNnT
  173. \l_docMRTbundle_dscmac_widest_dim < { \box_wd:N \l_tmpa_box }
  174. {
  175. \dim_set:Nn \l_docMRTbundle_dscmac_widest_dim
  176. { \box_wd:N \l_tmpa_box }
  177. }
  178. }% <<<
  179. \NewDocumentEnvironment { describemacro } { o m O{} }% >>>
  180. {
  181. \par\noindent
  182. \int_gzero:N \g_docMRTbundle_dsctable_lines_int
  183. \hspace*{-\dimexpr\marginparwidth+\marginparsep\relax}
  184. \IfNoValueTF { #1 }
  185. { \seq_set_split:Nnn \l_tmpa_seq { , } { } }
  186. { \seq_set_split:Nnn \l_tmpa_seq { , } { ,#1 } }
  187. \tl_if_in:nnTF { #2 } { , }
  188. {
  189. \seq_set_split:Nnn \l_tmpb_seq { , } { #2 }
  190. \tl_clear:N \l_docMRTbundle_macro_name_tl
  191. \seq_map_function:NN \l_tmpb_seq \docMRTbundle_dscmac_widest:n
  192. \tl_set:Nn \l_docMRTbundle_macro_name_tl { \seq_item:Nn \l_tmpb_seq 1 }
  193. }
  194. {
  195. \tl_set:Nn \l_docMRTbundle_macro_name_tl { #2 }
  196. \seq_map_function:NN \l_tmpa_seq \docMRTbundle_dscmac_widest:n
  197. }
  198. \begin{minipage}[t][0pt]{\l_docMRTbundle_dscmac_widest_dim}
  199. \raggedleft
  200. \noindent
  201. \begin{tabular}[t]{@{}l@{}}
  202. \toprule
  203. \tl_if_in:nnTF { #2 } { , }
  204. {
  205. \seq_map_function:NN\l_tmpb_seq \docMRTbunndle_dscmac_multiple_mac:n
  206. }
  207. {
  208. \seq_map_function:NN\l_tmpa_seq \docMRTbundle_dscmac_table_element:n
  209. }
  210. \bottomrule
  211. \end{tabular}
  212. \vspace*{-.5\baselineskip}
  213. \end{minipage}
  214. \hspace*{\marginparsep}
  215. \begin{minipage}[t]
  216. {
  217. \dimexpr
  218. \textwidth + \marginparwidth - \l_docMRTbundle_dscmac_widest_dim
  219. \relax
  220. }
  221. \vspace*{.5\baselineskip}
  222. \raggedright
  223. \setbox0\hbox{\texttt{\space\space}}
  224. \@hangfrom{Usage:~\hskip\wd0}\hskip-\wd0
  225. \exp_args:Nx \cs{\l_docMRTbundle_macro_name_tl}\hskip0pt\texttt{#3}
  226. \vspace*{.5\baselineskip}
  227. \end{minipage}\\
  228. \hangindent \l_docMRTbundle_dscmac_indent_dim
  229. \noindent
  230. \ignorespaces
  231. }
  232. {\__docMRTbundle_dscmac_end:}% <<<
  233. \cs_new:Nn \docMRTbundle_dscenv_table_element:n% >>>
  234. {
  235. \int_gincr:N \g_docMRTbundle_dsctable_lines_int
  236. \exp_args:Nx \env{\l_docMRTbundle_macro_name_tl #1}\\
  237. }% <<<
  238. \cs_new_protected:Nn \docMRTbundle_dscenv_widest:n% >>>
  239. {
  240. \hbox_set:Nn \l_tmpa_box
  241. { \exp_args:Nx \env{\l_docMRTbundle_macro_name_tl #1} }
  242. \dim_compare:nNnT
  243. \l_docMRTbundle_dscmac_widest_dim < { \box_wd:N \l_tmpa_box }
  244. {
  245. \dim_set:Nn \l_docMRTbundle_dscmac_widest_dim
  246. { \box_wd:N \l_tmpa_box }
  247. }
  248. }% <<<
  249. \NewDocumentEnvironment { describeenv } { o m O{} }% >>>
  250. {
  251. \par\noindent
  252. \int_gzero:N \g_docMRTbundle_dsctable_lines_int
  253. \hspace*{-\dimexpr\marginparwidth+\marginparsep\relax}
  254. \IfNoValueTF { #1 }
  255. { \seq_set_split:Nnn \l_tmpa_seq { , } { } }
  256. { \seq_set_split:Nnn \l_tmpa_seq { , } { ,#1 } }
  257. \tl_set:Nn \l_docMRTbundle_macro_name_tl { #2 }
  258. \seq_map_function:NN \l_tmpa_seq \docMRTbundle_dscenv_widest:n
  259. \begin{minipage}[t][0pt]{\l_docMRTbundle_dscmac_widest_dim}
  260. \raggedleft
  261. \noindent
  262. \begin{tabular}[t]{@{}l@{}}
  263. \toprule
  264. \seq_map_function:NN \l_tmpa_seq \docMRTbundle_dscenv_table_element:n
  265. \bottomrule
  266. \end{tabular}
  267. \vspace*{-.5\baselineskip}
  268. \end{minipage}
  269. \hspace*{\marginparsep}
  270. \begin{minipage}[t]
  271. {
  272. \dimexpr
  273. \textwidth + \marginparwidth - \l_docMRTbundle_dscmac_widest_dim
  274. \relax
  275. }
  276. \vspace*{.5\baselineskip}
  277. \raggedright
  278. \setbox0\hbox{\texttt{\space\space}}
  279. \@hangfrom{Usage:~\hskip\wd0}\hskip-\wd0
  280. \cs{begin{#2}}\hskip0pt\texttt{#3~...~}\hskip0pt\cs{end{#2}}
  281. \vspace*{.5\baselineskip}
  282. \end{minipage}\\
  283. \hangindent \l_docMRTbundle_dscmac_indent_dim
  284. \noindent
  285. \ignorespaces
  286. }
  287. {\__docMRTbundle_dscmac_end:}% <<<
  288. \cs_new:Nn \docMRTbundle_dscopt_table_element:n% >>>
  289. {
  290. \int_gincr:N \g_docMRTbundle_dsctable_lines_int
  291. \exp_args:Nx \opt{\l_docMRTbundle_macro_name_tl #1}\\
  292. }% <<<
  293. \cs_new:Nn \docMRTbunndle_dscopt_multiple_mac:n% >>>
  294. {
  295. \int_gincr:N \g_docMRTbundle_dsctable_lines_int
  296. \opt { #1 } \\
  297. }% <<<
  298. \cs_new_protected:Nn \docMRTbundle_dscopt_widest:n% >>>
  299. {
  300. \hbox_set:Nn \l_tmpa_box
  301. { \exp_args:Nx \opt{\l_docMRTbundle_macro_name_tl #1} }
  302. \dim_compare:nNnT
  303. \l_docMRTbundle_dscmac_widest_dim < { \box_wd:N \l_tmpa_box }
  304. {
  305. \dim_set:Nn \l_docMRTbundle_dscmac_widest_dim
  306. { \box_wd:N \l_tmpa_box }
  307. }
  308. }% <<<
  309. \NewDocumentEnvironment { describeopt } { o m o }%>>>
  310. {
  311. \par\noindent
  312. \int_gzero:N \g_docMRTbundle_dsctable_lines_int
  313. \hspace*{-\dimexpr\marginparwidth+\marginparsep\relax}
  314. \IfNoValueTF { #1 }
  315. { \seq_set_split:Nnn \l_tmpa_seq { , } { } }
  316. { \seq_set_split:Nnn \l_tmpa_seq { , } { ,#1 } }
  317. \tl_if_in:nnTF { #2 } { , }
  318. {
  319. \seq_set_split:Nnn \l_tmpb_seq { , } { #2 }
  320. \tl_clear:N \l_docMRTbundle_macro_name_tl
  321. \seq_map_function:NN \l_tmpb_seq \docMRTbundle_dscopt_widest:n
  322. \tl_set:Nn \l_docMRTbundle_macro_name_tl { \seq_item:Nn \l_tmpb_seq 1 }
  323. }
  324. {
  325. \tl_set:Nn \l_docMRTbundle_macro_name_tl { #2 }
  326. \seq_map_function:NN \l_tmpa_seq \docMRTbundle_dscopt_widest:n
  327. }
  328. \begin{minipage}[t][0pt]{\l_docMRTbundle_dscmac_widest_dim}
  329. \raggedleft
  330. \noindent
  331. \begin{tabular}[t]{@{}l@{}}
  332. \toprule
  333. \tl_if_in:nnTF { #2 } { , }
  334. {
  335. \seq_map_function:NN\l_tmpb_seq \docMRTbunndle_dscopt_multiple_mac:n
  336. }
  337. {
  338. \seq_map_function:NN\l_tmpa_seq \docMRTbundle_dscopt_table_element:n
  339. }
  340. \bottomrule
  341. \end{tabular}
  342. \end{minipage}
  343. \hspace*{\marginparsep}
  344. \begin{minipage}[t]
  345. {
  346. \dimexpr
  347. \textwidth + \marginparwidth - \l_docMRTbundle_dscmac_widest_dim
  348. \relax
  349. }
  350. \vspace*{1\baselineskip}
  351. \raggedright
  352. \setbox0\hbox{\texttt{\space\space}}
  353. \@hangfrom{\hskip\wd0}\hskip-\wd0
  354. { \smash { \IfValueTF { #3 } { =~ \texttt{#3} } { --NoArgument-- } } }
  355. \vspace*{.5\baselineskip}
  356. \end{minipage}\\
  357. \hangindent \l_docMRTbundle_dscmac_indent_dim
  358. \noindent
  359. \ignorespaces
  360. }
  361. {
  362. \__docMRTbundle_dscmac_end:
  363. }% <<<
  364. \NewDocumentCommand \dscremaininglines { m }%>>>
  365. {
  366. \vskip
  367. \dimexpr
  368. #1\baselineskip - 1.5\baselineskip + 1.2ex
  369. \relax
  370. }%<<<
  371. \NewDocumentCommand \docIndividualVersions {}%>>>
  372. {
  373. \makeatletter
  374. % If one of the packages is not loaded, the version and date of it are not
  375. % defined. So we have to read the first two lines containing those
  376. % definitions.
  377. \ior_new:N \l_docMRTbundle_unloaded_ior
  378. \clist_map_inline:nn { MRTbeam.cls, MRTalone.cls }
  379. {
  380. \ior_open:Nn \l_docMRTbundle_unloaded_ior { ##1 }
  381. \ior_get:NN \l_docMRTbundle_unloaded_ior \l_tmpa_tl
  382. \exp_args:NnV \tl_rescan:nn {} \l_tmpa_tl
  383. \ior_get:NN \l_docMRTbundle_unloaded_ior \l_tmpa_tl
  384. \exp_args:NnV \tl_rescan:nn {} \l_tmpa_tl
  385. \ior_close:N \l_docMRTbundle_unloaded_ior
  386. }
  387. \makeatother
  388. \begin{MRTtable}
  389. [
  390. ,col=llc
  391. ,float=false
  392. ,caption={Versions~of~Individual~Packages}
  393. ,pre=
  394. \def\versionline##1%
  395. {
  396. \pkg{MRT##1} & \csuse{MRT##1@date} & \csuse{MRT##1@version}\\
  397. }
  398. ]
  399. Package & Date & Version\\
  400. \versionline{thesis}
  401. \versionline{beam}
  402. \versionline{alone}
  403. \versionline{tab}
  404. \versionline{if}
  405. \versionline{wuline}
  406. \versionline{sfacc}
  407. \end{MRTtable}
  408. }%<<<
  409. \NewDocumentCommand \bverb { v }%>>>
  410. {
  411. \group_begin:
  412. \tl_set:Nn \l_docMRTbundle_tmp_tl { #1 }
  413. \clist_map_inline:Nn \l_docMRTbundle_bverb_pre_points_clist
  414. { \tl_replace_all:Nnn \l_docMRTbundle_tmp_tl { ##1 } { \hskip0pt ##1 } }
  415. \clist_map_inline:Nn \l_docMRTbundle_bverb_post_points_clist
  416. { \tl_replace_all:Nnn \l_docMRTbundle_tmp_tl { ##1 } { ##1 \hskip0pt } }
  417. \clist_map_inline:Nn \l_docMRTbundle_bverb_both_points_clist
  418. {
  419. \tl_replace_all:Nnn \l_docMRTbundle_tmp_tl
  420. { ##1 } { \hskip0pt ##1 \hskip0pt }
  421. }
  422. \verbatim@font
  423. \@noligs
  424. \frenchspacing
  425. \l_docMRTbundle_tmp_tl
  426. \group_end:
  427. }%<<<
  428. \NewDocumentEnvironment { fakeitemize } {}%>>>
  429. {% begin >>>
  430. \dim_set:Nn \l_docMRTbundle_fakeit_indent_dim { 2em }
  431. \int_incr:N \l_docMRTbundle_fakeit_level_int
  432. \int_compare:nNnT { \l_docMRTbundle_fakeit_level_int } = { \c_zero }
  433. { \null\\[\dimexpr.9ex-\baselineskip\relax] }
  434. \cs_set_protected:Npn \item
  435. {
  436. \null\\[.1ex]
  437. \null
  438. \hskip\l_docMRTbundle_fakeit_level_int\l_docMRTbundle_fakeit_indent_dim
  439. \makebox[2em][c]
  440. {
  441. \clist_item:Nn \l_docMRTbundle_fakeit_symbols_clist
  442. { \l_docMRTbundle_fakeit_level_int + \c_one }
  443. }
  444. }
  445. }%<<<
  446. {% end >>>
  447. \int_compare:nNnTF { \l_docMRTbundle_fakeit_level_int } = { \c_zero }
  448. { \null\\[1ex] }
  449. { \null\\[\dimexpr.1ex-\baselineskip\relax] }
  450. }%<<<
  451. %<<<
  452. \NewDocumentCommand \dangerzone { O{1} }%>>>
  453. {
  454. \scalebox{#1}
  455. {
  456. \makebox[1em][c]
  457. {
  458. \makebox[0pt][c]{\raisebox{.17ex}{\scalebox{.6}{\kern-.11ex!}}}
  459. \makebox[0pt][c]{\color{red}$\bigtriangleup$}
  460. }
  461. }
  462. }%<<<
  463. \NewDocumentCommand \dangerzoneAlt { O{1} }%>>>
  464. { % requires installed fourier package
  465. \group_begin:
  466. \scalebox{#1}
  467. {
  468. \fontencoding{U}
  469. \fontfamily{futs}
  470. \selectfont
  471. \char 66
  472. }
  473. \group_end:
  474. }%<<<
  475. \NewDocumentCommand \dangermargin { s O{\Huge} D(){1} }%>>>
  476. {
  477. \group_begin:
  478. \IfBooleanT { #1 } { \reversemarginpar }
  479. \marginnote
  480. {
  481. #2
  482. \dangerzone[#3]
  483. }
  484. \group_end:
  485. }%<<<
  486. \NewExpandableDocumentCommand \easysout {}%>>>
  487. {
  488. \texorpdfstring{\easysout@}{\@firstofone}
  489. }%<<<
  490. \NewDocumentCommand \easysout@ {}%>>>
  491. {
  492. \bgroup
  493. \markoverwith { \rule [.4ex ] { .1ex } { .15ex } }
  494. \ULon
  495. }%<<<
  496. \NewDocumentCommand \plannedsection { O{} o m }%>>>
  497. {
  498. \use:c { #1section }
  499. [ \easysout { \IfValueTF { #2 } { #2 } { #3 } } \PlannedSecLabel ]
  500. { #3 }
  501. \leavevmode
  502. \dangermargin*
  503. \NotImplementedMessage{#1}
  504. }%<<<
  505. \NewExpandableDocumentCommand \PlannedSecLabel {}%>>>
  506. {
  507. \texorpdfstring
  508. { \ \ \textsc { [Planned] } }
  509. { ~[Planned] }
  510. }%<<<
  511. \NewDocumentCommand \Seq {}%>>>
  512. {
  513. \mbox{}
  514. \spacefactor100\relax
  515. \space
  516. =
  517. \spacefactor100\relax
  518. \space
  519. }%<<<
  520. \ExplSyntaxOff
  521. \NewDocumentCommand \NotImplementedMessage { m +O{} }%>>>
  522. {%
  523. \emph{Not Implemented yet!}
  524. Everything in this #1section is mostly inside of the documentation to remind
  525. me that I still have to code this and to give me a specification what has to
  526. be inside the final version. #2\par
  527. }%<<<
  528. %Shamelessly copied from doc.sty
  529. \def\MakeShortVerb{%>>>
  530. \@ifstar
  531. {\def\@shortvrbdef{\verb*}\@MakeShortVerb}%
  532. {\def\@shortvrbdef{\verb}\@MakeShortVerb}}%<<<
  533. \def\@MakeShortVerb#1{%>>>
  534. \expandafter\ifx\csname cc\string#1\endcsname\relax
  535. \@shortvrbinfo{Made }{#1}\@shortvrbdef
  536. \add@special{#1}%
  537. \expandafter
  538. \xdef\csname cc\string#1\endcsname{\the\catcode`#1}%
  539. \begingroup
  540. \catcode`\~\active \lccode`\~`#1%
  541. \lowercase{%
  542. \global\expandafter\let
  543. \csname ac\string#1\endcsname~%
  544. \expandafter\gdef\expandafter~\expandafter{\@shortvrbdef~}}%
  545. \endgroup
  546. \global\catcode`#1\active
  547. \else
  548. \@shortvrbinfo\@empty{#1 already}{\@empty\verb(*)}%
  549. \fi}%<<<
  550. \def\DeleteShortVerb#1{%>>>
  551. \expandafter\ifx\csname cc\string#1\endcsname\relax
  552. \@shortvrbinfo\@empty{#1 not}{\@empty\verb(*)}%
  553. \else
  554. \@shortvrbinfo{Deleted }{#1 as}{\@empty\verb(*)}%
  555. \rem@special{#1}%
  556. \global\catcode`#1\csname cc\string#1\endcsname
  557. \global \expandafter\let \csname cc\string#1\endcsname \relax
  558. \ifnum\catcode`#1=\active
  559. \begingroup
  560. \catcode`\~\active \lccode`\~`#1%
  561. \lowercase{%
  562. \global\expandafter\let\expandafter~%
  563. \csname ac\string#1\endcsname}%
  564. \endgroup \fi \fi}%<<<
  565. \def\@shortvrbinfo#1#2#3{%>>>
  566. \PackageInfo{doc}{%
  567. #1\expandafter\@gobble\string#2 a short reference
  568. for \expandafter\string#3}}%<<<
  569. \def\add@special#1{%>>>
  570. \rem@special{#1}%
  571. \expandafter\gdef\expandafter\dospecials\expandafter
  572. {\dospecials \do #1}%
  573. \expandafter\gdef\expandafter\@sanitize\expandafter
  574. {\@sanitize \@makeother #1}}%<<<
  575. \def\rem@special#1{%>>>
  576. \def\do##1{%
  577. \ifnum`#1=`##1 \else \noexpand\do\noexpand##1\fi}%
  578. \xdef\dospecials{\dospecials}%
  579. \begingroup
  580. \def\@makeother##1{%
  581. \ifnum`#1=`##1 \else \noexpand\@makeother\noexpand##1\fi}%
  582. \xdef\@sanitize{\@sanitize}%
  583. \endgroup}%<<<
  584. \AtBeginDocument{\MakeShortVerb \|}
  585. \AtEndDocument{\DeleteShortVerb \|}
  586. \makeatother