# Tag Info

12

If you use \edef you need to reset \\ and \hline afterwards, but it is typically not safe to use \edef with LaTeX input. The second form doesn't repeatedly expand the tokens. Please always make examples complete documents, as below. \documentclass{article} \begin{document} {\let\\=\relax \let\hline=\relax \xdef\mmm{\hline A & B\\} \xdef\mmm{\mmm\hline ...

11

\newcommand{\version}[2]{\marginpar{% \expandafter\colorbox{% \csname \ifthenelse{% \equal{#1}{1}}{green}{red}\endcsname}{% \begin{minipage}{\marginparwidth} \expandafter works at the level of tokens. The token after \colorbox is { so \expandafter here does nothing as { is not expandable. The tokens between \csname and \endcsname ...

8

There are several ways for appending tokens to the replacement text of a macro. The simplest one is with etoolbox: \usepackage{etoolbox} [...] \def\mmm{\hline A & B\\} \appto\mmm{\hline C & D\\} \appto\mmm{\hline 1 & 2\\\hline} \begin{tabular}{|c|c|}\mmm\end{tabular} Without packages, ...

3


2

You can do the following, I also removed all the unneeded % which had come back:-) \documentclass{article} \usepackage{xparse} \usepackage{environ,longtable,threeparttablex,booktabs,multirow,array,adjustbox,supertabular}% table adjustment packages % change spacing/padding of long table: ...

2

You have to expand both macros passed to \ifstrequal, but the string of \expandafters you're using only affects the first (and not really, I'd say). The standard technique, if the data is ASCII strings, is to use \edef: \begin{filecontents*}{\jobname.csv} "TRANSID","DATE","QUANTITY" "141f8b4a-e83e-4222-911a-5a977b4d0afca","11/9/2015","10" ...

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