DSALaTeX provides macros and environments to aid the creation of adventures in the German pen&paper "Das Schwarze Auge" (DSA).
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.

DSAutil.sty 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. \NeedsTeXFormat{LaTeX2e}
  2. \def\DSAutil@version{0.1}
  3. \def\DSAutil@date{2018-10-15}
  4. \ProvidesPackage{DSAutil}
  5. [%
  6. \DSAutil@date\space v\DSAutil@version\space Hilfsmacros von DSALaTeX%
  7. ]
  8. % Utility >>>
  9. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  10. \def\endDSAargument@test{&$_^$VeryUnlikelyStringgggg}% bad implementation
  11. \newcommand\DSAindentedThingy[1][1em]%>>>
  12. {%
  13. \hangindent#1\relax
  14. \noindent
  15. }%<<<
  16. \long\def\DSAifminusTF@inner#1-#2\endDSAifminusTF@inner%>>>
  17. {%
  18. \DSAifemptyTF{#2}
  19. }%<<<
  20. \newcommand\DSAifminusTF[1]%>>>
  21. {%
  22. \DSAifminusTF@inner#1-\endDSAifminusTF@inner
  23. \@secondoftwo
  24. \@firstoftwo
  25. }%<<<
  26. \newcommand\DSAifemptyTF[1]%>>>
  27. {%
  28. \if\relax\detokenize{#1}\relax
  29. \expandafter\@firstoftwo
  30. \else
  31. \expandafter\@secondoftwo
  32. \fi
  33. }%<<<
  34. \long\def\DSAifblankTF@inner#1#2\endDSAifblankTF@inner%>>>
  35. {%
  36. \ifx\endDSAargument@test#1
  37. \expandafter\@firstoftwo
  38. \else
  39. \expandafter\@secondoftwo
  40. \fi
  41. }%<<<
  42. \newcommand\DSAifblankTF[1]%>>>
  43. {%
  44. \DSAifblankTF@inner#1\endDSAargument@test\endDSAifblankTF@inner
  45. }%<<<
  46. \newcommand\DSAifnegativeTF[1]%>>>
  47. {%
  48. \ifnum#1<0
  49. \expandafter\@firstofone
  50. \else
  51. \expandafter\@secondofone
  52. \fi
  53. }%<<<
  54. \long\def\DSAifminusfirstTF@inner#1-#2\endDSAifminusfirstTF@inner%>>>
  55. {%
  56. \DSAifemptyTF{#1}%
  57. }%<<<
  58. \newcommand\DSAifminusfirstTF[1]%>>>
  59. {%
  60. \DSAifminusTF{#1}
  61. {%
  62. \DSAifminusfirstTF@inner#1\endDSAifminusfirstTF@inner
  63. }
  64. {%
  65. \@secondoftwo
  66. }%
  67. }%<<<
  68. \long\def\DSAtllength@inner#1#2%>>>
  69. {%
  70. \ifx\endDSAargument@test#2
  71. \expandafter\@firstoftwo
  72. \else
  73. \expandafter\@secondoftwo
  74. \fi
  75. {#1}%
  76. {\expandafter\DSAtllength@inner\expandafter{\the\numexpr#1+1\relax}}%
  77. }%<<<
  78. \newcommand\DSAtllength[1]%>>>
  79. {%
  80. \DSAtllength@inner{0}#1\endDSAargument@test
  81. }%<<<
  82. \newcommand\DSAMakeUppercase[2][2]%>>>
  83. {%
  84. \ifnum\DSAtllength{#2}=#1
  85. \MakeUppercase{#2}%
  86. \else
  87. #2%
  88. \fi
  89. }%<<<
  90. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<<<
  91. \endinput