Tag Info

New answers tagged

8

You need to move your \defs outside the tikzpicture (otherwise, they don't survive the group created for the environment). The caption is provided using \caption{$y=\protect\polynomial{\g,\f,\e,\d,\c,\b,\a}$} where \polynomial from the polynomial package gives the desired formatting for the polynomials. In fact, the code uses a redefinition of ...


4

I am not entirely sure that I understood what you want. However, your MWE can easily be achieved with xparse and its v type argument: \documentclass{article} \usepackage{qrcode,xparse} \NewDocumentCommand{\script}{v}{% \texttt{#1} \qrcode{#1}% } \begin{document} \script{test} \script{&$\#$} \end{document} Keep in mind, though, that now since now ...


4

Several issues here. table.pack() expects a comma-separated list of values, not a string. So the appropriate syntax would be without the quotes, i.e: table.pack(#1) Using the mentioned syntax, Lua would receive: table.pack(a,b,c,d,e) in your example, but that is not a list of values, but a list of variables. Undefined variables indeed. So you have to quote ...


2

As David suggests in the comments, another approach is use a comma separated syntax: \foo{1,2,3,4,5,6,7,8,9,a} You can then loop over the entries and put them into place. There are still some expansion issues because we are working inside a table but you can get around these using the etoolbox to build each row as you loop over the arguments using ...


5

The first table cell, where \foo is executed, is also a local group. After the next & the local meanings of \tempb, \tempc, ... are lost. There are several ways Global definitions \documentclass{article} \begin{document} \newcommand*\foo[9]{% \gdef\tempa{#1}% \gdef\tempb{#2}% \gdef\tempc{#3}% \gdef\tempd{#4}% \gdef\tempe{#5}% \gdef\tempf{#6}% ...



Top 50 recent answers are included