Fonts & Character Setsexpl3: Nx expansion won't take math typesetting

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
erwann
Posts: 75
Joined: Thu Aug 25, 2016 2:24 am

expl3: Nx expansion won't take math typesetting

Post by erwann »

The code below says it all.

Code: Select all

\documentclass{minimal}
\usepackage{expl3}
\usepackage{amssymb}

\ExplSyntaxOn

\begin{document}

\tl_set:Nn \bar{A}
\tl_set:Nf  \baz{\ensuremath{\mathcal{\bar}}} 
%\tl_set:Nx  \baz{\ensuremath{\mathcal{\bar}}} % :Nx generates error
\tl_set:Nn \bar{B}
\baz % want \mathcal{A}, get \mathcal{B}

\ExplSyntaxOff

\end{document}
Console output (1)

Code: Select all

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./Nx_mathcal.tex
LaTeX2e <2017-04-15>
Babel <3.18> and hyphenation patterns for 84 language(s) loaded.
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/minimal.cls
Document Class: minimal 2001/05/25 Standard LaTeX minimal class
) (/usr/local/texlive/2017/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2017/texmf-dist/tex/latex/l3kernel/l3pdfmode.def))
(/usr/local/texlive/2017/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(./Nx_mathcal.aux)
! Undefined control sequence.
\GenericError  ...                                
                                                    #4  \errhelp \@err@     ...
l.11 \tl_set:Nx  \baz{\ensuremath{\mathcal{\bar}}}
                                                   % :Nx generates error
(1) The *.log file generated doesn't contain the error of the console output. TexWorks. Any suggestion?
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
erwann
Posts: 75
Joined: Thu Aug 25, 2016 2:24 am

expl3: Nx expansion won't take math typesetting

Post by erwann »

\exp_not:N does the job.
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)
Post Reply