Questions tagged [parameters]
{parameters} is predominately used for questions about arguments of macros, packages etc.
201 questions
9
votes
2
answers
401
views
What are the exact rules about spaces surrounding macro parameters/arguments?
To my surprise, the TeXbook (page 203) mentions that the first argument in
\cs AB {\Look}C${And\$ }{look}\$ 5.
where \cs is defined as
\def\cs AB#1#2C$#3\$ {#3{ab#1}#1 c##\x #2}
is \Look, and not [...
2
votes
0
answers
70
views
How do I pass a TeX box to \startuseMPgraphic (instead of just the box-register number)?
I’m trying to feed an existing TeX box into a MetaPost graphic so that I can draw it as a page background. When I send the box as a parameter, MetaPost only receives the register number (e.g. 437), ...
9
votes
4
answers
405
views
How to use `\let` with body-capturing inside `\NewDocumentEnvironment`?
As I update an old project to work with xparse, I am seeking to deploy \NewDocumentEnvironment in place of environ 's \NewEnviron and want to replicate the "body-capturing" functionality of ...
0
votes
2
answers
211
views
design a \Command that allows a Dual-parameter \Command passing its return into another \Command as one (which might be a label) of its inputs
Design: a (La)TeX command (maybe look like this \passresult{\outercommand}{\innercommand}{param1}{param2}),
which pass the return of a dual-parameter \innercommand{param1}{param2} into another \...
4
votes
2
answers
254
views
Confused about optional argument with \NewDocumentCommand result
Given this MWE:
\documentclass[12pt]{report}
\usepackage{fontspec}
\setlength{\parindent}{0pt}
\NewDocumentCommand{\testone}{m m m }{%
\if\relax\detokenize{#2}\relax
\textbf{#1}\dotfill#3\...
1
vote
1
answer
104
views
Detect if a parameter passed to command is a mathematical formula
I'm defining a command which displays braced paragraphs and an isomorphism between them, but I want the command to recognize if one of the paragraphs is something purely mathematical and therefore not ...
0
votes
2
answers
238
views
Check if parameter in command is declared/empty in LuaLaTeX
I'm trying to check if a parameter is declared/empty using lua. So far I wrote the following MWE:
\documentclass{standalone}
\def\var#1{\def\@var{#1}}
%\var{Hello world}
\begin{document}
\@var --...
4
votes
2
answers
436
views
How to get lipsum to accept a count as a parameter
I get the error: Missing number, treated as zero. trying to pass a counter to \lipsum. I feel like I might be forgetting some basic technique here, but I've unsuccessfully scoured the site to find out ...
0
votes
1
answer
714
views
Pandoc CMD call tex template and pass variables
I'm trying to pass variables to a tex template to generate a PDF with those values via pandoc.
This is my template:
\documentclass[15pt]{article}
\usepackage{sectsty}
% Margins
\topmargin=-0.45in
\...
3
votes
2
answers
395
views
What is the difference between {} and [] parameters? [duplicate]
Most commands use {} to receive parameters. For example $\binom{6}{2}$ typesets the binomial coefficient 6 choose 2. However \sqrt receives a [] parameter as its first parameter. For example $\sqrt[3]{...
0
votes
0
answers
30
views
NewDocumentCommand inside NewDocumentEnvironment, and an illegal parameter issue [duplicate]
I am trying to write a macro like this:
\usePackage{xparse}
\NewDocumentEnvironment{myenv}{}
{
\NewDocumentCommand{\myarrow}{g}{\IfNoValueTF{#1}{\to}{\xrightarrow{#1}}}
\begin{enumerate}
}
...
0
votes
2
answers
171
views
Taking in optional boolean flags in a macro without expl3
I want to create a macro \verticalStep which will produce a vertical skip of fixed length, and take two optional arguments, negative and small.
So for you could use
\verticalStep for a standard ...
0
votes
0
answers
72
views
Differentiate package parameters for different versions of package
I have 2 versions of TeXLive:
2020 at home (as far as I remember)
2021 at work
I have a document with string:
\usepackage[group-separator = \;, decimalsymbol=comma]{siunitx}
It works at home, but ...
1
vote
0
answers
69
views
Use parameters of latexcommand in two .tex files
Im quite new to Latex and haven't found anything yet to help me with my problem. My problem is that i want to write the output of a command to another .tex file.
I want to use the custom command \...
2
votes
2
answers
498
views
TikZpicture as newcommand with more than 10 parameters
I would like to build several Pareto diagram figures using a \newcommand, like this:
\documentclass[11pt]{amsart}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{xfp}
\...
1
vote
1
answer
160
views
Specifying the Positioning Parameters for an egreg Two-Color Lettrine
This post refers to a two-color lettrine provided by egreg in Centering an Initfamily Letter within a Colorbox and Sizing It for Use as a Two-Color Lettrine.
Consider the code
\documentclass{book}
\...
3
votes
4
answers
346
views
escape hashs (#) passed as argument to use them in inner macro
I am using nested macros using the xparse package, my ultimate goal being to have a custom macro factory. I have simplified my current problem here.
I want to give a pattern as an argument, like in ...
12
votes
2
answers
399
views
Variable number of arguments: generate alignment characters
I'm trying to define a command \letin that should produce something that looks as follows.
Note that it should support a variable number of "let" arguments and a single "in" ...
2
votes
1
answer
1k
views
How to set an inline tcbox height to a fixed height (1em)
I'm searching for a way to avoid the following layout (image below) where the underscore and the lower case letters get tightened inside the tcbox : ideally, I'd like the tcbox to keep a height that ...
0
votes
1
answer
256
views
Undefined control sequence error after MiKTex update on 2021-08-25 while using parametrized file
Last time I updated MiKTeX was over an year and till now the below MWE worked:
\begin{filecontents*}{tst.tex}
\begin{tikzpicture}[auto]
% placing the nodes
\node[signal] (input) {};
\...
0
votes
1
answer
717
views
Using \RequirePackage with parameters
I want to outsource my preamble to a different file. So far I'm doing it with \RequirePackage. This ends up looking like this:
\RequirePackage{templates}
\begin{document}
...
\end{document}
My ...
1
vote
2
answers
431
views
Add optional parameter to def
So I was looking for a way to do something in latex, and I ran across the following MWE:
\documentclass{article}
\def\foo{1}
\def\bar#1 #2{%
\expandafter\def\expandafter\foo\expandafter{\foo {}#1}...
2
votes
1
answer
279
views
What is wrong in this definition of a newcommand with variable number of parameters in its argument?
I want to define a command to draw schemas of the type shown in the following figure, but for an indeterminate number of branches. The inputs will always be positive integers.
The numbers of the ...
2
votes
1
answer
5k
views
Error "paragraph ended before \text@command was complete" when I add \par in argument?
I have written a command to put a text in bold and give a line break. It works fine for me in single line text, but if I want to pass it an argument with pair it doesn't work for me.
How could I ...
0
votes
3
answers
2k
views
How to split the arguments of a command over multiple lines
I've defined a newcommand to create a reusable "requirement" component for my LaTeX document. The problem I have is that it seems like I need to have the entire command on a single line, ...