Changing the font size in an environment changes the behavior of a macro
Hi, This macro was written by Otared and it works well unless I change the size of the font (see the second graph). How to correct this problem ? Thanks for your help. Fabrice %%%% begin example \usemodule[pgfplots] \pgfplotsset{compat=newest} \define[2]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}_{#2}}\stop} \starttext \startmidaligned \starttikzpicture \startaxis \addplot {x}; \node[above left] at (2,2) {\cscript{C}{f}}; \stopaxis \stoptikzpicture \stopmidaligned \blank \startmidaligned \switchtobodyfont[9pt] \starttikzpicture \startaxis \addplot {x}; \node[above left] at (2,2) {\cscript{C}{f}}; \stopaxis \stoptikzpicture \stopmidaligned \stoptext %%%%end example
Hi,
Sorry to insist but I cannot fix this problem.
Thanks for any help.
Fabrice
Le sam. 25 avr. 2020 à 00:13, Fabrice Couvreur
Hi, This macro was written by Otared and it works well unless I change the size of the font (see the second graph). How to correct this problem ? Thanks for your help. Fabrice
%%%% begin example
\usemodule[pgfplots] \pgfplotsset{compat=newest}
\define[2]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}_{#2}}\stop}
\starttext
\startmidaligned \starttikzpicture \startaxis \addplot {x}; \node[above left] at (2,2) {\cscript{C}{f}}; \stopaxis \stoptikzpicture \stopmidaligned \blank \startmidaligned \switchtobodyfont[9pt] \starttikzpicture \startaxis \addplot {x}; \node[above left] at (2,2) {\cscript{C}{f}}; \stopaxis \stoptikzpicture \stopmidaligned
\stoptext
%%%%end example
On Mon, 4 May 2020, Fabrice Couvreur wrote:
Hi, Sorry to insist but I cannot fix this problem. Thanks for any help.
I don't know the answer, but here is a simpler example without pgfplot which fails (different calligraphic C's): \define[1]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}}\stop} \starttext \startTEXpage[offset=2mm] \cscript{C} \start \switchtobodyfont[9pt] \cscript{C} \stop \stopTEXpage \stoptext And here is a version with a minor change that works (same calligraphic C's)! \usebodyfont[xitsbidi] \define[1]\cscript{\start\m{{\mathscript{#1}}}\stop} \starttext \startTEXpage[offset=2mm] \cscript{C} \start \switchtobodyfont[9pt] \cscript{C} \stop \stopTEXpage \stoptext Aditya
Hi Aditya,
Thank you for your help ; this also works with pgfplots but the body of the
text must be with the same font. I always use the pagella font but it
doesn't allow you to use \mathscript{} that's why I use this macro. Are
there other free fonts that allow you to do this ?
Fabrice
\usemodule[pgfplots]
\pgfplotsset{compat=newest}
\usebodyfont[xitsbidi]
\define[1]\cscript{\start\m{{\mathscript{#1}}}\stop}
\startmidaligned
\define[1]\cscript{\start\m{{\mathscript{#1}}}\stop}
\starttikzpicture
\startaxis
\addplot {x};
\node[above left] at (2,2) {\cscript{C}};
\stopaxis
\stoptikzpicture
\stopmidaligned
\blank
\startmidaligned
\switchtobodyfont[9pt]
\starttikzpicture
\startaxis
\addplot {x};
\node[above left] at (2,2) {\cscript{C}};
\stopaxis
\stoptikzpicture
\stopmidaligned
\stoptext
Le lun. 4 mai 2020 à 19:18, Aditya Mahajan
On Mon, 4 May 2020, Fabrice Couvreur wrote:
Hi, Sorry to insist but I cannot fix this problem. Thanks for any help.
I don't know the answer, but here is a simpler example without pgfplot which fails (different calligraphic C's):
\define[1]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}}\stop}
\starttext \startTEXpage[offset=2mm] \cscript{C} \start \switchtobodyfont[9pt] \cscript{C} \stop \stopTEXpage \stoptext
And here is a version with a minor change that works (same calligraphic C's)!
\usebodyfont[xitsbidi]
\define[1]\cscript{\start\m{{\mathscript{#1}}}\stop}
\starttext \startTEXpage[offset=2mm] \cscript{C} \start \switchtobodyfont[9pt] \cscript{C} \stop \stopTEXpage \stoptext
Aditya
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
participants (2)
-
Aditya Mahajan
-
Fabrice Couvreur