Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [arguments]

The {argument} tag is used for specific questions about macro parameters and arguments.

3
votes
2answers
158 views

For the life of me I can't find the runaway argument here — but then I'm very new to all this

\documentclass[11pt, oneside]{article} \usepackage{geometry} \geometry{a4paper} \usepackage{graphicx} \usepackage{amssymb} \usepackage{arydshln} \usepackage[table]{xcolor} \usepackage{pifont} \begin{...
0
votes
1answer
26 views

Problem calling \creflabelformat from a command

I'm using the cleveref package with some customizations, using \creflabelformat. Because cleveref should be the last package to load, and because the customization commands should come after cleveref ...
2
votes
1answer
61 views

Using exam question counter as an argument

I am trying to use the exam class to create a study guide for my students that has all of the answers at the end of the document. I would like to have the answers automatically labeled by question ...
5
votes
1answer
74 views

Strange error for passing parameter to forestset to draw tree

I am trying to draw a simple probability tree, where the probabilites could sometimes be fraction or decimals., this means, I will have to adjust the spacing. So I tried the below code. This produces ...
3
votes
1answer
34 views

Variable expanding inside BibLaTeX \addbibresource

I am working with a custom class provided by my university for the typesetting of thesis. The class automatically includes BibTex references in the document. I want to modify the class to make it work ...
2
votes
1answer
50 views

Sine squared with parentheses for argument

I have a number of trig functions raised to some powers, and the arguments are often different from just t \sin^2{\frac{2\pi}{T}t} for example Now, I would like to get the argument to be in ...
4
votes
2answers
123 views

Formatting phonenumbers with phonenumber-package and macros as argument (expand-problem)

I try to use the phonenumbers-package to format phonenumbers. As argument I want to use a macro (in the actual document the macro will be defined with pgfkeys!) What I tried so far: \documentclass{...
7
votes
2answers
157 views

How to define a comma separated list of arguments for includegraphics

I have a large set of pictures, and I want to apply predefined settings to each using the optional argument of the \includegraphics macro from the graphicx package. I would like to define the ...
4
votes
2answers
135 views

Plain LuaTeX: Detecting if displaymath is ended by $$ or \Ustopdisplaymath

In the TeX Book (chapter dirty tricks) there is mentioned a way to left align displaymaths. https://arxiv.org/macros/cp-aa.tex A macro \displaysetup whose argument is delimited by $$ is used. So it ...
3
votes
0answers
42 views

Duplicating a new line in a new command

I'm trying to write a new command which will duplicate the last line. I don't want the content duplicated. I just want the template for the last line line duplicated so I can enter new data to the new ...
2
votes
2answers
49 views

Error when using command as parameter for an other command

I want to use 2 seperate commands to first execute a calculation on a number and then displaying the number with plus or minus using following code. When trying to run it I get various errors. I ...
7
votes
1answer
126 views

Optional args for TikZ style

I have a defined a TikZ style "midcircle" that decorates a path with, say, a small circle in the middle (with the decorations.markings library, setting "pos=0.5"). E.g. \draw (0,0)edge[midcircle](1,0)...
1
vote
1answer
92 views

LaTeX Grammar and Nesting Rule

Is there any grammar and rule describing the allowed nestings and combinations and the allowed format of the arguments in LaTeX? E.g. \section{\verb|mySec|} \section{\begin{huge}mySec\end{huge}} \...
2
votes
1answer
34 views

How to add an argument to a \cline-like macro?

I want utility macros that allow me to change (a) the thickness and/or (b) color of \hlines or \clines in tabulars. I want to do so without redefining \arrayrulewidth but rather by modifying the ...
3
votes
1answer
60 views

How to pass tikz code as an argument?

I want to prepare an environment to show a view of a display and use some tikz code as an optional argument to mark some things on it. The first "screen" shows result with hardcoded nodes but I need ...
2
votes
1answer
69 views

LaTeX Nesting \verb in \section

Why is \section{\verb|mySec|} invalid LaTeX code.
6
votes
1answer
143 views

Why does \renewcommand{\A}{\B} change the value of \C? when \A, \B, and \C are arguments?

I'm very puzzled by the effect of a \renewcommand with two macros as arguments that appears to affect the value of a third macro. This all occurs within a command to which all three macros are passed ...
1
vote
2answers
77 views

Fractions and counters in a \foreach list of pairs

I'm trying to create a macro that will take a list of pairs as an argument in order to draw a pie chart. I'm trying to make it so that portions of the pie are specified as a fraction less than 1. Here'...
3
votes
1answer
63 views

TikZ PGF - Minus sign being interpreted as a unit of measure

I'm trying to write a macro that draws a number line given a number of tick marks to use. However, there are a couple of spots in the code where I try to do arithmetic using the argument of the ...
4
votes
1answer
51 views

tikz : Specify a percent parameter in a path

I am trying to define a style to draw a bend line from one shape's south to another shape's west \documentclass[border=5mm, convert, usenames, dvipsnames]{standalone} \usepackage{tikz, pifont, xcolor}...
4
votes
2answers
89 views

Define macro whose argument is a word

I need to define a macro whose argument is the next word (the first character after the word should be a blank space, the end of the line, or a punctuation mark from . , : ; ! ?. For example, let's ...
2
votes
2answers
57 views

latex table variable/optional many arguments

I would like to create a new tabular environment that allows me to add n (1-10) arguments without adding extra columns (such that both examples below work). Here is my code: \documentclass{article} ...
1
vote
1answer
84 views

Generate math symbols from argument

I have been trying to create a small latex math symbol reference. My list will require repetition of lines like \textbackslash lfloor - $\lfloor$. I want to create a command that takes in one argument ...
2
votes
3answers
55 views

Custom command with addressable arguments

I know about \newcommand[<arg_num>]{#1 ... #n} to define a simple macro with up to nine arguments. (More if you link multiple newcommands together) I recently started to look at xparse for ...
8
votes
4answers
338 views

Runaway argument? with \newcommand[2]

I have a date (in the format YYYY.MM.DD) and a time (format HH:MM). From these, I want to compute a kind of TimeStamp/Total of minutes. \documentclass{article} \makeatletter % Timestamp \...
1
vote
1answer
56 views

Runaway argument? with \def

I have a time value in the format HH:MM (i.e 03:00). I need to compute the TotalMinutes of this time (expected result 180). My current code is \documentclass{article} \makeatletter \newcommand{\...
0
votes
1answer
214 views

Argument of \language@active@arg~ has an extra } when long caption

Here is my Preamble: \documentclass[letterpaper, 10 pt, conference]{ieeeconf} \overrideIEEEmargins \usepackage{graphics} \usepackage{graphicx} \usepackage[spanish]{babel} % spanish \...
3
votes
1answer
45 views

newcommand says missing number

I plan to write a command which rounds a number with n digits. n is an optional argument and it is 2 by default. However, I keep receiving error message: Missing number, treated as zero. Let's see ...
0
votes
0answers
44 views

Is there a list of ALL standard commands of LaTeX 2e? [duplicate]

I am looking for a list of all commands available in LaTeX 2e, commands available without packages. I am creating a parser for latex therefore I need to know all commands and the corresponding ...
1
vote
1answer
40 views

\IfStrEqCase redefines #1

What is the meaning of #1, #2, etc in the optional parameter of \IfStrEqCase? This required me to use a ##1 instead of #1 within \pgfplotsinvokeforeach which I was not expecting. I would have ...
0
votes
0answers
39 views

How to pass argument to an environment in command form

I have defined \newenvironment{cvolist}[1][2.25cm]{\setlength{\pwd {#1}\enumerate} {\endenumerate \aftergroup\ignorespacesafterend\vspace{-1.5em}} That way I can have a list in an environment (this ...
3
votes
2answers
56 views

xpretocmd: Why are my arguments not working?

I just tried to keep track of my current chapter name, because I use the first letter for certain namings in my document, so I wrote this code to save it: \documentclass[12pt,a4paper]{scrreprt} \...
1
vote
1answer
45 views

How to enter multiple arguments in the interactive math mode

I've defined a new command in the document's preamble. For the sake of this question the following (tested!) example: \newcommand{\multipleargs}[3]{{#1}-{#2}-{#3}} Using [cmd]-M on MacOS I want to ...
6
votes
2answers
169 views

Variable argument macro to define splitting polynomial

I need a macro that behaves the following: \mpoly{x}{1}{2} outputs (x+1)(x+2) \mpoly{x}{1}{2}{3} outputs (x+1)(x+2)(x+3) \mpoly{x}{1}{2}{3}{5} outputs (x+1)(x+2)(x+3)(x+5) and so on. I am not at ...
0
votes
0answers
43 views

Mathpartir: How to insert “\\” between entries with macro?

I'm using a tool to generate large amounts of LaTeX, which contain inference rules that I'm typesetting using mathpartir. Below, I've got a MWE that's very similar to the code I've got generated. ...
4
votes
2answers
113 views

Use N type for own macros

Background In LaTeX3 I’m programming some macros to store and read contents from a variable like \tl_set:Nn does. An thus I’m generating variants using the N type, which causes a warning. The warning ...
16
votes
2answers
460 views

NewDocumentCommand: Why can't I put args on an own line?

I encountered a peculiarity concerning NewDocumentCommand arguments. In a case where I had real long names in the arguments, I wanted to put them each on its own line. The first ones are OK, the 2 ...
2
votes
1answer
56 views

Regex within new command to prevent making tooltips of tooltips

I'm making a document where I want the definitions of entries in the glossary to appear as tooltips. The tooltip code itself is from the answer: Can't embed hyperlink references in a tooltip ...
1
vote
2answers
58 views

why is the directory trimmed from my path argument in includegraphics?

Hi community I have a weird problem. It seems that includegraphics won't accept the entire argument, it always trims off the directory part! The argument was manipulated and concatenated in another ...
2
votes
1answer
158 views

How to pass literal comma as argument

I am using minted for code highlighting. I have defined a new minted file format, with the code \newmintedfile[plaintextfile]{text}{ ... breakafter=<values to break lines on>, ... }...
4
votes
4answers
389 views

Detect no argument in \newcommand

I wonder if there is a way to create a command which can discriminate when there is an argument or not. I don't mean empty argument, I mean no argument at all. Here an example \newcommand{\mycommand}...
2
votes
1answer
78 views

Using greek characters in commands' arguments without braces

First I want to make clear that I'm a LaTeX beginner, so I'll be detailed because I just have no clue about the origin of my problem. I'm using TeXstudio 2.12.6 I'll provide context: I have been ...
0
votes
1answer
96 views

How to know all the optional arguments of Latex commands\environments? [duplicate]

For external packages CTAN provides the needed documentation, however, for built-in Latex commands I am not aware of any proper documentation except for The (not so) short introduction to Latex which ...
2
votes
2answers
73 views

Using a line number reference as an argument for footnote

The \footnote{text goes in here} command takes an optional argument for numbering, so if I want to skip straight to footnote #5 or override the default numbering, I can do that: \documentclass{...
1
vote
1answer
57 views

Bugs in conditional structure in a newcommand definition with optional arguments

I am trying to create a new command for add a caption and/or the label to an equation. The not optional parameter is for the text of the equation and first optional parameter is for the label, the ...
2
votes
2answers
68 views

Probably just another gdef-expansion problem

In continuation of the post, I try to make the following (simplified) code to work. \timedelta uses 2 arguments. Using a \gdef as the first argument is Ok. Using a \gdef as the second argument is Nok....
2
votes
2answers
314 views

How can I make a list with variable parameter size inside of a custom environment?

I have a custom environment that I am using as part of a template. Right now this is the code for the template file. %----------------------------------------------------------- % customtemplate....
2
votes
2answers
78 views

Probably a gdef-expansion problem, but how to solve?

Trying to integrate the answer of this post it into my real code, I face the error Argument of \timedelta@i has an extra } when calling the proposed method. Upto now, I've not been able to fix it. ...
0
votes
1answer
65 views

Macros with 0, 1 or 2 arguments

Is it possible to build a macro accepting 0, 1 or 2 arguments ? Why ? I want to have the following functionalities. \exercice will print Exercice alone. \exercice{2} will print Exercice (2 pts). \...
0
votes
1answer
128 views

expandafter and csname

I was recently looking for the creation of commands that use the name of another command and I recently discovered \expandafter and \csname instructions. I manage to create simple one using these ...