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
0 votes
0 answers
40 views

Is there any introduction environment? [closed]

I know I could simply open a chapter and name it "Introduction", but I'm looking for a way so that this hypothetical intro chapter isn't included in the Table of Contents. I'd actually like ...
user avatar
4 votes
3 answers
194 views

How would I define a character to start and end an environment in plain TeX?

In TeX, starting and ending math mode is done with the same symbol, namely $. Suppose I would like to start and end an environment like this, perhaps with the text italic, using the character *, as ...
user avatar
  • 461
1 vote
1 answer
22 views

Supplying an Undefined Command as an Argument

I am trying to make an environment where you supply a variable name via an argument: \documentclass{article} \usepackage{pgfplots} % Foreach loops inside align \pgfplotsset{compat=1.18} \...
user avatar
1 vote
1 answer
30 views

How to redefine the same command differently over multiple theorems

i was wondering if there was a way to renew the emph command for each new newtcbtheorem you define. I have the following code already, adapted from an older solution by user egreg. The goal is to ...
user avatar
0 votes
2 answers
36 views

Wrapping a for loop inside an environment

I'm trying to make an environment that wraps a for loop: \documentclass{article} \usepackage[utf8]{inputenc} \title{Testing} \author{This is a Name} \date{June 2022} \usepackage{pgfplots} \...
user avatar
0 votes
0 answers
30 views

Changing default caption name in table environment

I am using a polish latex package and I noticed something weird. When I begin the table environment the caption normally (in English) begins with Table 1: {title} In Polish, it begins with Tablica 1. ...
user avatar
  • 35
0 votes
0 answers
18 views

Hide environment depending on a flag [duplicate]

I have an environment which should only be shown, if a certain flag is set. Currently I do \ifenv \begin{env} Text \end{env} \fi but it would be nice to include the \ifenv and \fi into the ...
user avatar
0 votes
0 answers
22 views

Issues at having definitions, examples, etc. numbered in beamer

everyone! I am trying to have definitions, theorems, examples and exercises properly numbered. I've even tried to have the "examples" that span more than one slide numbered by using \...
user avatar
0 votes
1 answer
20 views

Modifiying environments color (theorem, definition, etc) in beamer

I'm not used to modify LaTeX environments and it's my first time with beamer style, so I'm having some style issues. Justifying text. Changing definition/theorem/lemma headers to spanish. Changing ...
user avatar
  • 85
0 votes
0 answers
31 views

What is the difference of using \list vs. \begin{list} and \endlist vs. \end{list} [duplicate]

When creating environments based on list I have seen two implementations: \documentclass{report} \newenvironment{examplea}{% \begin{list}{}{% stuff here }} {\end{list}} \newenvironment{exampleb}{% \...
user avatar
  • 2,136
1 vote
2 answers
44 views

How to include label in environment arguments?

I wrote my own environment "theorem" with the package environ for key arguments and was recently stuck at two problems: How to insert citation as an argument and how to do it with a label? ...
user avatar
  • 11
3 votes
1 answer
71 views

How to apply Bionic-Reading style to the whole document?

In this answer, a user showed how to apply the Bionic-Reading style to specific paragraphs of a TeX document. The answer suggested defining a macro to achieve the desired effect, as requested in the ...
user avatar
  • 151
0 votes
0 answers
30 views

Savebox inside \newcommand vs \newenvironment [duplicate]

I have created a way to save answers to the exercises and generate them automatically later. Still, savebox doesn't seem to work inside an environment, while working fine inside a command. I'm working ...
user avatar
0 votes
2 answers
43 views

Restart theorem counter to 1 by book chapter

I am using \documentclass{book} with the amsmath and amsthm packages. Each chapter is a standalone paper, so I want the theorems in each chapter to begin with 1. How do I do this? Here's a MWE. \...
user avatar
1 vote
3 answers
52 views

How to make an environment for a tikz nodes content

(Sorry the title is not very good.) I came across Centering full-page tikz images - with mid-document paper size change and its answer https://tex.stackexchange.com/a/55421/11820 which I use as a ...
user avatar
  • 1,971
0 votes
0 answers
31 views

Wrong spacing when inserting text with command [duplicate]

I defined a new command called \dofile to reference a file that does not have a permanent name yet. The command by default returns the name of the file in typewriter font, since that is how I want it ...
user avatar
2 votes
1 answer
48 views

Construct new environment with \bgroup...\egroup

The following code is just for experiment It would result in a framed box(seem like \fbox{\parbox{2in}{...}}). But it fails. What's wrong with my code? Yet framed box in this example is not my root ...
user avatar
  • 2,321
-3 votes
0 answers
77 views

Why is my lstlisting environment interpreting LaTeX text?

I defined multiple lstlisting environments for different purposes. For some reason the text inside these environments are interpreted by LaTeX and I get errors like "unclosed $" etc. This is ...
user avatar
1 vote
2 answers
44 views

Lost bullets in a custom environment

I have defined two custom enumitem environments with a grey background. The first one is for an inline itemize and a second one is for a normal itemize. The second one lost the bullets and I wonder ...
user avatar
  • 111
0 votes
0 answers
43 views

How to make two environments "stick together"

So I have a theorem and proof enviroment defined as follows: \documentclass{article} \usepackage[dvipsnames]{xcolor} \usepackage{tcolorbox} \usepackage{hyperref} \usepackage{cleveref} \tcbuselibrary{...
user avatar
  • 1
0 votes
1 answer
31 views

In the exam document class, how to use EnvUplevel for solution that spans multiple pages?

In the exam document class, how to use EnvUplevel for solution that spans multiple pages? Here is my code. (It works perfectly if the solution is within a page) (I am using page size a5) \...
user avatar
0 votes
1 answer
43 views

Creating an end-of-chapter Exercise environment

I would like to define two environments: chapterexercises and exercise, which will appear at the end of each book chapter. Output format sample: Homework Exercises for Chapter 3 (centered, top of ...
user avatar
0 votes
0 answers
58 views

Optionally discarding contents of environment or saving it

I'm trying to set up an environment whose body is either written to an external file, verbatim, or ignored entirely, at the user's option. In either case, the body is to be replaced by an external ...
user avatar
0 votes
1 answer
21 views

Remark environment for book class: unexpected headers and amsbook error

I wrote a LaTeX custom environment for Remarks id by chapter#.remark#. My first try, using \numberwithin (followed Kopka-Daly 4th ed, p.288) is shown below with a tester. \documentclass[12pt]{book} \...
user avatar
0 votes
1 answer
75 views

How can I define this new math mode environment with comma-separated keyval options?

My MWE using LuaLaTeX: \documentclass[oneside,DIV=12]{scrbook} \usepackage{scrhack} \usepackage[automark]{scrlayer-scrpage} \usepackage[english]{babel} \usepackage[babel]{microtype} \usepackage{...
user avatar
0 votes
2 answers
17 views

misalignment problem about newenvironment

My code: \documentclass{article} \usepackage{amsthm} \usepackage{enumerate} \newenvironment{mypro}{\begin{proof}\hfill\par\noindent}{\end{proof}} \begin{document} \begin{mypro} 1\\ 2 \end{...
user avatar
  • 1
3 votes
4 answers
77 views

Why is a box seemingly emptied after closing an environment

I'm attempting to fill a box, within an environment, to be used after the environment is closed, similar to how \begin{lrbox}{\boxname} ... \end{lrbox} works. However, for some reason it seems that ...
user avatar
  • 133
0 votes
1 answer
37 views

How can I define an environment similar to alignat, but calculates the number of columns automatically like align?

I've read several posts explaining the difference between align and alignat such as this TeX SE answer. I want to make a new environment with the capabilities of align (create as many as desired based ...
user avatar
0 votes
1 answer
55 views

How to adjust vertical space before and after center environment

It seems that there are vertical blank spaces before and after the center enviroment, as shown in the attached picture. My question is: how to adjust these vertical blank spaces? Code: \documentclass{...
user avatar
  • 2,321
13 votes
4 answers
977 views

How can LaTeX form an environment of Bionic-Reading style?

The Bionic Reading tries to find every word, and make the first part bold. I wish there is an environment to imitate that, which types \bionic{Confucius said: Madam, I'm Adam.} and it is interpreted ...
user avatar
0 votes
0 answers
17 views

Mdframed. First line jf block with negative indent

I use mdframed as so \documentclass[twoside, 12pt, openright]{extbook} \usepackage[a5paper, outer=15mm,inner=15mm,top=20mm,bottom=15mm,footskip=1.5em,headsep=4pt,headheight=1em]{geometry} %\usepackage[...
user avatar
1 vote
1 answer
21 views

Help with newenvironment for unnumbered theorems

First I tried this \newenvironment{axioma}[2]{\newtheorem*{#1}{#2} \begin{#1}}{\end{#1}}. It did not work. Then I tried \newenvironment{axioma}[1]{\newcommand{\axiomhead}{\newtheorem*{kkk}{#1}} \...
user avatar
0 votes
1 answer
34 views

Hide Algorithm environment

I would like to hide the Algorithm environment as shown in the attached pic below. That is please remove "Algorithm 8.1" which is highlighted in blude. The code is provided below: \begin{...
user avatar
  • 1,253
0 votes
0 answers
17 views

New environment gives "File ended while scanning use of \thmt@collect@body."

In the code below, I use starred theorems through some macros and commands. \documentclass[]{article} \usepackage[english]{babel} \usepackage{amssymb,amsthm,amsmath,xparse} \usepackage{hyperref} \...
user avatar
0 votes
1 answer
50 views

Create side-by-side environments in Latex

I am trying to create three environments that are beside one another and do not fill the entire page as seen in the attached image. Within each environment, I am trying to add the cvref function, ...
user avatar
0 votes
2 answers
70 views

Synctex: make it work with environment accessing its content (e.g. environ or xparse +b option)

If I create an environment using environ and \BODY or xparse and +b, the synctex functionality breaks: instead of going to the appropriate line, it goes at the end of the environment. I guess that the ...
user avatar
  • 5,093
0 votes
0 answers
27 views

Creating a section containing notes

What is needed: A section at the end of the document, say Notes, and an environment, say NewNote with the following requirements: The section Notes appears at the end of the document. An instance of ...
user avatar
  • 297
1 vote
1 answer
23 views

How to change alignment of \uplevel in exam class?

I am trying to mimic the exam style of the Dutch central exams (high school) in LaTeX so my students can get used to the exam format. I am using the exam package from LaTeX and I have almost nearly ...
user avatar
0 votes
1 answer
35 views

How to define a custom description environment?

I want to define a new "custom-description" environment, say my description that taken in one length argument and produces the result that is achieved by the following code: \documentclass{...
user avatar
  • 297
1 vote
1 answer
51 views

Create environment whose contents are passed to tikz-matrix

Here is some code that works perfectly well (this code is based on this answer): \documentclass[tikz]{standalone} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture} \matrix [matrix of ...
user avatar
  • 1,373
0 votes
0 answers
115 views

How may I create a Multiple correct answerS' exercice using xsim

I would like to adapt the MWE below to accept and display MULTIPLE correct answers exercices using xsim. %Code to adapt from @cgnieder: \documentclass{book} \usepackage[no-files]{xsim} \usepackage{...
user avatar
  • 1
0 votes
1 answer
75 views

`widetext` doesn't play nicely with the `osa-article` documentclass; are there alternatives?

I'm writing a manuscript for publication in one of Optica's journals, so I'm required to use the osa-article documentclass. I have a very long equation which can't be broken up into several lines. I'...
user avatar
  • 182
0 votes
0 answers
36 views

How do I remove the number in front of the Theorem

I am trying to remove the number in front after the theorem (after Newton, 1687) seen below: This is the code corresponding to the whitebox: Any thoughts? Minimum Working Code: \documentclass[.....]{...
user avatar
  • 1
1 vote
1 answer
39 views

Example with clubsuit (no ntheorem)

I would like an example environment which is numbered according to theorems (e.g. theorem 1, example 2, theorem 3, example 4, ...) and ends with a clubsuit. I've already seen this solution, but I ...
user avatar
  • 113
2 votes
1 answer
84 views

How to change an environment in its body

I have the below code. \documentclass{article} \newcounter{ex} \newenvironment{ex}{% \par\noindent\refstepcounter{ex}{\bfseries Ex \theex.\, } }{} \...
user avatar
10 votes
1 answer
119 views

\NewDocumentEnvironment eats the first non-letter token when used for verbatim environment

I was messing around with creating verbatim environment saving its contents to a file like the one described in verbatim package documentation (end of section 2.2), but using latex3 features. It ...
user avatar
  • 315
1 vote
0 answers
52 views

Macro for computing subtotal (hide subtotal)

I've been trying to modify the following code which I have obtained from Macro for computing subtotal Tex Question. My MWE with my not so great solution. \documentclass[addpoints]{exam} %%%%%%%%%%%%...
user avatar
1 vote
1 answer
55 views

Custom environment for tcolorbox not working with certain option

I have trouble defining a custom environment for a tcolorbox equation environment. When I define an environment for my tcolorbox with ams align Option I get the error: LaTeX Error: \begin{tcolorbox} ...
user avatar
  • 202
1 vote
0 answers
31 views

What is the right way of cascading styles using nested environments/macros, while each environment/macro might partially stylize its embedded content?

I have asked similar to this question before, but I think I have to describe it in another way. Need What is the right way of cascading styles using nested environments/macros (much like the way CSS ...
user avatar
  • 365
0 votes
0 answers
31 views

Command or Environment for Composing Sonnets

I was wondering if a command or environment might be possible to accommodate the writing of short verse, one that would provide rhyme scheme, even for missing lines. Maybe via an array somehow? My ...
user avatar
  • 2,401

1
2 3 4 5
59