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
1 vote
2 answers
66 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} ...
user avatar
3 votes
1 answer
63 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, ...
user avatar
  • 119
3 votes
0 answers
87 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}...
user avatar
0 votes
0 answers
53 views

How to configure TexLive to use a full Perl distribution instead of the included minimal Perl setup?

How do you configure TexLive to use a full distribution of Perl, (like Strawberry Perl), instead of the minimal version that is included? Especially important is how to specify this if you have ...
user avatar
2 votes
1 answer
79 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 ...
user avatar
  • 131
1 vote
1 answer
68 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. ...
user avatar
1 vote
1 answer
45 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 ...
user avatar
2 votes
2 answers
185 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\\...
user avatar
  • 3,631
0 votes
4 answers
84 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]{...
user avatar
1 vote
2 answers
119 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 \...
user avatar
0 votes
0 answers
38 views

latex.fmt error in Linuxmint 17

I am trying to install base latex on Linuxmint RELEASE=17.2, CODENAME=rafaela, EDITION="Cinnamon 64-bit" DESCRIPTION="Linux Mint 17.2 Rafaela". I tried to run latex on this ...
user avatar
1 vote
1 answer
166 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 ...
user avatar
  • 11.3k
1 vote
1 answer
126 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 ...
user avatar
0 votes
1 answer
41 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 ...
user avatar
  • 101
1 vote
2 answers
107 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 ...
user avatar
4 votes
2 answers
76 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 ...
user avatar
  • 423
0 votes
0 answers
113 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, ...
user avatar
  • 298
1 vote
1 answer
96 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-...
user avatar
  • 733
1 vote
4 answers
167 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 \...
user avatar
  • 155
0 votes
0 answers
141 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/...
user avatar
  • 165
0 votes
1 answer
71 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 ...
user avatar
1 vote
0 answers
54 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 ...
user avatar
  • 396
2 votes
4 answers
96 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: % ...
user avatar
  • 337
2 votes
1 answer
169 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, ...
user avatar
2 votes
1 answer
451 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=...
user avatar
  • 489
1 vote
1 answer
41 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[...
user avatar
  • 113
1 vote
0 answers
70 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 (...
user avatar
  • 175
1 vote
1 answer
46 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 ...
user avatar
4 votes
1 answer
150 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{...
user avatar
  • 1,994
0 votes
0 answers
85 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 ...
user avatar
4 votes
1 answer
888 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 ...
user avatar
  • 409
0 votes
2 answers
331 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 ...
user avatar
  • 1,193
3 votes
1 answer
366 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} \...
user avatar
  • 975
0 votes
1 answer
162 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, ...
user avatar
  • 37
1 vote
2 answers
623 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 ...
user avatar
  • 111
1 vote
1 answer
550 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, ...
user avatar
  • 128
2 votes
2 answers
207 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]...
user avatar
  • 113
3 votes
3 answers
731 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 ...
user avatar
  • 545
0 votes
1 answer
909 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 ...
user avatar
  • 8,029
4 votes
1 answer
1k 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.
user avatar
  • 8,029
1 vote
1 answer
649 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 ...
user avatar
  • 3,811
1 vote
1 answer
524 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....
user avatar
  • 3,811
1 vote
0 answers
292 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 ...
user avatar
2 votes
0 answers
163 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) ...
user avatar
  • 237
2 votes
2 answers
242 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{...
user avatar
  • 199
2 votes
2 answers
681 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 ...
user avatar
2 votes
1 answer
290 views

Is there some ${HOME}/.texrc or ${HOME}/.latexrc config file that will be read by latex, bibtex, etc

I find myself copying the same export TEXINPUTS=fubar:$TEXINPUTS lines for different applications that don't all read the same environment configurations files, e.g. xterm vs. Emacs's compilation-mode....
user avatar
  • 203
3 votes
0 answers
637 views

TEXINPUTS equivalent for inputminted to make relative paths work?

A while ago I griped about LaTeX not supporting relative paths by default. It turns out I can export the TEXINPUTS=/path/to/source environment variable to make \input{foo} look in /path/to/source/foo. ...
user avatar
  • 1,491
1 vote
2 answers
922 views

Accessing a possibly undefined system environment variable from LaTeX (followup question)

This question is a followup to this thread in which @egreg provided a command \getenv to access a system environment variable. In response to my comment, he suggested a way to expand his script so ...
user avatar
  • 2,069
1 vote
1 answer
429 views

Using a system environmental variable in href for a pdf document

Is there a way to use a windows environmental variable in \href that uses this environment variable in the output PDF document? When I use \href{run:\%foo\%\\bar.cpp}{bar.cpp} The PDF Reader I use ...
user avatar