Tag Info

New answers tagged

3

The array notation isn't really helping, especially as implemented in your question where it is not expandable so can not be used in lots of places, such as \dimexpr. here is an expandable version: \documentclass[a4paper,10pt]{article} \def\set#1#2#3{\expandafter\def\csname#1#2\endcsname{#3}} \def\use#1#2{\csname#1#2\endcsname} \begin{document} ...


3

First of all you should use arrayjobx and not arrayjob (the latter is not really compatible with LaTeX). Secondly, \let\a\dimexpr will make \a equivalent to \dimexpr and try printing \cws(0)+\cws(1)\relax; then \a will produce an error just like \dimexpr \end{document} You should use \newcommand and not \let, but it won't do anyway, because \cws(0) is ...


5

That's a job for expl3! \documentclass{article} \pagestyle{empty} \usepackage{xparse} \ExplSyntaxOn \seq_new:N \l_nagylzs_cws_seq \NewDocumentCommand \ArraySet { m } { \seq_set_from_clist:Nn \l_nagylzs_cws_seq { #1 } } \NewDocumentCommand \ArraySum { m } { \dim_zero:N \l_tmpa_dim \seq_map_inline:Nn \l_nagylzs_cws_seq { \dim_add:Nn ...


2

Here's a different approach using the readarray package. EDITED to demonstrate functionality with different unit sets in the array. \documentclass[a4paper,10pt]{article} \usepackage{readarray} \def\cws#1{\arrayij{cws}{#1}{1}}% prints out #1 row of "cws" 1-column array \begin{document} \def\data{3pt 4ex 1in}% space separated data ...



Top 50 recent answers are included