Questions tagged [variable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
3answers
66 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 ...
1
vote
1answer
21 views

How can I change the value of a command in the enumerate environment?

\documentclass{scrartcl} \begin{document} \newcommand{\myvalue}{0} \newcommand{\setmyvalue}[1]{\renewcommand{\myvalue}{#1}} \begin{enumerate} \item First Point. \setmyvalue{1} \...
5
votes
1answer
40 views

newcommand does not work inside figure option

I would like to make use of a variable that I can use multiple times to make sure all my figures are sized the same way. At the moment I have multiple images with the following code: \documentclass[...
3
votes
1answer
37 views

Using dynamic variables within dynamic variables

I was looking at the examples at: How to Declare Dynamic Variable name in LaTeX? and Dynamic Conditional Variables And I still seem to be getting errors when I try to create dynamic variables. Here's ...
1
vote
1answer
41 views

variable font formatting

I would like to create a LaTeX function that: (1) takes a string as an argument (2) calculates the length of the string, (3) divides the length by 3, (3) applies one type of formatting to the first 1/...
2
votes
1answer
39 views

PDF Rendering Error: use checkifodd and variable

I use checkifodd and varialbe x, y. When compiling, error: Something went wrong while rendering this PDF My code: \documentclass{article} \usepackage{datatool} \usepackage{filecontents} \usepackage[...
1
vote
1answer
27 views

Ifoddpage statement inside switch case

Continuation of topics tcolorbox: specific width and height settings for odd and even pages and Distance Variable in front or back pages. I'd like to set lengths conditionally based on the expansion ...
3
votes
1answer
59 views

tcolorbox: specific width and height settings for odd and even pages

Starting from this solution to my older post: Distance Variable in front or back pages, how can I set the width and height of a tcolorbox in a way that depends on whether the box is put on an odd page ...
1
vote
2answers
38 views

Distance Variable in front or back pages

I want to use variable VARX of front/ back pages Example: in front pages: varx = 5cm In back pages: varx = 10cm My minimal code (Varx is always = 5cm) \documentclass{article} \usepackage{datatool,...
0
votes
0answers
42 views

X-Y Position of box changed with 2 variable (odd/even) and (numeric range)

I have box A and this box A can moving when (No - odd/even) & (Type - 1/2/3) change. Minimal working coding: \documentclass[a5paper,twoside,8pt]{article} \usepackage[a5paper,landscape,left=1.0cm,...
1
vote
1answer
30 views

Using a variable for BIBER DATE value produces blank date in output

I'm using MikTex with biber \usepackage[backend=biber,natbib=true,style=numeric,sorting=none]{biblatex} and I want to use a variable for the date value, but it does not provide any output. I set up ...
2
votes
1answer
47 views

How to suppress comma list from outputting its values on declaration?

I need to suppress the display of the comma list on its declaration. I just need comma-list variable to store the list, not display it. \documentclass{standalone} \usepackage{expl3} \begin{document} ...
2
votes
2answers
171 views

How to properly store the current value of int variable into a token list?

I have an volatile integer variable (counter) and at some point I wish to save its value to a token list (saved_counter). If I save it with just \tl_set, as soon as counter changes the value, this ...
0
votes
1answer
41 views

Define variables in document so that macro definition goes into preamble

I've written some macros to add OMR characters to the generated document. The OMR characters are needed for an envelope inserter machine. When I want to print OMR characters for a double-sided ...
0
votes
1answer
27 views

Change header from class file depending on whether or not a variable is declared in the document

I am trying to edit my class file to either have a header or not depending on whether or not a variable (\cv{}) is set in the document. I have scoured the internet for answers and based my initial ...
0
votes
0answers
21 views

Select one of many groups of array definition

I use variable.tex to definite some Array: Name, color, folder In main.tex: \input{variable.tex} In variable.tex: ( not exist begin/end{document} Each Group includes 3 Array: Name, color, folder %...
0
votes
0answers
31 views

LaTeX - Pass variable into a string [duplicate]

In LaTeX I am trying to pass a variable into a line for the \progressbar. If you type everything in it looks like this \progressbar[linecolor=blue, filledcolor=green]{.25} \begin{picture}(0,0)\put(-...
0
votes
0answers
36 views

Control PDF file folder & filename output by global variable

I use LaTeX with Texmaker. Is output PDF always in same folder with main.tex? I have Arrayvariable.tex: %Client Name \def\ClientNames{{"VarA"}} main.tex: \pgfmathsetmacro{\ClientNamesNull}{\...
0
votes
1answer
37 views

Looping for Two-column Signature Blocks

I'm trying to create a two-column area for signatures, so folks signing the document are listed in the left column or right column, and there are enough rows to accommodate everyone's signature. Under ...
1
vote
1answer
24 views

Variables (in some cases) not working inside `\href`

Given this small document class file mycustomloc.cls: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{mycustomloc}[2019/03/06 My custom class] \LoadClass{article} \RequirePackage{hyperxmp} \RequirePackage[...
0
votes
1answer
83 views

Use variables like #1 in math [closed]

I'm writing this small \newcommand, and I want to send numbers as parameters. But since the math mode always tries to interpret the # in a different way. I don't know what to do. Here is what I have ...
1
vote
1answer
47 views

How to use something like \label outside the table environment?

I would like to ask whether there is any way to use a \label-like command outside a longtable in order to reference this table in latex? It would be also helpful if the label of the table could be ...
1
vote
1answer
52 views

Generalising a second-order macro with loops

I'd like to construct a macro that can be used to define commands. Those commands behave like variables or structs of variables, such that they can contain multiple values. The "member" is passed via ...
2
votes
3answers
251 views

String variable with multiple values

I'm after a definition of a command that could have multiple values to use in different contexts. The use case for this would be in a custom class that uses two languages simultaneously, or I guess ...
0
votes
1answer
31 views

How to use defines in other files?

I can properly use a define \def <command> <parameter-text>{<replacement-text>} if it is define in the same LaTeX file, which is not the main file, but let's say, it is named 2....
1
vote
0answers
49 views

What is the TeX at symbol / @ for? [duplicate]

Edit Note: I am trying to research "switches" (like \chapter), which led to this question. It might be helpful to tag this "switches". I have seen a lot of documentation that appears to be using ...
0
votes
1answer
66 views

TikZ: how to memorize current coordinate into a variable during path creation

I am creating electrical circuits using CircuiTikZ. Quite often I need to connect to a certain point, which has been created previously using relative coordinates. Right now I have to calculate ...
2
votes
2answers
147 views

LaTex - perform algebraic operations on variables

Suppose I've got the following document: \documentclass{article} \newcommand\mass{30} \newcommand\acc{9.8} \newcommand\force{\the\numexpr \mass * \acc \relax} % F=m*a \begin{document} \section{...
1
vote
0answers
43 views

Define variable for color and \AbsolutePosition{x, y}

I have 10 files and each file has different distance variables and color variable in the code: \AbsolutePosition{\x_var}{\y_var}{ \begin{tikzpicture} \draw [\colour_var,fill=\colour_var] (0,0) ...
2
votes
1answer
123 views

How to pass boolean value to a tikz option key

I have trouble understanding how to properly use tikz keys and pass them. Let's say I want to code two tikz pics with both a "fill" argument. I sometimes end up writing things like the example below. ...
3
votes
3answers
152 views

Indexing variables

Is it possible to create variables that can be defined using integers. I would create an example to work with but I have no idea how to start. Hopefully the snippet I have included makes sense. % ...
1
vote
1answer
82 views

Input variable as argument in metapost script?

I would like to pass input parameters into my .mp script. For example, instead of running: mpost script.mp I want to run something like: mpost script.mp 1 1 2 diamand Where "1 1 2 diamond" are 4 ...
4
votes
1answer
119 views

Can you create concatenate variable names in LaTex? [duplicate]

I would like to create variables to hold strings like f(x)=3x+1 to be inputted into an exam questions. I can create variables like \funA, \funB, … et cetera. The problem is how do I reference them ...
3
votes
1answer
41 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
208 views

Assigning a numerical variable with Tikz pgfmathtruncatemacro

I am struggling with some basic computations with Tikz and I have a problem assigning a value to a variable inside a local scope. Consider the following MVCE: \documentclass{article} \usepackage{...
0
votes
3answers
135 views

Logical markup for math symbols/variables, alternative to \newcommand

I would like to use markup for any math symbols/variables (Sorry, I'm not sure what is the correct terminology here). The reason is to make late changes of the naming convention easier by just ...
4
votes
3answers
95 views

xstring TeX capacity exceeded

I try to store the result of an xstring pagckage’s command in another command (or variable, I don’t care), to reuse it in another xstring’s command, as you can see in the following MWE: \...
2
votes
1answer
78 views

Printing all predefined variables and or values

So, whenever you begin a document by giving it some class (article, memoir, etc), there are many default lengths and heights being used. What I am looking for is a way to see these without explicitly ...
2
votes
1answer
24 views

Access a given colors from a preset array

I use a variation of the BlueBox chapter style in order to change the header color with each new chapter. For now i have to set the new color before each new chapter wich is not optimal. I wanted to ...
1
vote
1answer
58 views

Tables: how to parametrize ruler dimensions (e.g. thickness)?

I would like to define the parameters of my table rulers using some sort of variables, so that just by changing the variables definitions I can tweak the rulers without further need to change the ...
1
vote
0answers
58 views

Reduce spacing inside cell, vertical and horizontal positioning of figure & defining some text in preamble

I want to make a template document (with custom margins, font sizes, header, footer etc...). I have specified only footer on first page and header on all other pages, margins, text width, text height,...
1
vote
1answer
72 views

How to do arithmetic with variables used in for loop?

How can I use arithmetic inside a node's curly brackets? I have this, and it prints for example "0+1" in a circle. I would like to have circles that show the sum of their coordinates. \begin{...
1
vote
1answer
88 views

Suggested method of creating an end user editable variable with newcommand

I am trying to create a document template that would be used by many people where the end users can control certain values but most of the template style can be controlled centrally. Imagine a (...
1
vote
1answer
115 views

Save command result in other command

I am getting a value by a command. Now I am temporarily changing a saved variable which changes the command output. After I finished some code I want to reset the stored value if the value before the ...
6
votes
2answers
190 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 ...
5
votes
2answers
550 views

generate 100 pages document with consecutive numbers

I need to generate a 100 pages document with only 1 number per page starting from 1 till 100. Any idea?
4
votes
1answer
148 views

A question on pgfmath, variables, conditionals and scope

First, I would like to apologize for the vague title of my question, somehow I didn't manage to come up with something more precise. Based on an answer to this question, I wanted to create a function ...
1
vote
2answers
253 views

Passing a string into Sweave Rnw file

I understand from this question that it's possible to push a variable to an Rnw file from the R script that calls it by storing that variable in the global environment within the R script. I've tried ...
0
votes
1answer
99 views

Defining dynamic numeric variables and adding them

I'm designing an academic exam template, and would like to assign specific point values to individual questions, and then sum the point values on a given page to display at the bottom of that page. I ...
0
votes
0answers
33 views

Unknown Command for Variable [duplicate]

I have been unable to identify the command for this specific volume variable, V. The closest commands I identified were \vee and \wedge but they do not possess the curvature found in this format. Any ...