Skip to main content

Questions tagged [environments]

{environments} is for general questions related to (La)TeX environments. For questions about environment subcategories like {lists}, {quoting} environments, or {floats} use the appropriate tag instead.

Filter by
Sorted by
Tagged with
1 vote
1 answer
30 views

having a new environment share the same counter with a theorem environment without copying the italicization [duplicate]

I'm writing some notes and to make things easy to reference clearly, I'm adopting the convention of having my theorems, corollarys, definitions, etc. all share the same counter. % environments \...
doggo's user avatar
  • 13
1 vote
0 answers
24 views

Reducing the spaces before-after subsections and a table/figure environment

Working on a conference paper that limits number of pages to 10 on an LNCS template. Run out of the limit my about 3 pages. I am working to reduces content, but being careful not to eliminate ...
arilwan's user avatar
  • 399
2 votes
1 answer
73 views

Is there a way for me to scale a custom environment I made in LaTeX?

I've created the following new environments and I want to be able to scale the output of the big algorithm environment and control the width of the mini algorithm environment (or having two mini ...
Nate3384's user avatar
  • 197
0 votes
1 answer
19 views

How to format decision problems for algorithms?

I am aware there are several excellent packages in CTAN for typesetting algorithms. However, I often need to first describe the problem the algorithm is solving, and I can't seem to find apackage that ...
Luke's user avatar
  • 1
1 vote
2 answers
113 views

Nesting two environments

The snippet below has been obtained nesting two environments taken from amsthm and tcolorbox. I would like to redefine the environment theorem to produce the same output (I can only modify the ...
Primo Petri's user avatar
1 vote
0 answers
51 views

Recreate the functions environment from the l3doc class file

I am reviewing the l3doc.cls class file and I was very interested in recreating the functions margin environment as shown in the diagram below: Note that I am only interested in the section that says ...
azetina's user avatar
  • 29.1k
0 votes
0 answers
22 views

How to remove automatically added empty line after environment [duplicate]

MWE: \documentclass{article} \usepackage [ top=20mm, bottom=20mm, left=30mm, right=10mm, nohead, nomarginpar, showframe, ] {geometry} \begin{document} \begin{center} ...
Intolighter's user avatar
0 votes
0 answers
19 views

Modify randomizechoice environment

I have this code where \addChoice and \addCorrectChoice do some additional operations in the checkboxes environment. \let\origcheckboxes\checkboxes \let\endorigcheckboxes\endcheckboxes \...
Sam's user avatar
  • 277
2 votes
1 answer
120 views

Define your own “list of …”

I'm currently working on a book, and I want to create a list of examples. I tried lots of solutions available online, but none suited me well - see for example: https://texblog.org/2008/07/13/define-...
shahroor's user avatar
2 votes
1 answer
18 views

Setup user defined list of figures

I have created a "map" environment as an alternative to the figure environment and am now trying to set up the associated list. How do I modify how these entries appear in the list of maps -...
user2568648's user avatar
1 vote
1 answer
56 views

How to redefine the align environment in terms of itself?

I'm trying to redefine the amsmath equation environments to do some regex parsing of their contents. Something is going wrong with the environments that allow alignment tabs. Here's a MWE of the ...
srossd's user avatar
  • 125
1 vote
2 answers
44 views

Can I change the effect of a command depending on the environment in which it's invoked?

I need a user-defined command to behave differently depending on whether it's invoked inside a \begin{quotation} environment or not. Is that possible? I don't know where to start!
digitig's user avatar
  • 125
0 votes
1 answer
27 views

Double longtable

I need to use tabular for 2 cases: one for numbered data(table float) and other for text data(I named quadro). Now Im need to use longtable for both, the way I thought to do that is load the longtable ...
Leonidas's user avatar
1 vote
1 answer
32 views

Extra \fi error when listing inside a custom environment

I am trying to write a solutions environment sol which I can use to write solutions within assignments. There are two reasons for the environment, Solutions may be different colour. Solutions can be ...
scribe's user avatar
  • 335
0 votes
1 answer
40 views

How can I store the text between \begin{env} and \end{env} as a token list?

I can store the text as a token sequence: if "create" new toks as \newtoks\mytoks and define a command \def\mycommand#1{\mytoks={#1}} I can write \mycommand{Some text} and obtain non-empty ...
Andrei Malokostov's user avatar
1 vote
1 answer
23 views

figure captions of the two subfigures to be centered, while the main caption should be justified rather than centered

I am encountering an issue when using the subcaption environment in LaTeX. I want the captions of the two subfigures to be centered, while the main caption should be justified (aligned at both ends) ...
Zixiao's user avatar
  • 11
3 votes
2 answers
551 views

What's wrong with my new environment?

I'm trying to write this new environment, but produces this error when I use it: This is my code: \documentclass{article} \newcounter{questao} \newenvironment{questao}[1][]{ \ifx\relax#1\relax ...
Lenin de Castilhos's user avatar
1 vote
1 answer
24 views

Environment taking left or right justification argument [duplicate]

I have the following environment that originally utilised flushright. I want to adapt this to accept both flushleft or flushright depending on an environment argument. Somehow I need flush#1 to ...
Bulldrive's user avatar
  • 161
0 votes
0 answers
20 views

Customizing numbering on environment with optional argument

I am not sure if this is considered bad practice so please let me know if it is. I have an environment I use form homework problems \newtheoremstyle{mystyle} {\topsep}{\topsep}{\normalfont}{}{\...
4u9ust's user avatar
  • 23
3 votes
1 answer
106 views

Extra space when body ends with math mode

I often write homework assignments with solutions. I copy the homework tex file and then fill in the solutions. This requires that I keep track of two files. Today I decided to write an environment to ...
scribe's user avatar
  • 335
0 votes
0 answers
33 views

Create alias of verbatim environment with optional arguments

I'd like to create an alias of the verbatim (xsim-based) environment \begin{CacheMeCode}{tikzpicture, optional arguments} \end{CacheMeCode} to \begin{tikzpicture}<optional arguments> \end{...
tobiasBora's user avatar
  • 8,944
0 votes
2 answers
44 views

Created a quiz environment but error claims it can't find \begin{document}

I cleaned up code to create a quiz. I have an mwe using two commands squiz and equiz. \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage{tikz} % Include TikZ package for drawing \...
Dov's user avatar
  • 1,543
0 votes
0 answers
17 views

\lstnewenvironment with broken page breaks

I have the following environment set up: \lstdefinelanguage{prompt}{} \lstnewenvironment{prompt}{% \lstset{language=prompt, frame=none, aboveskip=1.5mm, belowskip=1.5mm, ...
Duarte's user avatar
  • 1
2 votes
1 answer
76 views

How can I vertically center the question mark on the left of this theorem-like environment?

How do I modify the following environment to make the question mark appear vertically centered (whose spacing depends on the text length)? Here is the code that produces that question box: \...
Andrew Kelley's user avatar
2 votes
1 answer
56 views

Environment to change the font size to a certain value

I am looking to create an environment that sets the font size to a certain value (say 12pt, with 53pt of baselineskip for this example, goal is to later be able to pass them as arguments, but for now ...
tbrugere's user avatar
  • 135
0 votes
1 answer
24 views

Compilationerrors: (Command \c@days already defined, end{} environment ignored)

i am trying to create a calendar using the calendar.sty package (added below). For that i used knitr .rnw in R to loop over a matrix with the calendar parameters and created a .tex file. Im my eyes ...
Groggy's user avatar
  • 1
2 votes
1 answer
123 views

How to exclude an environment from texcount wordcount

I'm writing up an academic document for which I have a max wordcount, using Overleaf's texcount with default settings to count words. By default this excludes equations (which is desirable) but this ...
George's user avatar
  • 215
0 votes
1 answer
52 views

How to create a LaTeX3 environment in paracol without delimiter issues?

I would like to turn this answer into an environment. Therefore, I use xparse to define a LaTeX3 environment, but I am missing a little something because it creates errors. It seems, I have issues ...
R. N's user avatar
  • 1,126
1 vote
1 answer
31 views

How to position mdframed environment at the top of a page, without topmargins being decreased?

I have a document which uses a simple custom environment for algorithms, using the mdramed package. Some times I want an algorithm to be placed at its position in text, and other times I would like an ...
Naysh's user avatar
  • 187
1 vote
1 answer
40 views

File ended while scanning use of \next. Exam format

I have a problem in my LaTeX file that I wasn't able to solve with my google-fu. Most answers to the same error say that \end{frame} may not be indented. I do not use \end{frame}. My goal I want to ...
cultrarius's user avatar
1 vote
0 answers
30 views

Record the content of an environment as a property

I came up with this question since I saw copy and reuse the content of an environment and thought that this might be solved using ltproperties. I want to record the content of an environment as a ...
NemoYuan2008's user avatar
0 votes
0 answers
27 views

Custom environment results in "Extraneous input"

Motivation I am using the package plantuml to plot uml diagrams. Unfortunately, the default style of plantuml (the tool) is ugly and I need to define a custom style in every plantuml environment. To ...
dn1h's user avatar
  • 13
1 vote
1 answer
42 views

How do I change the displayed name of a theorem environment locally?

I am using a theorem environment to write definitions, with the displayed text being "Definition.", but I want to make one of these to say "Definitions." This is the code I am ...
TheInidealPrakrutiGuy's user avatar
0 votes
1 answer
41 views

Bespoke `proof` environment produces big vertical space just after a subsection title

I am using a bespoke document class which I have not developed. As part of this class, the proof environment is defined as follows: \newenvironment{proof}{% \par\addvspace{12pt plus3pt minus3pt}\...
Daneel Olivaw's user avatar
1 vote
2 answers
42 views

Why does managing a counter and label in an environment make \ref obtain the wrong value?

With the following code, I prepare my own custom counter and use it in a command, where I also create a label. Then I use my command several types, and use \ref using the label created in each command ...
Gwendal's user avatar
  • 11
0 votes
1 answer
32 views

Define the following environment: \divisorule\begin{flushleft}\end{flushleft}\divisorule

Anytimes I need to explain something which could be not clear for someone so that I usually to put it into a shrank text as to follow \noindent\hrulefill~\raisebox{-4pt}[10pt][10pt]{*any symbol like ...
Antonio Maria Di Mauro's user avatar
0 votes
0 answers
18 views

"Environment publications undefined" - please help

%Section: Publications \sectionTitle{Publications}{\faLeanpub} \begin{publications} \publications {\textbf{Contrails Whitepaper}} {\textbf{Mar 2023}} \\* {\website{https://www.flipsnack....
Raj's user avatar
  • 1
1 vote
1 answer
58 views

namecref With theorem* Environments

I'm trying to refer to the name of an amsthm theorem* environment using cleveref's namecref command. However \documentclass{article} \usepackage{amsthm} \usepackage{cleveref} \newtheorem*{note}{Note} ...
Dave's user avatar
  • 317
0 votes
0 answers
54 views

Problem with changing space before and after specific environments

Short story : environments crafted for class article create chaotic spaces before and after the places I use them now that I have switched to scrbook. Long story : I am writing a phd thesis on LaTeX, ...
Hobo_academicus's user avatar
1 vote
1 answer
36 views

Newenvironment for poems

I would like to create a new environment to do this: \begin{alltt}\normalfont \textit{#1} \end{alltt} where I would like to put some text instead of #1. Text consists of lines, as a poem: aaa ...
Marina's user avatar
  • 143
1 vote
2 answers
67 views

How to trim the spaces for `\BODY` in `\NewEnviron`

The following is the code of \ansproof environment (a NavyBlue colored \proof environment) that I have defined. The issue is that, in the original version of \proof, \begin{proof}\n\n\n\end{proof} (...
Twilight's user avatar
0 votes
0 answers
32 views

Scrutinise dtx source on fundamental latex environments [duplicate]

I would like to scrutinise the documented source (.dtx) for the implementation on fundamental latex environments. For instance, \begin{document}, \begin{itemize}, \begin{table}, \begin{equation}, \...
Veak's user avatar
  • 1
0 votes
2 answers
60 views

Composing names for commands and environments

I have some functionality that is implemented as a command and also as an environment. \NewDocumentCommand{\dkmKtlog}{ O{0.3cm} m m } { DO THIS } \NewDocumentEnvironment{dkmKtlog}{ O{0.3cm} m ...
Veak's user avatar
  • 1
0 votes
1 answer
57 views

How to disable line breaks in footnote?

I clone the great project stacks-project Because I don't like right-side-note (margin) in the original settings, I want to set it as a footnote Since my level is not high enough to extract a minimal ...
uuikm's user avatar
  • 25
4 votes
2 answers
202 views

Store environment's body in LUA string

I would like to get an environment's body, store it inside a lua variable, in order to use it later in my document if needed. My code is actually working as long as I don't use any command with a } or ...
Vince's user avatar
  • 55
2 votes
2 answers
57 views

How can I define the command as the inwards of the environment? [closed]

How can I put the inwards of the environment into the command? For example I use \begin{tmpenv} \a \b \c \end{tmpenv} I want to get the result similar to \long\def\tmpenv{% \a \b \c } to be ...
Konstantin's user avatar
0 votes
1 answer
35 views

Get Name of Theorem Environment From Label

I'm trying to create a command, say envName, with the following behaviour (where theorem and lemma are AMS Theorem environments): \begin{theorem}\label{myThm} Lorem ipsum... \end{theorem} \begin{...
Dave's user avatar
  • 317
0 votes
2 answers
70 views

Scratching a paragraph, or a specified amount of text in latex

I want to figure out how to scratch(draw an oblique or diagonal line across the text) out some number of lines(in particular, a paragraph). Does anyone know of a simple command to do this? I am ...
Parish's user avatar
  • 101
0 votes
0 answers
39 views

Redefine Figure (or Table) as "Supplementary Materials Figure (or Table)"

I am preparing some Suppementary Materials for a manuscript, and they say that I need my Figures in the Supplement to be called "Supplementary Materials Figure 1" (say). Now, I know how to ...
user3236841's user avatar
1 vote
0 answers
99 views

Re-definition of a command inside an environment [closed]

The redefinition of a command inside an environment works fine if the redefinition makes no use of the arguments, but it fails if the arguments are used in the new definition. the error message is : ...
bencio's user avatar
  • 11

1
2 3 4 5
66