2

The \binom command is an example of a LaTeX command which accepts two inputs.

We have the following example:

\binom{n+1}{2k}

What is an example of a LaTeX command with three or more parameters?

2
  • 2
    Do you mean commands in the LaTeX kernel or do you want to include commands from any of the hundreds of packages? May 24, 2023 at 2:25
  • @LaTeXereXeTaL presumably any package as the \binom example in the question is not defined by the latex format May 24, 2023 at 8:34

4 Answers 4

12

As of version 2022-11-01, patch level 1, the LaTeX "kernel" contains

  • 10 instances of #9
  • 30 instances of #8
  • 40 instances of #7
  • 86 instances of #6
  • 172 instances of #5
  • 407 instances of #4
  • 892 instances of #3

This translates into (very!) roughly 5, 10, 5, 23, 43, 117, and 242 kernel commands taking exactly 9, 8, 7, 6, 5, 4, and 3 arguments, respectively. Of course, many (most?) kernel commands that take 5 or more inputs are not user-level commands. Instead, they are part of an erector set of tools meant to create further tools, including user-level commands.

To give an example of a user-level command provided by one of the myriad of available LaTeX packages, consider \DeclarePairedDelimiter, which is provided by the mathtools package. E.g.,

\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}

And an example from the cleveref package:

\crefname{prop}{proposition}{propositions}

Of course, I make no claim whatsoever that these two commands are somehow representative of the vast number of LaTeX commands out there that take exactly three arguments.

2
  • 1
    It is nice to see someone use the word "Kernel" outside of the context of documentation for the Linux operating system. In general, it is useful to the word "Kernel" within the context of any kind of computer programming to mean, "the core functionality of a system without any additional add-ons or seldom used libraries, features, packages, etc..." or maybe "The main thing without any extra bells, whistles, or buttons." May 25, 2023 at 19:57
  • 2
    @SamuelMuldoon looking in ltnews I see "LaTeX Kernel" being used a far back as the June 1995 issue, so almost as long ago as "Linux Kernel" (1991, I think) May 26, 2023 at 1:24
9

The question is rather under specified, but for example

\newenvironment has 0 parameters considered as a tex macro (the same is true of \binom)

\show\newenvironment shows

> \newenvironment=macro:
->\@star@or@long \new@environment .
l.4 \show\newenvironment

But considered as a latex command it has 3 or 5 depending if you count optional parameters, or 4 or 6 if you count *

\newenvironment{foo1}{start}{end}

\newenvironment{foo2}[2][default]{start}{end}

\newenvironment*{foo3}[2][default]{start}{end}
4
  • Is the following what you meant by the phrase "under-specified question". Would you consider a question q to be under-specified if and only if for any a if a is an answer to question q, then there exists α such that α is a correct answer to question q and a ≠α. For example, if I asked, "What is the title of the last book I read" the answer might be Dance Me Outside. The problem with that answer is that a copy of the book with GPS coords in Canada on May 25th 2023 is not the same book. May 25, 2023 at 23:49
  • In my earlier very long comment, my point was to prove that there does not exist a unique correct answer to most questions. It almost makes no sense to say, "this is a bad question, because the correct answer is not unique." May 25, 2023 at 23:51
  • @Carlisle If you think that an answer a is unique, I can usually cook up an answer α which is derived from answer a and answer α has the same semantic meaning, but is slightly different. Because they are different in some way, it cannot be the same answer. May 25, 2023 at 23:53
  • @SamuelMuldoon the problem is not that there is more than one answer, it's that there isn't really any answer as the terms in the question are undefined. May 26, 2023 at 1:13
1

Think at the package tcolorbox that ha a lot ov parameter in his implementation. You ca specify in Your program a few of this in extenso like in this example:

\documentclass[a4paper]{article}
\usepackage[skins,breakable]{tcolorbox}
\usepackage{lipsum}
\begin{document}
    %\flushbottom
    \lipsum[6]
    \begin{tcolorbox}[title={\huge Prova di titolo},% <-- commenta se npn vuoi il titolo
        colbacktitle=cyan,
        boxsep=5pt, 
        left=35pt, 
        right=35pt, 
        top=15pt, 
        bottom=15pt,
        before upper={\parindent 0pt},
        breakable=true,
        colback=cyan!20,
        %empty % <-- decommenta se non vuoi fondo e cornice
        ]
    \lipsum[1][1-4]
    \end{tcolorbox}
    \par
    \begin{tcolorbox}[title={\huge Prova di titolo},% <-- commenta se npn vuoi il titolo
        colbacktitle=gray,
        boxsep=2pt, 
        left=5pt, 
        right=5pt, 
        top=5pt, 
        bottom=5pt,
        before upper={\parindent 0pt},
        breakable=true,
        colback=gray!10,
        %empty % <-- decommenta se non vuoi fondo e cornice
        ]
        \lipsum[2][3-7]
    \end{tcolorbox}
    \par
    \begin{tcolorbox}[title={\huge Prova di titolo},% <-- commenta se npn vuoi il titolo
        colbacktitle=blue,
        left skip=30pt,
        right skip=30pt,
        coltitle=yellow,
        boxsep=2pt, 
        left=0pt, 
        right=0pt, 
        top=5pt, 
        bottom=5pt,
        before upper={\parindent 0pt},
        breakable=true,
        colback=cyan!10,
        %empty % <-- decommenta se non vuoi fondo e cornice
        ]
        \lipsum[2][1-4]
    \end{tcolorbox}
    \par
    \begin{tcolorbox}[%title={\huge Prova di titolo},% <-- commenta se npn vuoi il titolo
        colbacktitle=blue,
        left skip=30pt,
        right skip=30pt,
        coltitle=yellow,
        boxsep=2pt, 
        left=0pt, 
        right=0pt, 
        top=5pt, 
        bottom=5pt,
        before upper={\parindent 0pt},
        breakable=true,
        colback=cyan!10,
        %empty % <-- decommenta se non vuoi fondo e cornice
        ]
        \lipsum[2][1-4]
    \end{tcolorbox}
    \lipsum[9]\par
    %\pagebreak
    \lipsum[8]
\end{document}

Output:

enter image description here

or define in the preamble a new command with 5 or 6 paramenters and then You call in the body of the program the box You need with the appropriates parameters. The result is the same but I think the first method is better and more easy. Other thing if You want to draw a regular poligon with his circle around: three parameters, radius, n of vertex, starting angle. If You want add a forth parameter: edges color.

1
  • 3
    This does not really count as multiple arguments though. Things like colbacktitle=gray or boxsep=2pt are called options in tcolorbox and the full list of options is a single argument for the \begin command.
    – Marijn
    May 24, 2023 at 14:21
1

Funnily, newcommand itself takes 4 arguments:

\newcommand{name}[num][default]{definition}

If you consider the * in \newcommand* an argument, it's 5.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .