slatex / sTeX

A semantic Extension of TeX/LaTeX
49 stars 9 forks source link

make defining occurrences of notations \defemph #326

Open kohlhase opened 2 years ago

kohlhase commented 2 years ago

We have a special highlight for the defining occurrences of verbalizations (\defemph which becomes magenta in the AI notes/slides). But we do not have that for notations. This leads to definitions without any magenta in e.g. ...MathHub/MiKoMH/AI/source/ml/mod/decision-lists.en.tex. And that is unintuitive.

An example of this is

    \begin{sdefinition}
      The set of \symname[post=s]{decision-list} where tests are of conjunctions of at most $k$
      literals is denoted by $\kdeclist{k}$.
    \end{sdefinition}

which formats to

image

I would like to have a way to to locally set \compemph to be \defemph for definitional occurrences of notations. In the example above this would make the "$k$-DL" magenta.

One way woulb be a "special notation" so that we could write $\kdeclist[definiendum]{k}$ where the notation is generated to use \defemph. As we only use the definiendum notation exactly once (barring redefinitions) the notational overhead is not a problem. I am afraid, just wrapping the formula in a {\let\compemph=\defemph...} will not work.

Jazzpirate commented 2 years ago

One way woulb be a "special notation" so that we could write $\kdeclist[definiendum]{k}$ where the notation is generated to use

I see two problems with this: a) "where the notation is"... which notation? Especially when there are several, it's not uncommon to have something like "(written as $...$ or $...$)" where we want multiple notations be "defemphed", and b) A definiendum-notation should only be allowed in sdefinition-environments and add to its for=-list. So I don't think definiendum should be a notation itself.

I am afraid, just wrapping the formula in a {\let\compemph=\defemph...} will not work.

Implementation-wise, that's what a definiendum-notation would do, so I hoope it will work - syntactically we'd have to wrap it in something. I would suggest reusing the existing \definiendum with a distinction between text<->math modes? e.g. A \definiendum{foo?bar}{foobar} (written $\definiendum{\bar{x,y}}$...), where definiendum in math-mode temporarily redefines \comp to be \defemph for the next encountered notation...