Tag Info

New answers tagged

2

Your usage of \providecommand is wrong in any case. Even if it worked, \Authors would expand to \DTLbibfield{Author}, which is not a comma separated list good for \foreach, so the only item is processed as a unit. You should use \DTLbibfieldlet instead: \begin{filecontents}{\jobname.bib} @inproceedings{test, Author = {Author One and Auteur Twee}, Title ...


3

It's an expansion problem in \regtotcounter; I'll investigate whether it's possible to avoid the cumbersome code, but here's a working solution: \documentclass{article} \usepackage{multido,totcount} \multido{\i=1+1}{3}{% \begingroup\edef\x{\endgroup \noexpand\newtotcounter{compteurCh\romannumeral\i}% }\x } \begin{document} \thecompteurChi ...


2

I don't see any real problem with your code. There is \newtotcounter that creates a counter and registers it with totcount in one go, which will save some coding. Here is a complete document showing it working. \documentclass{article} \usepackage{multido,totcount} \newcounter{AuxCounter} \renewcommand{\theAuxCounter}{\roman{AuxCounter}} ...


2

There is a package called PythonTeX by Geoff Poore which integrates Python code in a .tex file and allows you to typeset the output of the Python code. While I haven't written your problem specifically, here's a script which generates 10 random quadratic equations and typesets them, along with the answers. One could store the answer strings in a list and ...


2

Here is the main file: \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{mathtools} \setlength{\parindent}{0in} \setlength{\parskip}{0.1in} \newlength{\qwidth} \setlength{\qwidth}{0.5\textwidth} \newcommand{\qhead}[2]% #1 = batch, #2 = version {\framebox[3in][l]{\rule{0in}{0.25in}\tiny name}\hfill ...


2

This just shows an alternative formulation for parsing the tuples which adapts some of the ideas presented in other answers. If the (badly named) macro dotuples is called like this: \dotuples{x,y,z}{\n}{1,2,3 | 4,5,6 | 7,8,9 | 10,11,12} Then \x0 is defined as 1, \y0 is defined as 2 and \z0 is defined as 3. This continues over all the tuples, so \z3 is 12. ...


2

The problem is that you need to force \tmp to be expanded as a sequence of letters whereas at the moment \charperline is seeing it only as a single token. I am sure that there is an approved way of doing this but here is a way that I have used to get around similar problems in the past: Edit As percusse says in the comments, a better solution is to use: ...


5

An implementation with expl3, where I define a \newdrawingcommand that takes as arguments a command name and the replacement text; optionally a command based on \foreach can be added, for greater flexibility. In the replacement text, the various points can be referred to by \x and \y; these macros are available only there (they won't clobber other existing ...


6

You can use the macro \scanargs \macro x1,y1 x2,y2 ... xn,yn; and then you can use the scanned arguments in your \macro in the form \x1, \x2, ... \x9, \y9, but \x{10}, \y{22} etc. I show the example using your example: \documentclass{article}\usepackage{tikz} \newcount\tmpnum \def\scanargs #1#2;{\let\tmp=#1\tmpnum=0 \scanargsA #2 {},{} } \def\scanargsA ...



Top 50 recent answers are included