Tag Info

New answers tagged

1

You can count how many elements there are in one of the arrays and use that number as the foreach limit. Then every spin accesses one element of the arrays; \documentclass[tikz]{standalone} \def\firstlist{{0,1,2}} % <== Notice the double brace for array notation \def\secondlist{{0,1,2}} \newcommand{\testa}{ \pgfmathdim{\firstlist}%Get the number of ...


1

I'm not so sure you want to do it. ;-) \documentclass{article} \usepackage{xparse} \def\xforeach#1#{\xforeachaux{#1}} \ExplSyntaxOn \NewDocumentCommand{\xforeachaux}{mm} { \carlitos_xforeach:nn { #1 } { #2 } } \seq_new:N \l_carlitos_xf_first_seq \seq_new:N \l_carlitos_xf_second_seq \seq_new:N \l_carlitos_xf_list_seq \cs_new_protected:Npn ...


0

As egreg mentioned in a comment: it is well-known problem. Moderators feel free to close it as duplicate (I'd like to see the link to discussion of similar issue though). So far I stick to a workaround: generate less by one rows in \forloop and then manually add code for the last line. Concerning example given in the question the solution is as follows. ...


2

EDIT II Here is a fully functional solution. The MWE example is yours. My code puts the watermarks on pages 2,4,5,6 and 7 and adds hyperlinks back to them at the end of the document. I'll make some comments below. \documentclass{article} \usepackage[contents={Watermarked!},pages=some]{background} \usepackage[colorlinks]{hyperref} \pagenumbering{arabic} ...


2

Run with lualatex (the number of rows is not limited): \documentclass[border=5]{standalone} \usepackage{luacode,array} \def\PascalTriangle#1{\directlua{PascalTriangle(#1)}} \begin{luacode} function nextrow(t) local ret = {} t[0], t[#t+1] = 0, 0 for i = 1, #t do ret[i] = t[i-1] + t[i] end return ret end function PascalTriangle(n) ...


4

The following should do it. By using the fpu library it is possible to go beyond the usual limit of 17 rows in PGF. \documentclass[tikz,border=5]{standalone} \usepgflibrary{fpu} \begin{document} \def\N{10} \tikz[x=0.75cm,y=0.5cm, pascal node/.style={font=\footnotesize}, row node/.style={font=\footnotesize, anchor=west, shift=(180:1)}] \path ...


8

When using xpatch (or the original commands in etoolbox) for patching macros, it's recommended to use the builtin diagnostics, that is \tracingpatches and the “fail” argument. If you add \tracingpatches to the preamble, before your usage of \IfPackageLoaded, you'll get the message [debug] tracing \pretocmd on input line 26 [debug] analyzing ...


1

This uses algoritmm Code \documentclass[titlepage,oneside,12pt]{article} \usepackage{algpseudocode} \usepackage{algorithm} \begin{document} \begin{algorithm} \caption{Initialization} \begin{algorithmic}[1] \Require Given the M detected objects \Ensure new clusters \For {(each object $i$)} \State Create new cluster $C_i$; ...


1

You are mixing up commands from the packages algorithm2e and algorithm. Well, I believe you do. See my following MWE. This does compile and uses the syntax provided by the documentation here. Is this what you wanted to type? % arara: pdflatex \documentclass[titlepage,oneside,12pt]{article} \usepackage{algpseudocode,algorithm2e} \begin{document} ...



Top 50 recent answers are included