slatex / sTeX

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

\varseq[args=2] regression (or misunderstanding) #306

Closed kohlhase closed 2 years ago

kohlhase commented 2 years ago

In MiKoMH/AI/source/probabilistic-reasoning/mod/wwr-probabilistic.en.tex I have

     \varseq{seqp}[name=p,args=2]{1,1}{4,4}{\comp{p}_{#1,#2}}
      For a particular configuration $\seqp!$ with
      $\inset{\seqp{i}j}{\set{\semtrue,\semfalse}}$, $n$ pits, and
      $\uProb{\seqp{i}j}=0.2$ we have
      $\uProb{\seqp!}=\realtimes[cdot]{\realpower{0.2}n,\realpower{0.8}{\intminus{16,n}}}$

and I get errors:

/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/probabilistic-reasoning/mod/wwr-probabilistic.en.tex:43: Illegal parameter number in definition of \iterate.
<to be read again> 
                   1
l.43 \end{frame}

/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/probabilistic-reasoning/mod/wwr-probabilistic.en.tex:43: Illegal parameter number in definition of \iterate.
<to be read again> 
                   2
l.43 \end{frame}

/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/probabilistic-reasoning/mod/wwr-probabilistic.en.tex:43: Illegal parameter number in definition of \iterate.
<to be read again> 
                   1
l.43 \end{frame}

/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/probabilistic-reasoning/mod/wwr-probabilistic.en.tex:43: Illegal parameter number in definition of \iterate.
<to be read again> 
                   2
l.43 \end{frame}

/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/probabilistic-reasoning/mod/wwr-probabilistic.en.tex:43: Illegal parameter number in definition of \beamer@do
ifinframe.
<to be read again> 
                   1
l.43 \end{frame}

/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/probabilistic-reasoning/mod/wwr-probabilistic.en.tex:43: Illegal parameter number in definition of \beamer@doifinframe.
<to be read again> 
                   2
l.43 \end{frame}
kohlhase commented 2 years ago

Interesting, sometimes I can get rid of errors by adding [name=a] to the \varseq The syntax had suggested that this is optional. But sometimes I do not seem to need the names.

Jazzpirate commented 2 years ago

Interesting, sometimes I can get rid of errors by adding [name=a] to the \varseq The syntax had suggested that this is optional. But sometimes I do not seem to need the names.

Ah, that explains things - I think if you don't specify a name it will attempt to use the notation as a name, as with \vardef. But of course, in that case the name contains #1 and #2...

I will take a look after the paper deadline

kohlhase commented 2 years ago

OK, I would suggest that if we need a name, then we should make the name syntactically required.

Jazzpirate commented 2 years ago

...or make the macroname the name, rather. seqp seems like a reasonable name for a variable to me. I'll need to check the code though, whether that's really what's going on here

Jazzpirate commented 2 years ago

same question as in the other context - have you tried [fragile]?

kohlhase commented 2 years ago

you are richt, fragile seems to cure this.