Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [variable]

The tag has no usage guidance.

0
votes
0answers
32 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
25 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
42 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
152 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
34 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
23 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
23 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
31 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
29 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
20 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
82 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
34 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
47 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
145 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
29 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
42 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
51 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
109 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
40 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
118 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
90 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
58 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
94 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
36 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
135 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
97 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
83 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
67 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
51 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
57 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
48 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
85 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
78 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
182 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
540 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
129 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
201 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
91 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 ...
0
votes
1answer
65 views

Automation and variables

For school and exams, time is at a premium. Copying expressions and pasting them in a third party calculator is too time consuming. Not to mention if you discover that you have made a mistake, and ...
1
vote
0answers
68 views

Is it possible to create variables for each instantiation of an object? (as c++)

Let'say I have defined a new command that draws a tikzpicture. Every time I call this command, I 'instantiate' a new 'object'. Is it possible to create variables for each separate object that holds ...
0
votes
2answers
64 views

Typeset indexed function with parameters

I want to typeset something like \documentclass{article} \usepackage{amsmath} \begin{document} $$f_{A_{n,k}}(\omega)$$ \end{document} I don't know how to make the argument (\omega) to be typeset ...
3
votes
3answers
310 views

Variable Width Tilde

I wish to define a new macro, \vartilde say, so that \vartilde{a} produces the following: \tilde{a} while in inline maths mode, ie using $ ... $; \widetilde{a} while in display maths mode, eg using \[...
1
vote
1answer
91 views

Subcaption: Vertical image alignment - Pass through image height

I have two external graphics that I want to add to my document side-by-side using the subcaption-package at the same height. To get the height of the first file, I use \settoheight. In the subfigure ...
3
votes
3answers
460 views

Edit \today in such a way that it displays 1st/2nd/3rd/4th, etc. Month Year

I have found questions where \today has been edited – but in such a way which I do not want to have. Yet, I do not know how to programme it. If I write \today, I do not want to see something like ...
2
votes
1answer
232 views

use a variable in tikz pgfplot xtick

I was drawing a square function using pgfplots. So I defined the period \T, the number of periods \nbT, the max value \E. I can use those variables in my axis preamble except in xtick, how is it? My ...
1
vote
1answer
58 views

“Optional” package accept variable argument

\documentclass[12pt]{article} \usepackage[test]{optional} \begin{document} \def\optname{test} \optname \\ % Prints "test" \opt{\optname}{ TEST % does nothing }\\ \opt{test}{ TEST 2 % ...
0
votes
1answer
277 views

local temporary variable assignment

I am sure this has been asked many times already in many different ways, but can't get any of what I found so far to work. So here we go: I am using the following code (that I once found on here ...