Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [parameters]

{parameters} is about the meaning, and the manipulation of fundamental parameters that guide the typesetting of LaTeX.

Filter by
Sorted by
Tagged with
0 votes
2 answers
138 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 \...
谢尘竹's user avatar
0 votes
2 answers
54 views

\tcolorboxenvironment with parameters

Context Hi. I am using \tcolorboxenvironment to customize a theorem enviroment created with thmtools (as explained in pages 22 or 400 of the documentation). This is what I have so far in my preamble: \...
asterisk's user avatar
4 votes
2 answers
160 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\...
hsmyers's user avatar
  • 1,573
2 votes
1 answer
30 views

What exactly does the <name> parameter of \pdfbookmark in hyperref do?

The official hyperref documentation (section 6.1.1) states that in \pdfbookmark[<level>]{<text>}{<name>} the parameter <name> provides the internal anchor name and ...
Albert's user avatar
  • 144
1 vote
1 answer
63 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 ...
Lorenzo Carozzo's user avatar
4 votes
2 answers
101 views

Force error when lack of parameters [duplicate]

For example, I defined a macro \test with one parameter. Latex takes the first character following \test as its parameter by default. I want latex to throw an error if \test is called without any ...
gaoqiang's user avatar
  • 155
0 votes
2 answers
132 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 --...
Levy's user avatar
  • 1,177
1 vote
2 answers
50 views

How to control expansion order to define variables from a prefix and a command?

The following is a command that does basic arithmetic with nine variables. \documentclass{article} \usepackage{xfp} \newcommand\functesta[9]{ \edef\myvara{#1} \edef\myvarb{#2} \edef\...
rdx73735's user avatar
4 votes
2 answers
294 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 ...
Geoff Pointer's user avatar
3 votes
1 answer
58 views

Parameter text getter

To this snippet \def\arg#1#2{\#1 = #1 and \#2 = #2\par} \arg A B C \end I supposed the output like this one #1 = A and #2 = B C But I get (using PDFTeX) #1 = A and #2 = B C . Why such behavior? I ...
Daniel Bandeira's user avatar
0 votes
1 answer
375 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 \...
Lucas Fath's user avatar
3 votes
1 answer
113 views

Minted: Using command for used language with inputminted

I have multiple different commands setup using \inputminted with different options but all are using the same language. Previously, i could feed all commands with a TeX primitive like so: \def \...
Jul's user avatar
  • 51
3 votes
2 answers
240 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]{...
aker9397's user avatar
0 votes
1 answer
74 views

How do I parametrize this chapterimage command by an opacity argument?

I have the following chapterimage command, based on this book template (ILM Report by Jenny Lantair) which I use simply by this oneliner: \chapterimage{./res/headers/nature.jpg}. \newcommand{\...
Eldar Sultanow's user avatar
0 votes
0 answers
27 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} } ...
user680089's user avatar
2 votes
2 answers
172 views

How to get width of parameter in plain TeX?

I am trying to get the width of a macro parameter using \def\getwidthof#1{% \newdimen\myl% \settowidth\myl{#1}% \the\myl% } where \settowidth is defined as \catcode`\@=11 \newbox\@...
btshepard's user avatar
  • 680
0 votes
2 answers
123 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 ...
Atai Ambus's user avatar
1 vote
1 answer
71 views

Want to add optional parameter to adjust tightness of \mybox

Following up on @Roman Starkov's \mybox definition for a tight \fbox (How to put a framed box around text + math environment), I'd like to add an optional parameter to adjust the pt allowance around ...
RosesBouquet's user avatar
0 votes
0 answers
44 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 ...
user4035's user avatar
  • 5,055
-1 votes
1 answer
308 views

How to draw neural networks from parameters?

This page by Izaak Neutelings offers some code to draw neural networks: https://tikz.net/neural_networks/ . Running the simple code from the top of said page yields: \documentclass[border=3pt,tikz]{...
MS-SPO's user avatar
  • 13.9k
1 vote
0 answers
58 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 \...
Radio's user avatar
  • 11
0 votes
1 answer
130 views

Convenient way of having named optional arguments in macros

I am writing a macro with many arguments, many of which may be optional. Example of how I imagine it: \newcommand{\mycommand}[width, height, density=1, joy=0]{Only \texttt{width} of value #width is ...
radrow's user avatar
  • 123
2 votes
2 answers
378 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} \...
Angelo Aliano Filho's user avatar
1 vote
0 answers
33 views

Lettrine Parameter loversize Not Working with Drop-Cap Algorithm

Consider the following code containing a macro which produces a two-color lettrine: \documentclass{book} \usepackage{lipsum} \usepackage{lettrine} \usepackage{lmodern} \usepackage{xcolor} \usepackage[...
DDS's user avatar
  • 9,768
1 vote
1 answer
117 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} \...
DDS's user avatar
  • 9,768
0 votes
2 answers
96 views

How convert "string" into parameter? [closed]

How using \myfunction{"TEST"} to \mysuperfunction{T}{E}{S}{T} I alvays have this same number of parameter
eeeeee's user avatar
  • 1
3 votes
4 answers
243 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 ...
User9123's user avatar
  • 147
1 vote
0 answers
52 views

Parameterize call to macro [duplicate]

I like to parameterize the call to a macro. Please see the minimal example below. I think it is self-explaining. Ultimately, I am searching for a way to call a macro by a string (kind of reflection). \...
aiquita's user avatar
  • 93
12 votes
2 answers
349 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" ...
Safron's user avatar
  • 360
3 votes
1 answer
127 views

Space between horizontal lines in awesomebox

I need a small space between top & bottom of the paragraph MWE \documentclass[10pt,a4paper]{article} \usepackage[margin=2cm]{geometry} \usepackage{awesomebox} \begin{document} \setlength{\...
Mafsi's user avatar
  • 664
2 votes
1 answer
609 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 ...
Etsaf's user avatar
  • 349
0 votes
0 answers
29 views

What is the correct way to type partial derivative in a parameter using \pd in commath package? [duplicate]

I'm using \pd{ }{ } in the commath package to type the partial derivative which saves lots of efforts than typing \frac{\partial }{\partial }. However when I want to have a pair of parameters around ...
Shana's user avatar
  • 177
0 votes
1 answer
215 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) {}; \...
Su-47's user avatar
  • 2,548
4 votes
2 answers
352 views

newcommand in newcommand, value of variable as parameter

I have created a command which creates another command. The parameter of the first command is a variable which is used in the second command. I would like the second command returns the value of the ...
vincentM's user avatar
0 votes
1 answer
576 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 ...
Titanlord's user avatar
  • 541
1 vote
1 answer
193 views

Pgfplot nested loops with calculated parameter

I need to draw a finite number of cubes below a 3D surface. Thus I need nested loops. The following code is close to what I want, except that I want to modify the z limit for the \k parameter to have ...
Tobard's user avatar
  • 1,211
1 vote
2 answers
239 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}...
Aram Papazian's user avatar
1 vote
1 answer
103 views

Math system with external parameter

I'm writing a document where I need to define a system with an external parameter. Here an image to make it clearer: I'm using this current code to generate a common system, here is an example: \...
Catarella's user avatar
  • 371
2 votes
1 answer
227 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 ...
Jesús Álvarez Lobo's user avatar
1 vote
0 answers
53 views

Getting the name of control sequence token - which values of \escapechar besides 32 require special attention?

I'd like to get the name of a control sequence token as sequence of character tokens. With \relax I'd like to get relax. The preceeding escape character is to be removed from the result of \string\...
JamieLittleJoeHossAdamBen's user avatar
1 vote
1 answer
4k 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 ...
A. Cedano's user avatar
  • 453
2 votes
1 answer
551 views

Use \pgfplotsinvokeforeach with parameter

I'd like to use \pgfplotsinvokeforeach with a parameter to draw different plots with different colors. What I tried is \pgfmathsetmacro but this does not work (see example, the value is fixed at 100). ...
garondal's user avatar
  • 455
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, ...
Axel Kennedal's user avatar
1 vote
1 answer
663 views

Use Case Template; Render enumerated list received from parameter

Desired Behavior This Latex: \documentclass{scrreprt} \usepackage{usecases} \setlength{\parindent}{0em} \setlength{\parskip}{1em} \begin{document} \subsubsection{Example Use Case} \begin{usecase} ...
Programer Beginner's user avatar
1 vote
1 answer
306 views

Custom itemize with extra parameters for items

I am currently working on a document class for creating worksheets for school in which I want to include a multiplechoice environment. For this I basically used the itemize environment and changed the ...
Roysten R.'s user avatar
1 vote
1 answer
81 views

Supplying small and large floating point values to moodlepackage

I am using the "moodle" package to create Moodle XML quizzes via Latex. Generally it works pretty well but I am having problems. If you are unfamiliar with the package, I can use environment ...
James Hoyland's user avatar
1 vote
0 answers
2k views

How to change Pandoc's PDF conversion style?

In the past I could get Latex and Markdown files converted to PDF with Pandoc and I could get the output in different PDF styles. Now I forgot how I did it, and I can just get the default style. The ...
Pietro's user avatar
  • 123
1 vote
1 answer
38 views

How do I define a new function `\juse`

I want to define a new function \juse which takes 3 parameters and prints the second one. However, this doesn't work: \documentclass{article} \newcommand\juse{#1#2#3}{#2} \begin{document} $\juse{ abc }...
user2925716's user avatar
  • 1,970
2 votes
1 answer
44 views

How to build a newenvironment out of a parametric command?

I'm very new here even if I've used Stackexchange looking for answers a lot. For once I can't find the one I'm looking for so I have to ask it. I'm a bit afraid it is a very simple question but I've ...
Franck's user avatar
  • 23
0 votes
1 answer
53 views

passing parameters

I have seen some examples that you can pass parameters to build a template such as \int_step_inline: you can write #1 to represent the current value of the loop. I wonder how it works and have some ...
ZhiyuanLck's user avatar
  • 4,526