Linked Questions

5 votes
5 answers

How to define a command that takes more than 18 arguments [duplicate]

This question is based on this answer. It is a continuation of my previous qestion regarding list of values in latex. According to first link there is a limitation on the number of arguments I have ...
  • 153
0 votes
1 answer

10 parameters separated by comma. How can I do it? [duplicate]

\def\g(#1,#2,#3,#4,#5,#6,#7,#8,#9,#10){(#6)*exp(-(#2)/(#7))+((#6)**2)*exp(2*(-(#2))/(#7))*(#9)*exp((#4)/(#7)}% \def\f(#1,#2,#3,#4,#5,#6,#7,#8,#9,#10){1+2*(#6)*exp(-(#2)/(#7))+((#6)**2)*exp(2*(-(#2))/(...
1 vote
0 answers

How to handle more than 9 parameters in Kiviat Diagrams? [duplicate]

This email is regarding Solution 2 mentioned in this post to draw Kiviat Diagrams. This Solution is working perfectly upto 9 axis. But when we make number of axis as 10, it's giving error as : "You ...
  • 2,901
1 vote
0 answers

Writing macros with a large number of arguments [duplicate]

How can I write a macro with more than 10 arguments?
43 votes
10 answers

Is it possible to connect a database to LaTeX to produce data-driven documents?

I'm starting to write a LaTeX-based reference manual, and have realised that a lot of my needs could be solved by writing a database and then producing the reference manual from that. Lots of my pages ...
  • 7,052
8 votes
7 answers

newcommand with comma separated argument, and optional arguments

I want to define a command (not with \def) the simplest possible way that it takes arguments separated by a comma, supports an optional argument (the first one). maybe another solution with extra ...
  • 1,770
14 votes
5 answers

A macro that conditionally disregards the need for one of its arguments

Let's suppose I want to write nested equations that contain a fair few nested parenthetical/delimiter characters, like (), [], {}, ||, and perhaps others. Suppose too that I think these things look ...
  • 3,486
8 votes
4 answers

How to access i'th argument of a macro?

How can I access the i'th argument of a \newcommand declaration via an iteration variable? Assume I want a command \foo like: \newcommand{\barr}[1]{argument 1 is: #1} \newcommand{\foo}[6]{ \...
  • 1,651
9 votes
3 answers

How to define _or_ redefine a command (mixing \providecommand + \renewcommand)?

In some situations I wish there was a way to define a command \tmp so that if \tmp does not exist: Defined \tmp if \tmp does exits: Redefine \tmp My current approach is simply to use either \...
  • 1,439
9 votes
2 answers

Macro with more than 9 arguments

Consider the following example: \documentclass{article} \usepackage[ a4paper, hmargin = 2.4cm, vmargin = 3cm ]{geometry} % \usepackage{xskak} % https://...
5 votes
3 answers

Generate a table with 19 arguments using key-value interface

I'm doing my bachelor thesis, and need to make a table with lots of data. I want to make a macro for that table, since I'm going to use it a few times. Considering egreg's answer in this question, ...
6 votes
2 answers

Why do I get "! You can't use a prefix with `the character 0'." when using \ifnum?

Using a pgffor loop, I run through a comma-delimited list to separate the CMYK values. I think the problem is in my \ifnum comparison. I am getting an error. Obviously I simplified the code to keep ...
5 votes
3 answers

How to generate a matrix from an arbitrary sequence of arguments?

This answer shows me how I can handle an arbitrary number of arguments. I have adapted it a bit to my purpose: \usepackage{pgffor} \newcommand*{\twolinematrix}[1]{% \foreach \firstrowelement/\...
  • 3,136
7 votes
2 answers

How to use variables inside a command when generating a table?

I'm not sure about the question, since I do not really understand why it fails. I tend to use commands to generate my tables, and when I use the #1 style of accessing the arguments it works. But now ...
  • 1,285
9 votes
2 answers

Error when using defs inside a macro to write a row in a table

For the following MWE \documentclass{article} \newcommand{\cmd}[5]{% \def\tA{#1}% \def\tB{#2}% \def\tC{#3}% \def\tD{#4}% \def\tE{#5}% \tA & \tB & \tC & \tD & \tE \\ } \...
  • 16.7k

15 30 50 per page