Questions tagged [environment-variables]

Environment variables like TEXINPUTS, TEXCONFIG, BSTINPUTS direct the working of tex and related commands, mostly by specifying where to look for packages, styles, etc.

Filter by
Sorted by
Tagged with
2 votes
2 answers
59 views

Chapter-like referencing for custom paragraphs

I am writing a system requirement specification document (SRS) that contains requirements as block of text with a custom formatting. I made a latex environment to format such block, here the code: \...
Jhonathan Asimov's user avatar
0 votes
0 answers
27 views

Adding supervisor into MastersDoctoralThesis

I would like to add a second supervisor to my phd thesis. I'm using the Masters Doctoral Thesis template from: https://www.overleaf.com/latex/templates/template-for-a-masters-slash-doctoral-thesis/...
BeltranFU's user avatar
2 votes
1 answer
51 views

Setting TEXINPUTS [closed]

Am using the following command to set TEXINPUTS where I have my style files gungadin_trk="${HOME}/Opstk/bin/gungadin-1.0" chilkat_trk="${gungadin_trk}/typex/chilkat//" export ...
Veak's user avatar
  • 1
2 votes
1 answer
79 views

How to parse square bracket arguments into several curly braced arguments?

I have an environment which I specify w/... \begin{code}{TITLE}{LANGUAGE}{CAPTION} \end{code} I'd like be able to specify it instead like... \begin{code}[title={TITLE},language={LANGUAGE},caption={...
user41177's user avatar
  • 309
2 votes
1 answer
74 views

How to make verbatim option optional in my \NewDocumentEnvironment?

How to make the below \NewDocumentEnvironment 3rd argument optional verbatim (optional that escapes special LaTeX characters)? Below is the 3 ways for how to the custom style: (Keep in mind that the ...
Omar Shawky's user avatar
0 votes
2 answers
43 views

How to split complex alignments into multiple columns?

My document includes multiple recursive definitions. To increase readability, I split these definition into multiple (usually two) columns. To get more accurate alignments, I use array. Thus, ...
grbll's user avatar
  • 1
1 vote
2 answers
112 views

Change color of label based on what Environment I'm currently in

Here's my current preamble.tex \documentclass{report} % basics \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{sidenotes} \usepackage{textcomp} \usepackage{url} \usepackage{hyperref} ...
SingularisArt's user avatar
3 votes
1 answer
217 views

New environment error

Edit As David rightly pointed out in the comment, I did not post what I intended. The desired output is a pull quote, that is a quote positioned on the right-hand or left-hand side of the page, ...
Louis's user avatar
  • 303
3 votes
0 answers
113 views

How to write a multiple argument environment within a newcommand?

In my custom class file, I have a command that generates a new environment: \newcommand{\MakeThEnv}[4]{ \DefaultFrame{#1}{#2} \theoremstyle{#3} \newtheorem{#2T}{#4} \newenvironment{#2}{\begin{#2Box}...
Strumff.'s user avatar
2 votes
1 answer
125 views

Algorithmically generating the syntax of math equations

Is there a way to algorithmically write equation syntax in latex?? Suppose I want to write the N-point DFT matrix in an equation, then is it possible if i specify what each entry of NxN matrix will be ...
Kutsit's user avatar
  • 169
1 vote
1 answer
318 views

Extending the OSFONTDIR environment variable on Win 10 to include user fonts

I am trying to use some fonts I have installed as a user on Windows 10, but XeLaTeX cannot find them. The fonts have been installed in C:\Users\<My User>\AppData\Local\Microsoft\Windows\Fonts. ...
AkaAkane's user avatar
  • 123
1 vote
1 answer
119 views

Font problem, TEXMFHOME

I have a brand new TeXLive vanilla installation on my Debian system. Before installing it I had removed all Debian TeX packages. The texmf.cnfin the installation only contains comments, I did not ...
Nobody-Knows-I-am-a-Dog's user avatar
2 votes
2 answers
235 views

What is wrong with the following environment definition?

I want to define an environment to hide text, with warning about it before and after in the pdf-output. What is wrong with the following definition? \newenvironment{foldit} {NB! NB! FOLDED TEXT BELOW\\...
Frode Alfson Bjørdal's user avatar
0 votes
4 answers
306 views

Set boolean of environment before a command

A command must be put before an environment, defining the kind of environment. However, the first boolean does not execute, the result is wrong. Please help me fix the problem. \documentclass[12pt]{...
Nam Tran Le's user avatar
1 vote
2 answers
164 views

Sum variables and process sign expressions in ConTeXt

I try to generate random exercises: \setvariables[parametres][a=-4, b=2, c=4] \starttext Solve: \startformula \getvariable{parametres}{c} x + (\getvariable{parametres}{a}+2) x = 5 \stopformula \...
somenxavier's user avatar
1 vote
1 answer
505 views

How do I use my custom TeX distribution without anything reverting to the system-default one?

I just installed TeXLive to /some/where/texlive/2021. My system has a TL distribution installed, and obviously various paths will default to that one. How do I set up my environment so that only my ...
einpoklum's user avatar
  • 12.2k
1 vote
1 answer
340 views

Parsing optional argument from \newenvironment to \newmdenv

I'd like to parse an optional variable from a custom \newenvironment{example} to an mdframed environment \mytextbox nested in the example environment. What I'd like to achieve is something like ...
Jean Jordaan's user avatar
0 votes
1 answer
86 views

adjust vertical space of equations in proof environment

Is there any way to change the variables \abovedisplayskip \belowdisplayskip etc. for the proof environment only? I want the default spacing in theorems and definitions, but want to avoid my proofs ...
Xoriun's user avatar
  • 161
1 vote
2 answers
613 views

Access and use $HOME environment for setting the path for a new font

I want to use a font I just downloaded for a document class I created. This document class will be used on other workstations so I would like the path of the font not to be "hardcoded" but ...
Victoria's user avatar
4 votes
2 answers
78 views

How to add aditional actions to argument into environement

I am starting in LaTeX. I want to write a document and define some styles. In this case I want to do two things with one portion of a paragraph: That it has a red color That it is aligned to the ...
A. Cedano's user avatar
  • 453
0 votes
0 answers
170 views

Change tufte-book definition file

I want to make a few changes to the styling of the document-class tufte-book - Change the headings typeface, customize section numbering, bibliography style etc. As correctly stated in this answer, ...
tush's user avatar
  • 1,103
1 vote
1 answer
165 views

Using reference points in "Stanli"

When using "Stanli" package, inorder to draw a number of paragrams belpow each other, I set offset values. For the shown MWE, The origint point for each diagram is set as follows: \point{a-...
Silva's user avatar
  • 743
1 vote
4 answers
364 views

Using an alias / variable as an input for a newcommand

I am currently trying to set up a conditional statement that takes a randomly assigned integer, and provides a specific output depending on if the integer is odd or even. I've written this so far \...
David G.'s user avatar
  • 203
0 votes
0 answers
236 views

Using environment variables in fontspec path

Fontspec font inclusions can be lengthy, so I wanted to create a template that has the fonty stuff already done. I have a working template, but it uses an absolute path Path = C:/Users/Bolpat/...
Bolpat's user avatar
  • 165
0 votes
1 answer
157 views

Environment with default output and command to change it

In the past for my dissertation I made a code that was outputting the result as a tex file for each experiment, generating a new table every time, but most of the entries I expected were the same. It ...
marco menarini's user avatar
1 vote
0 answers
55 views

Escape return value from \sys_get_shell [duplicate]

I stumbled upon this question regarding accessing environment variables from latex and have problems properly escaping variables containing special tex symbols (e.g. LANG=en_US.UTF-8) My closest ...
Septatrix's user avatar
  • 408
2 votes
4 answers
146 views

What do the numbers mean in custom environments?

I'm new to the latex stack exchange, and I just want to know what each number means in custom-defined environments. For example, in this code, the programmer defines a custom tcolorbox like this: % ...
Kookie's user avatar
  • 367
2 votes
1 answer
289 views

How to parametrize newminted environments in the point of use

In my tex files I currently have the following newminted definitions for various Java code listings. \newminted[javacode]{java}{% tabsize=4, fontsize=\footnotesize, xleftmargin=30pt, ...
George Kastrinis's user avatar
2 votes
1 answer
962 views

Defining optional arguments for `\newtcolorbox`

\documentclass[12pt,a4paper]{ctexart} \ctexset{ section = { name = {Week}, number = {~\arabic{section}} } } \usepackage{amsmath,enumerate} \usepackage[top=2cm,left=1cm,right=...
CasperYC's user avatar
  • 661
1 vote
1 answer
55 views

List arguments for a specific command within each section

How can I limit the scope of a command to a given section? I have adapted a macro found online which reads in the arguments from a command and lists them \newcommand{\printDefn}{} \newcommand\defn[...
Scb's user avatar
  • 113
1 vote
0 answers
95 views

include files from specific folder

New linux (mint) user, with pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian), using TexStudio (that might change) I have custom files (sty's and whatnot) in a folder that I cannot move (...
imj's user avatar
  • 185
1 vote
1 answer
140 views

Embedding if statements in environments

I am trying to write an environment so that I can toggle on and off the answers to questions on a hand out. I also want the answers to appear red and then the main text go back to black after the ...
Matt Bartlett's user avatar
4 votes
1 answer
219 views

Code between \begin{environment} and \end{environment} stored in an array

Is there a way to store the text between the \begin and \end commands of a generic environment in an array? A code that obviously doesn't work but shows what I mean is the following \documentclass{...
noibe's user avatar
  • 2,064
0 votes
0 answers
238 views

Is it possible to make an "if" section in TeX which is conditional on an environment version being set?

I'd like to produce two slightly different versions of a document. One will include confidential information, the other will be slightly redacted. Is it possible to use an environment variable and ...
Salim Fadhley's user avatar
5 votes
1 answer
1k views

shell-escape and "tput: No value for $TERM and no -T specified"

I am using TexStudio 2.12.6 on TexLive 2015 (Debian). If I add the option --shell-escape to my compile command lualatex --shell-escape -synctex=1 -interaction=nonstopmode -halt-on-error %.tex, I ...
tommsch's user avatar
  • 429
0 votes
2 answers
430 views

Directly get the value of a defined command

I defined a new comman or a definition which should store the value of my default font with: \newcommand{\defaultfont}{\fontname\font} However, when using this command inside a tabular environment ...
SRel's user avatar
  • 1,273
3 votes
1 answer
602 views

Passing parameters to a class variable

I'm trying to create my own colour theme for my document class. At the moment my solution is to use a class parameter: \DeclareOption{colour-theme-formal}{ \definecolor{soft}{gray}{0.75} \...
Jack's user avatar
  • 1,025
0 votes
1 answer
231 views

Text variable ignores nested formatting

I'm trying to make a title page within a class for future use within my university. I want users to be able to set the title in the main.tex, and then the custom.cls will make it larger and uppercase, ...
Ronen's user avatar
  • 37
1 vote
2 answers
824 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 ...
wtrs's user avatar
  • 111
1 vote
1 answer
654 views

pdflatex cannot find file but kpsewhich does

I have a header.tex file sitting in $TEXMFHOME/tex/latex/ and I tried using \input in another .tex file in some other directory. Note that kpsewhich is able to find header.tex, printing its full path, ...
Japorized's user avatar
  • 148
2 votes
2 answers
262 views

How to combine/unite/merge two environments?

I have two enviroments (equation and tabular), which should be located near to each other. %!TEX TS-program = xelatex \documentclass[14pt, a4paper]{article} \usepackage[T2A]{fontenc} \usepackage[utf8]...
ERAFY's user avatar
  • 113
3 votes
3 answers
887 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 ...
Nemgathos's user avatar
  • 545
0 votes
1 answer
1k views

Define the graphics path in the header for TeXstudio

TeXstudio opens a preview, when the mouse cursor hovers the \includegraphics command. Unfortunately this does not work, if a graphicspath is set for the document. It seems that TeXstudio 2.12.4 does ...
Jonas Stein's user avatar
  • 8,769
4 votes
1 answer
2k views

How to set environment variables for TeX in Latexmk?

By setting max_print_line=1000 in texmf.cnf or the environment, the logfile becomes more readable. How should we set the environment in .latexmk? I want to set the variable per project. Not global.
Jonas Stein's user avatar
  • 8,769
1 vote
1 answer
750 views

Compare two macros as strings in LaTeX (e-TeX)

How do I compare two macros that are one-expansion away from being strings? \def\A{ICT} \newgetenv[\ICT]{\A} % `\newgetenv` from https://tex.stackexchange.com/a/184924 Now I want to check if ...
A T's user avatar
  • 4,033
1 vote
1 answer
686 views

Environment variable \def if defined else \def default [closed]

Bash example # echo ${FOO:-bar} bar # FOO=haz; echo ${FOO:-bar} haz LaTeX attempt: Repo: https://github.com/AlecTaylor/latex-env-testcase Command (defined in preamble) % Edited from: https://tex....
A T's user avatar
  • 4,033
1 vote
0 answers
356 views

Variables for LaTeX in Lyx?

I created a table in LaTeX in the Premables. Original code below, Premables without the code, and a PDF output of it - I put placeholders (just text) for different kinds of text that I want to put in ...
Gal Grünfeld's user avatar
2 votes
0 answers
179 views

Problem with many tikz picture for every rendering

I have many tikz picture in my text, and for every rendering of LATEX, I waste hours to external pdf is produced. If there is a way to define samples=100 as a variable, (like var1:=100 in programming) ...
Nosrati's user avatar
  • 237
2 votes
2 answers
295 views

How to give a name to a subdocument

I am generating reports, like this... \clearpage \section{Gold and SPY} \noindent \begin{minipage}{0.60\textwidth} \centering \includegraphics[width=1.0\textwidth]{graphs/goldport.pdf} \end{...
tschm's user avatar
  • 199
2 votes
2 answers
845 views

How to escape a list of underscored filenames efficiently?

I am thinking how to read a CSV file which has filenames which have underscores efficiently into a LaTeX variable. I think reading the raw variables into a variable by input and then manipulating ...
Léo Léopold Hertz 준영's user avatar