On Tue, 12 May 2020 18:07:37 +0200 Ulrike Fischer <ne...@nililand.de> wrote:
> Am Tue, 12 May 2020 16:00:25 +0200 schrieb Pierre Dupond: > > > > Expand the var. And better use a tl-var instead of str-var. the > comparision code of font spec don't expect a string there. > > \tl_const:Nn \c__test_MathFont_tl {Asana-Math.otf} > \exp_args:No\setmathfont{\tl_use:N \c__test_MathFont_tl} > > > \AtBeginDocument{\ExplSyntaxOff} > > Better remove this. It is unneeded. Yes but for some strange reason I have found that it is necessary with my DTX documentation file to avoid ignoring all blanks in text of the documentation. This instruction was remaining from my strimmed down example. Now I would do a little more complicated thing: pass an optionnal parameter to the \setmathfont command. In my example, I pass just the extension (which could be given with file name) but other parameters could be passed. The following example does not seem to work. Do you have a further idea solution? Thanks. --------------------------------------------test.sty----------------------------- \RequirePackage{expl3} \ProvidesExplPackage {test} {2020-05-12} {1.0} {to test some commands} \RequirePackage{fontspec} \RequirePackage{unicode-math} \tl_const:Nn \c__test_MathFont_tl {Asana-Math} \tl_const:Nn \c__test_MathFontSpec_tl {Extension=.otf,} \exp_args:Noo\setmathfont{\tl_use:N \c__test_MathFont_tl} { [ \tl_use:N \c__test_MathFontSpec_tl ] } %\exp_args:No\setmathfont{\tl_use:N \c__test_MathFont_tl}[Extension=.otf] --------------------------------------------test.tex-------------------------------------------------- \documentclass{article} \usepackage{test1} \begin{document} Some text and some math $e^{iπ}+1=0$ \end{document}