From c6d00748cddaea8747083f8ed6e7e6b24451d55a Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Sat, 21 Feb 2026 17:26:26 +0100 Subject: [PATCH] [General] Various fixes --- config/main.sty | 8 +++--- janishutz-helpers.tex | 35 ++++++++++++++++++++------ src/core/translation.sty | 4 +-- src/style/environments-descriptors.sty | 23 +++++++++++++++-- 4 files changed, 54 insertions(+), 16 deletions(-) diff --git a/config/main.sty b/config/main.sty index 01c85ec..c17caea 100644 --- a/config/main.sty +++ b/config/main.sty @@ -13,12 +13,12 @@ % - #1 is the name of the descriptor % - #2 is the number (correctly rendered according to settings and preceded with space if not disabled) % - #3 is the name passed (non-empty asserted) -\newcommand{\shortDescriptorTemplate}[3]{\bg{#1color}{\shortNamingTranslate{#1} #2} \textit{(#3)}} -\newcommand{\inlineDescriptorTemplate}[3]{\bg{#1color}{\namingTranslate{#1} #2}: \textit{(#3)}} +\newcommand{\shortDescriptorTemplate}[3]{\bg{#1color}{\shortNamingTranslate{#1} #2} \textit{(#3)}\ } +\newcommand{\inlineDescriptorTemplate}[3]{\bg{#1color}{\namingTranslate{#1} #2}: \textit{(#3)}\ } % These are used if no name is provided and argument #4 from above is the missing argument -\newcommand{\anonymousShortDescriptorTemplate}[2]{\bg{#1color}{\shortNamingTranslate{#1} #2}} -\newcommand{\anonymousInlineDescriptorTemplate}[2]{\bg{#1color}{\namingTranslate{#1} #2}} +\newcommand{\anonymousShortDescriptorTemplate}[2]{\bg{#1color}{\shortNamingTranslate{#1} #2}\ } +\newcommand{\anonymousInlineDescriptorTemplate}[2]{\bg{#1color}{\namingTranslate{#1} #2}\ } % background command config (draws a small box around the content) \newcommand{\backgroundPadding}{2pt} diff --git a/janishutz-helpers.tex b/janishutz-helpers.tex index a5b6483..ef0ce84 100644 --- a/janishutz-helpers.tex +++ b/janishutz-helpers.tex @@ -107,12 +107,12 @@ % - #1 is the name of the descriptor % - #2 is the number (correctly rendered according to settings and preceded with space if not disabled) % - #3 is the name passed (non-empty asserted) -\newcommand{\shortDescriptorTemplate}[3]{\bg{#1color}{\shortNamingTranslate{#1} #2} \textit{(#3)}} -\newcommand{\inlineDescriptorTemplate}[3]{\bg{#1color}{\namingTranslate{#1} #2}: \textit{(#3)}} +\newcommand{\shortDescriptorTemplate}[3]{\bg{#1color}{\shortNamingTranslate{#1} #2} \textit{(#3)}\ } +\newcommand{\inlineDescriptorTemplate}[3]{\bg{#1color}{\namingTranslate{#1} #2}: \textit{(#3)}\ } % These are used if no name is provided and argument #4 from above is the missing argument -\newcommand{\anonymousShortDescriptorTemplate}[2]{\bg{#1color}{\shortNamingTranslate{#1} #2}} -\newcommand{\anonymousInlineDescriptorTemplate}[2]{\bg{#1color}{\namingTranslate{#1} #2}} +\newcommand{\anonymousShortDescriptorTemplate}[2]{\bg{#1color}{\shortNamingTranslate{#1} #2}\ } +\newcommand{\anonymousInlineDescriptorTemplate}[2]{\bg{#1color}{\namingTranslate{#1} #2}\ } % background command config (draws a small box around the content) \newcommand{\backgroundPadding}{2pt} @@ -898,8 +898,8 @@ \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2}% } \newcommand{\tr}[2]{\translate{#1}{#2}} -\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionEN{#1}}} -\newcommand{\shortNamingTranslate}[1]{\translate{\printShortTranslationOptionEN{#1}}{\printShortTranslationOptionEN{#1}}} +\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionDE{#1}}} +\newcommand{\shortNamingTranslate}[1]{\translate{\printShortTranslationOptionEN{#1}}{\printShortTranslationOptionDE{#1}}} % Translation aids (commonly used) \newcommand{\trif}{\translate{if }{falls }} @@ -1271,6 +1271,14 @@ \inline[#1]{#2} } +\newcommand{\unnumberedInline}[2][NONAME]{% + \ifthenelse{\equal{NONAME}{#1}}{% + \anonymousInlineDescriptorTemplate{#2}{}% + }{% + \inlineDescriptorTemplate{#2}{}{#1}% + }% +} + \newcommand{\short}[2][NONAME]{% \ifthenelse{\equal{NONAME}{#1}}{% \anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}% @@ -1285,8 +1293,19 @@ \short[#1]{#2} } -\newcommand{\inlineproof}{\anonymousInlineDescriptorTemplate{proof}{}} -\newcommand{\shortproof}{\anonymousShortDescriptorTemplate{proof}{}} +\newcommand{\unnumberedShort}[2][NONAME]{% + \ifthenelse{\equal{NONAME}{#1}}{% + \anonymousShortDescriptorTemplate{#2}{}% + }{% + \shortDescriptorTemplate{#2}{}{#1}% + }% +} + +\newcommand{\inlineproof}[1][NONAME]{\unnumberedInline[#1]{proof}} +\newcommand{\inlineterm}[1][NONAME]{\unnumberedInline[#1]{term}} + +\newcommand{\shortproof}[1][NONAME]{\unnumberedShort[#1]{proof}} +\newcommand{\shortterm}[1][NONAME]{\unnumberedShort[#1]{term}} % ┌ ┐ diff --git a/src/core/translation.sty b/src/core/translation.sty index 2e0691f..92cf2c2 100644 --- a/src/core/translation.sty +++ b/src/core/translation.sty @@ -5,8 +5,8 @@ \ifthenelse{\equal{\currentLanguage}{en}}{#1}{#2}% } \newcommand{\tr}[2]{\translate{#1}{#2}} -\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionEN{#1}}} -\newcommand{\shortNamingTranslate}[1]{\translate{\printShortTranslationOptionEN{#1}}{\printShortTranslationOptionEN{#1}}} +\newcommand{\namingTranslate}[1]{\translate{\printTranslationOptionEN{#1}}{\printTranslationOptionDE{#1}}} +\newcommand{\shortNamingTranslate}[1]{\translate{\printShortTranslationOptionEN{#1}}{\printShortTranslationOptionDE{#1}}} % Translation aids (commonly used) \newcommand{\trif}{\translate{if }{falls }} diff --git a/src/style/environments-descriptors.sty b/src/style/environments-descriptors.sty index 7c432b4..d6e3bde 100644 --- a/src/style/environments-descriptors.sty +++ b/src/style/environments-descriptors.sty @@ -14,6 +14,14 @@ \inline[#1]{#2} } +\newcommand{\unnumberedInline}[2][NONAME]{% + \ifthenelse{\equal{NONAME}{#1}}{% + \anonymousInlineDescriptorTemplate{#2}{}% + }{% + \inlineDescriptorTemplate{#2}{}{#1}% + }% +} + \newcommand{\short}[2][NONAME]{% \ifthenelse{\equal{NONAME}{#1}}{% \anonymousShortDescriptorTemplate{#2}{\printLabel{#2}}% @@ -28,5 +36,16 @@ \short[#1]{#2} } -\newcommand{\inlineproof}{\anonymousInlineDescriptorTemplate{proof}{}} -\newcommand{\shortproof}{\anonymousShortDescriptorTemplate{proof}{}} +\newcommand{\unnumberedShort}[2][NONAME]{% + \ifthenelse{\equal{NONAME}{#1}}{% + \anonymousShortDescriptorTemplate{#2}{}% + }{% + \shortDescriptorTemplate{#2}{}{#1}% + }% +} + +\newcommand{\inlineproof}[1][NONAME]{\unnumberedInline[#1]{proof}} +\newcommand{\inlineterm}[1][NONAME]{\unnumberedInline[#1]{term}} + +\newcommand{\shortproof}[1][NONAME]{\unnumberedShort[#1]{proof}} +\newcommand{\shortterm}[1][NONAME]{\unnumberedShort[#1]{term}}