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
49 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 ...
user avatar
0 votes
1 answer
39 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 ...
user avatar
0 votes
0 answers
25 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 ...
user avatar
  • 4,745
0 votes
1 answer
36 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]{...
user avatar
  • 1,882
1 vote
0 answers
41 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 \...
user avatar
  • 11
0 votes
1 answer
58 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 ...
user avatar
  • 101
2 votes
2 answers
192 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} \...
user avatar
1 vote
0 answers
24 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[...
user avatar
  • 5,285
1 vote
1 answer
71 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} \...
user avatar
  • 5,285
0 votes
2 answers
70 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
user avatar
  • 1
2 votes
4 answers
123 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 ...
user avatar
  • 123
1 vote
0 answers
51 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). \...
user avatar
  • 83
12 votes
2 answers
265 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" ...
user avatar
  • 328
3 votes
1 answer
52 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{\...
user avatar
  • 602
1 vote
1 answer
96 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 ...
user avatar
  • 179
0 votes
0 answers
26 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 ...
user avatar
  • 177
0 votes
1 answer
88 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) {}; \...
user avatar
  • 2,262
4 votes
2 answers
90 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 ...
user avatar
0 votes
1 answer
88 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 ...
user avatar
  • 366
1 vote
1 answer
98 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 ...
user avatar
  • 1,056
1 vote
2 answers
62 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}...
user avatar
1 vote
1 answer
34 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: \...
user avatar
  • 321
2 votes
1 answer
161 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 ...
user avatar
1 vote
0 answers
38 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\...
user avatar
0 votes
1 answer
742 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 ...
user avatar
  • 433
2 votes
1 answer
193 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). ...
user avatar
  • 445
0 votes
3 answers
393 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, ...
user avatar
1 vote
1 answer
124 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} ...
user avatar
1 vote
1 answer
91 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 ...
user avatar
1 vote
1 answer
62 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 ...
user avatar
0 votes
0 answers
743 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 ...
user avatar
  • 103
1 vote
1 answer
35 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 }...
user avatar
  • 1,868
2 votes
1 answer
42 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 ...
user avatar
  • 23
0 votes
1 answer
41 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 ...
user avatar
  • 4,356
0 votes
1 answer
39 views

How to define an empty parameter for minipage

minipage supports empty values for its optional arguments: \begin{minipage}[c][][c]{1cm} test \end{minipage} or \begin{minipage}[c][\relax][c]{1cm} test \end{minipage} but it doesn't if that empty ...
user avatar
  • 828
0 votes
1 answer
62 views

How to change `article` documentclass settings for some pages?

This is a follow up to this, and is also based off of this. Current code: \documentclass[12pt]{article} \usepackage{float} \usepackage[american,siunitx]{circuitikz} \usepackage[margin=1in]{geometry}...
user avatar
  • 1,437
1 vote
1 answer
36 views

pgfkeys: Read one key and ignore the others

In my own command \includegraphicsextended I want to add a caption to the pdf page containing File [filename] Page [pagenumber] therefore from the keys in %1 I want to just read the page=... key ...
user avatar
  • 123
2 votes
1 answer
287 views

How to change a \tikzstyle parameter according to a variable

I'm trying to define a document where I have different levels of it contained in TikZ boxes as shown below; the idea is that each box should get a color depending on the value of the counter (which is ...
user avatar
  • 97
2 votes
1 answer
82 views

How to input a tex file in a newcommand statement?

I read about my task here. But I didn't get working it for my needs. MWE: \begin{filecontents*}{compensation.tex} \begin{tikzpicture}[auto] %placing the nodes \node[signal] (input) {}; ...
user avatar
  • 2,262
2 votes
1 answer
88 views

Store variable number of argument to reuse in another macro

I am a begginner in Latex and I am trying to build a macro in latex with multiple parameters. So far, I have succeeded to write a macro that accepts multiple parameters (with the help of this website) ...
user avatar
0 votes
2 answers
96 views

How to quickly switch .tex-file by passing arguments to filename?

For example I have two TeX Projects with a similar filename structure: The master.tex has a structure like this: \input{preamble.tex} % <- \bibliography{Projekt_A_Literature} in preamble % ... ...
user avatar
  • 527
0 votes
2 answers
65 views

How can I create an absolutely positioned environment position determined by parameters using tikz?

I'm trying to define an environment that will place the contents in a tikzpicture node that gets positioned based on environment parameters. I'm very new to LaTeX, TikZ, and PGF, so the syntax is ...
user avatar
  • 123
2 votes
3 answers
119 views

How to create a new command whose single parameter is able to apply to both "caption" and "path" parameters of `lstinputlisting`

I want to create a command to simplify using the command lstinputlisting from the package listings, which can accept a single parameter as the file path and pass it to both the caption and path ...
user avatar
0 votes
3 answers
617 views

\input{\<variable>} yields "Undefined Control Sequence"

I am creating a class that I want to use for creating my own worksheets. As such, I want each course that I teach to have its own information file, stored in the file , which, in the assignment, I can ...
user avatar
2 votes
1 answer
2k views

"! Illegal parameter number in definition of \reserved@a" working with fncychap

I'm trying to compile a document, but when I launch pdflatex mydocument I get these output: ! Illegal parameter number in definition of \reserved@a <to be read again> l.14 \tableofcontents ...
user avatar
  • 601
2 votes
4 answers
190 views

Math To Specify a Parameter

Is there a way to perform a math calculation to specify a parameter? So, inside my command's definition, instead of writing #3 to specify the third parameter, is there a way to let a calculation like, ...
user avatar
2 votes
1 answer
223 views

How to get rid of leading zeros in a number?

I'm trying to check user input (a number parameter) for leading zeros and remove them. I wonder if such command is provided by LaTeX2e, or by one of the engines (pdftex, xetex).
user avatar
  • 3,636
4 votes
3 answers
129 views

Overriding control sequences for accessing TeX's integer-/dimension-/glue-/..-parameters

In TeX there are a lot of parameters which you can adjust for changing the behavior of TeX. Example 1: By assigning \baselineskip=... you change distance between lines. Why TeX's breaking-paragraphs-...
user avatar
5 votes
1 answer
100 views

Why do \large and \textbf require different usage of braces?

\large and other font size commands need to be placed inside a group: In this text {\large some part} is large. Whereas \textbf and other styling commands receive a parameter: In this text \textbf{...
user avatar
  • 965
0 votes
1 answer
529 views

Make space between table and section even to text and section

Good evening, I know that I can reduce the space that is inserted with a new table with \vspace*{-10pt}. But how to make it exactly even to the normal space between a \section or \subsection and the ...
user avatar