Questions tagged [arguments]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
93 views

Raw postscript (!ps) do not expand in argument of \psaxes

The (!ps) syntax is supposed to expand to a pair of coordinates by executing some raw postscript code. In the following example it works well in argument to \rput but not with \psaxes; why is it so? \...
3
votes
1answer
46 views

Processing separated list of separated lists

Is it possible to create function foo that takes list of arguments and this argument is also a list, e.g. to require the following semantics \foo[x:1,z,y:2], i.e. it takes three comma separated ...
3
votes
1answer
37 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 ...
3
votes
1answer
60 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 ...
3
votes
1answer
159 views

How to create a table macro that takes more than 10 arguments

I want to create a macro that creates several tables. In the example below, the command that creates the tables \chungeltable will use one argument for each column in the table (More than 10 columns). ...
3
votes
2answers
132 views

how to expand a keyval argument

I'm trying to expand a value for an argument which will be the range of pages included in the document, but I can't figure out how to do that. At first, I was getting ERROR: Missing = inserted ...
3
votes
1answer
62 views

Break newcommand arguments by '/' for different use?

I'm creating a presentation with a lot of frames with one figure per slide. So instead of having hundreds of the same code over and over again I created a simple \newcommand for it where one of the ...
3
votes
2answers
491 views

Force expansion of counter value in command argument

In the following MWE I would like to expand both \envnum as well as \itemnum while passing them to \cmdwithexpandedargs but only the first one got expanded. Note the different output between \wlog ...
3
votes
1answer
107 views

Environment with optional argument configuration in TeX4ht

I am tried to create configure the below environment with optional argument in TeX4ht \newenvironment{proof}[1][Proof]{\textit{#1}:\ \ignorespaces} {} MWE \documentclass{...
3
votes
1answer
80 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 ...
3
votes
0answers
52 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
266 views

How do you write a macro that takes arguments containing paragraphs?

I'm trying to write a macro that takes arguments containing paragraphs. If you write a normal macro and one of its arguments contains a paragraph, it will break: \documentclass{article} \usepackage[...
2
votes
2answers
139 views

Invoking \input without arguments/parameters

I am wondering what the effect is of invoking \input without any arguments/parameters followed by an empty line: Code: .... \input ....
2
votes
1answer
124 views

LaTeX Nesting \verb in \section

Why is \section{\verb|mySec|} invalid LaTeX code.
2
votes
2answers
53 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 ...
2
votes
3answers
69 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 ...
2
votes
2answers
52 views

How to undefine a command with arguments?

I am trying to define \d as \delta in mathmode, but apparently \d is defined as a dot below and it needs an argument: \d{a} would give an a with a dot below. How can I do this? Here are the packages I ...
2
votes
1answer
314 views

What is this \newcommand argument? [duplicate]

\newcommand*{\name}[1][C]{% I have come very familiar with \newcommand however, I came across this line of code and i do not know what the [C] is for.
2
votes
2answers
69 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} \...
2
votes
1answer
294 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>, ... }...
2
votes
2answers
431 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
68 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} ...
2
votes
1answer
64 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 ...
2
votes
2answers
73 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
1answer
63 views

\environment Definition with Parameter

I digged around and found no answer to the following problem: I defined the environment myroman but using I failed. It is not clear for me why. % \documentclass{scrartcl} \usepackage{enumitem} ...
2
votes
1answer
79 views

Check for sufficient number of tokens left

I want to use a command that takes a large number of arguments, possibly more than left in the input stream. \def\consumeseven#1#2#3#4#5#6#7{} \consumeseven \space In this scenario \consumeseven ...
2
votes
1answer
125 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 ...
2
votes
1answer
160 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 ...
2
votes
1answer
70 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 ...
2
votes
1answer
92 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 ...
2
votes
2answers
108 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{...
2
votes
2answers
88 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. ...
2
votes
1answer
209 views

\IfNoValueTF - How to force “no value” if there (are brackets but there) is no value for an argument

This code uses LaTeX3, the xparse-package and in particular the \IfNoValueTF command as explained in Will Robertson's answer to the OP "Different command definitions with and without optional argument"...
2
votes
1answer
84 views

Print counter received as argument

I'm trying to print a counter whose name I receive in the argument #1. I tried \the#1, which doesn't work and also tried the solution given in this answer, which gives me the error "You can't use \let ...
2
votes
1answer
86 views

Using an undefined token as argument

I have a (probably) quite uncommon problem. Pseudocode: \def\head{\titel } % \titel = undefined \func{\head} % func is defined and handles \titel without any issues \func{\titel} % throws an ...
2
votes
1answer
510 views

Underscores in function arguments seem to change file names

I have been trying to pass a file name that contains underscores to a couple of nested commands. Since escaping each and every _ isn't really an option, I thought a group \catcode_=12 (had to remove ...
2
votes
1answer
57 views

Calling macro from a macro breaks argument formatting causes odd environment behavior

I'm trying to write a little Latex package to learn more about Tex and to help me out with writing long and annoying proofs for a course by creating macros to retrieve rule names from a table given ...
2
votes
1answer
334 views

Referring to delimiter separated arguments in new commands

Another question gave me hope that there is an elegant way (without using additional packages) to refer to a comma separated argument in \newcommand, maybe something like (just a guess, not tested): \...
2
votes
1answer
537 views

TikZ Macro With Multiple Arguments

I am trying to create a simple (hopefully) macro for myself that will make drawing number lines with TikZ more efficient. I can make such lines manually, but since I will need so many similar pictures,...
2
votes
1answer
179 views

How to use \makebox in \tl_map_function?

While trying to answer LaTeX for music I came to the problem that I can’t use a \makebox inside the function for a \tl_map_function:NN call. The problematic line is commented out in the following code....
2
votes
1answer
208 views

LyX | change macro argument order

In LyX, is it possible to change the order of required and option arguments of a macro? I want to make the option argument come after the required argument in this macro. If it's possible, how can I ...
2
votes
1answer
155 views

Followup on \def@ [closed]

Trying to understand \def\def@ sintax primitives As a followup to this question, I'm currently working on a BA, using a set of definitions I found on a template's .cls file. Currently: % The year ...
2
votes
0answers
395 views

How to pass a color as an argument [closed]

Before explaining my problem, sorry if this is a repeated question, but I was not been able to find one answered/asked question in which the problem was the same as mine. In order to create a ...
2
votes
0answers
199 views

change or patch a command using parameters

Assume I want to use a command \foo from some package takes a number of arguments, let's say #1 to #5. I want to change the behavior of \foo in ways that might involve these arguments. For example ...
1
vote
2answers
112 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'...
1
vote
2answers
159 views

Definition of a macro with multiple arguments and usage of \csname

Why does the following code not work ? \Requirepackage{amsthm} \renewcommand\newtheorem[2]{% \NewEnviron{\csname #1\endcsname}[1]{% ##1 : \BODY } } I have seen examples of the use of ...
1
vote
1answer
103 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}} \...
1
vote
1answer
141 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{\...
1
vote
2answers
64 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 ...
1
vote
1answer
336 views

Passing arguments to LuaLaTeX with LuaSQL [duplicate]

I am using LuaLaTeX with LuaSQL and I have two files which are test.tex and test.lua. When I compile with lualatex test.tex, first test.lua is ran and it reads user values from my database for rows ...