Tag Info

New answers tagged

4

You have several bad % in your code. Always leave a space after a constant (or add \relax. In particular the bad one is at \ifnum\value{mycnt}>0% \item[item \the\mycount] text \fi% When TeX wants to perform this check, it expands \item to see if some more digits come along. In the case hyperref is loaded, the first level expansion of \item is ...


1

You can use \addto macro by the following way: \long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}} \def\addtolist#1{\global\addto\totcontent{, \texttt{#1}}} \newread\infile \openin\infile=test-2.txt \bgroup \endlinechar=-1 \gdef\totcontent{}% \loop \unless\ifeof\infile \read\infile to\tmp \ifx\tmp\empty \else ...


2

The usual problem are the end of lines. You don't want \readline, but the normal \read. \begin{filecontents*}{\jobname.txt} some more words in here so as to eventually print \end{filecontents*} \documentclass{article} \makeatletter \newread\myread \makeatletter \def\strip@final@space{\expandafter\strip@final@sp@ce\@tempa\strip@final@sp@ce} ...


0

Ok, I got at least a working version - though I cannot say I understand what is going on; so a more erudite answer would still be appreciated. But after some messing about, I got a "two-step" approach with call to \protected@edef to work. Here is the MWE: \documentclass{article} \usepackage{filecontents} % tlmgr install filecontents ...


3

The problem is that \define@key doesn't expand its argument; also \index should be expanded at definition time in the replacement text of \define@key, not at runtime. Using \index is not necessary, \the\count@ does the same (or \@arabic\count@, if you prefer. And \index is a badly chosen name anyway: try building an index for your document to see why. ...


4

Here's a way, all supported by array for insertion of content at the start of a cell: \documentclass{article} \usepackage{array} \newcounter{bluecol}\newcounter{redrow} \newcommand{\insertblue}{% \relax\ifnum\value{bluecol}>0 blue${}=\number\numexpr7-\value{bluecol}$\addtocounter{bluecol}{-1}\fi} \newcommand{\insertred}{% ...


8

Although using multiple \foreach loops does make the "semantic" layout of the network a little unclear, it certainly makes its creation easier. I have taken some liberties with the required connections otherwise the network starts to look a bit cluttered. \documentclass[tikz,border=5]{standalone} \usetikzlibrary{arrows.meta,calc} \begin{document} ...



Top 50 recent answers are included