Tag Info

Hot answers tagged

7

The # gets doubled inside \unexpanded. A workaround with \expandafter: \documentclass{article} \usepackage{xcolor} \makeatletter \def\ae@test#1{\textcolor{red}{\fbox{#1}}} \expandafter\def\expandafter\aetest\expandafter#\expandafter1\expandafter{% \ae@test{#1}% } \makeatother \begin{document} \aetest{Hello} \end{document} Then \aetest has the ...


6

In days of yore there was a d-type argument for double expansion. However, it was dropped some years ago as there were very few places it was required, particularly when the team decided not to use toks registers generally. From memory, in expl3 there are two places where we had to go with a construct of the \exp_args:NNo \exp_args:No or similar form. The ...


4

My impression is that you want to do \tl_set:Nx \l__mymodule_size_tl { [ \exp_not:c { \tl_use:N \l_keys_choice_tl } ] } With x expansion \exp_not:c is triggered, so the argument is fully expanded as always when c is involved (it is \csname...\endcsname); then the resulting token is made not expandable, so if you have size=big you'll get [\big] in ...


4

replace by and other dynamic tree keys check if their argument is a node specification simply by checking if the argument starts with a [ (see the definition of \forest@nodehandleby@nnb@checkfirst). In your case, it does not, so forest tries to interpret @+\prooftreeleaping{#1}{#2} as a node walk. I guess this should be mentioned in the documentation. Will ...


4

You can use \unexpanded from eTeX using the following code: \def\aeAtest#1{\textcolor{red}{\fbox{#1}}} \def\eonce#1{\unexpanded\expandafter{#1{##1}}} \edef\tmp{\def\noexpand\OUT##1{expanded before \eonce{\aeAtest} after.}}\tmp \message{\meaning\OUT} % \OUT#1 -> expanded before \textcolor {red}{\fbox {#1}} after. Edit Another usage of the same idea ...


3

To work around the expansion issues point to by @HeikoOberdiek, I've come up with the following work around \edef\aetest#1{\noexpand\def\noexpand\ae@tmp{#1}%% \unexpanded\expandafter{\ae@test{\ae@tmp}}} though I'll have to test it out a bit before I'm sure that it really does accomplish what I want.


3

Package acronym The internal expandable version of \acl is \AC@acl. Then \index inside the macro \acidx will write the expanded long version of the acronym: \documentclass{article} \usepackage{acronym} \usepackage{makeidx} \makeindex \makeatletter \newcommand*{\acidx}[1]{% \ac{#1}\index{\AC@acl{#1}}% } \makeatother \acrodef{ABC}{alphabet} ...


3

Your \listLength command doesn't work by pure expansion; you should say \newcommand*{\listLength}[1]{% \setcounter{listlength@cnt}{0}% \forcsvlist{\listlength@add}{#1}% } as the definition of \listLength and then \listLength{\@glo@types}% \addtocounter{mtc}{\value{listlength@cnt}}% in the code. There's a much slicker way with expl3: ...


2

A solution with expl3: \documentclass{article} \usepackage{xcolor} \usepackage{expl3} \ExplSyntaxOn \cs_new_protected:Npn \ae_test:n #1 { \textcolor{red}{\fbox{#1}}~ \textcolor{green}{\fbox{#1}}~ \textcolor{blue}{\fbox{#1}} } \group_begin: \tl_set:No \l_tmpa_tl { \ae_test:n { #1 } } \use:x { \group_end: \cs_new:Npn \exp_not:N \aetest ##1 { ...


1

\documentclass{article} \usepackage{xparse} \usepackage{tikz} \usetikzlibrary{calc, positioning, matrix, scopes} \tikzset{nosep/.style={inner sep=0pt,outer sep=0pt}} % GRIDFIGURES % % % % % % % % % % % % % % % % % #1 total width [default: \textwidth] % #2 macro for matrix content % #3 total figures % #4 total columns % #5 gutter space % #6 folder % #7 ...


1

This won't work. \citet is a much to complicated macro, you can't retrieve its output is a simple way. If you really want to stick to natbib (in biblatex language support is build in) you should manipulate the .bst-file. Save it under another name in your document folder and then change the fixed words so that they issue commands. E.g. FUNCTION{fr.and}{ ...



Only top voted, non community-wiki answers of a minimum length are eligible