[NTG-context] Macro to write a letter with \ mathscript{}

Fabrice Couvreur fabrice1.couvreur at gmail.com
Sat Apr 17 16:30:57 CEST 2021


Hi,
This is going to be difficult to explain because the code below works but
in a project with many components does not. Actually the macro does not
work in the definition environment in my project but in the same
environment of this simple code yes. Thank you for your possible help.
Fabrice

\setupbodyfont[modern]

\setupenumerations
  [before={},
   after={\blank},
   alternative=serried,
   number=no,
   title=yes,
   titleleft={(},
   titleright={)},
   prefix=yes,
   prefixsegments=chapter,
   way=bychapter,
   titlestyle=bold,
   width=broad]

\defineenumeration
   [definition]
   [text=Définition,
    number=no,
    headcommand=\groupedcommand{}{},
    style=slanted]

\setupmathematics[stylealternative=calligraphic]

 \unexpanded\def\CScript#1#2{\start\switchtobodyfont[stixtwo]\m{{\mathscript{#1}}_{#2}}\stop}

 \unexpanded\def\cscript#1{\start\switchtobodyfont[stixtwo]\m{{\mathscript{#1}}}\stop}

\starttext

\startdefinition
  \placefigure[right]{}{
  \startMPcode
    path rectangle;
    rectangle=unitsquare xscaled 6cm yscaled 4cm;

    draw rectangle withcolor green;
    label.bot("\cscript{C}", center rectangle);
  \stopMPcode}
  Soit \m{f} une fonction continue et positive sur un intervalle
\m{[a\,;b]} et \cscript{C}  sa courbe représentative dans un repère
orthogonal. L'aire du domaine délimité par la courbe \cscript{C}, l'axe des
abscisses et les droites d'équations \m{x=a} et \m{x=b}, exprimée en unité
d'aire, est appelée {\bi intégrale de \m{a} à \m{b} de la fonction \m{f}}.
\stopdefinition

\stoptext
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20210417/21dbdbc2/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ntg-1.png
Type: image/png
Size: 60005 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20210417/21dbdbc2/attachment-0001.png>


More information about the ntg-context mailing list