Tag Info

Hot answers tagged

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} ...


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}{% ...


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 ...


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. ...


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} ...


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 ...



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