Linked Questions

1
vote
2answers
552 views

Default value of command [duplicate]

I have the following command: \newcommand{\plusbinomial}[3][2]{(#2 + #3)^{#1}} This command takes 3 parameters and the default value of the first parameter is 2. If I don't want to use the default ...
0
votes
0answers
187 views

how to define a newcommand with several optional arguments? [duplicate]

Possible Duplicate: More than one optional argument for newcommand Is it easy to define a new command with several optional arguments, that one would call as follows : \mycom[opt1=2,opt2=...
11
votes
3answers
2k views

Defining a list environment with multiple optional arguments

I'm trying to define a list environment with multiple optional arguments and with a default values for those arguments. For example, creating a new environment with a name newenv, which accepts two ...
7
votes
7answers
2k views

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 ...
7
votes
4answers
392 views

Special macro definition (2opt, 1mand)

How can you define a macro \cmd in TeX primitives using two optional arguments (and a mandatory one) that fulfills the property that calling \cmd[opt]{mand} is equivalent to \cmd[][opt]{mand}. Yet, I ...
4
votes
3answers
255 views

Arguments to Commands: […] vs {…}

Perhaps this is something that has been answered before, but a cursory search didn't turn anything up. Is there any logic to how commands take arguments? Some things want the arguments to the ...
3
votes
3answers
444 views

Giving an optional parameter a default value

so I have this: \newcommand{\boxx}[2]{ \colorbox{white}{\begin{varwidth}{\textwidth} % Heading \colorbox{green!30}{#1}\\ % Content \fcolorbox{green}{yellow}{\begin{...
3
votes
2answers
361 views

How to replace a command with a dummy one?

On the question How to create a dummy generic environment replacement? I learned how to replace an generic envinronment with a dummy one. Until now I had success replacing then as replacing \...
2
votes
1answer
970 views

Pass multiple options to \newcommand

I have defined a new command for each of the team members in my project group to add individual todo-notes with different color and name. Now I would like to add another option, but is having trouble ...
2
votes
1answer
320 views

LuaTeX: Call a Lua function with two optional arguments

I've read More than one optional argument for newcommand and I chose the answer with xargs. I would like to pass a second optional argument to the Lua function. But the first of the two commented \...
1
vote
1answer
276 views

How to define an optional argument?

cventry receives 6 arguments. I want to make the 5º argument optional. However, I receive the following error: Paragraph ended before \cventry was complete. <to be read again> ...
1
vote
2answers
153 views

Unexpected output of \textcite with shorthand

I want to use shorthand to abbreviate the author of a publication. Unfortunately, \textcite doesn't produce the expected output. MWE: \begin{filecontents}{myfile.bib} @book{goossens93, author ...