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
18 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
0 answers
14 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,243
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
47 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
1 answer
28 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,043
0 votes
0 answers
26 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
19 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
27 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
49 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
107 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
60 views
+100

`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
32 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
38 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
83 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
115 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
  • 145
1 vote
0 answers
51 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
42 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
29 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
6 votes
3 answers
330 views

How to make it so that newcommand takes the rest of my line as argument?

I declared a new command to format list elements in LaTeX as follows: \newcommand{\sitem}[1]{\item \makefirstuc{#1},} \newcommand{\eitem}[1]{\item \makefirstuc{#1}.} This works OK, but now I have to ...
user avatar
  • 1,372
0 votes
0 answers
34 views

How to use regex_replace_once (l3regex) for replacing in nested environments/macros?

I am trying to have nested environments, where the outer applies some changes to the output of the inner one. Problem appears when the outer environment needs to use regex commands (regex_replace_once ...
user avatar
  • 365
1 vote
1 answer
30 views

Calling an environment using token contcats (expl3) makes some internal contents show up at the end of document

I need to dynamically apply an environment (or possibly a series of nested environments)on some text using expl3 (latex3) commands. However, the environment behaves differently when concatenate a ...
user avatar
  • 365
0 votes
0 answers
8 views

Hide counter number for single environment

In my preambles, I've defined "Claim" and "Proof of claim" environments so that these are automatically numbered in a coherent fashion. Also, the relevant counter resets after ...
user avatar
2 votes
2 answers
47 views

Create an environment with optional arguments

I want to create environments with two optional arguments like that : \begin{myenvir}[] Title #1 \end{myenvir} \begin{myenvir}[s] Titles #1 \end{myenvir} \begin{myenvir}[a] ...
user avatar
1 vote
1 answer
48 views

Creating an environment with an equation & split?

Following this resource, I tried creating an environment like the following: \newenvironment{splitEq}{ \begin{equation} \begin{split} } { \end{split} \end{equation} } And using it ...
user avatar
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
2 votes
2 answers
100 views

`\newenvironment` throwing errors

I defined an environment: % Custom environment % \begin{subeqns}[eq:label] % ... % \end{subeqns} \newenvironment{subeqns}[1][] { \begin{subequations} \ifthenelse{\isempty{#1}}{}{\label{#...
user avatar
  • 240
0 votes
1 answer
31 views

XeLaTeX error when using nested tcolorbox listing environment inside custom xparse environment

I want to start by saying I don't fully understand how environments work, so I apologize if this is turns out to be a bit out of topic. Desired behaviour I'm trying to create a wrapper environment for ...
user avatar
  • 35
6 votes
3 answers
617 views

Simple doubt about coloring a math environment

How would one produce the following background for the Axioma? What I would like to reproduce are the red colors behind the text. Thanks for any help in advance!
user avatar
  • 265
1 vote
1 answer
28 views

Extend Beamer frame and inherit arguments (and overlays)

I intend to extend a beamer frame to save some overhead when making slides. I've followed an answer here after another answer involving NewEnviron didn't work for me. The beamer user guide has some ...
user avatar
1 vote
1 answer
66 views

scontents – environment content does not show up

I am trying the interesting scontents package. I am quickly facing issues like the environment content is not displayed while I set that key to print-env=true. Where am I wrong? \documentclass{article}...
user avatar
  • 2,447
1 vote
2 answers
62 views

How to replace a command with an environment by using a macro in TexStudio?

My document has many commands like \solution{ ... } Now, I want to replace all those commands with \begin{solution} ... \end{solution} Is there any way to do this with a macro?
user avatar
  • 11
1 vote
2 answers
71 views

Default text in tcolorbox body

I'd like to define a tcolorbox environment, e.g., \newtcolorbox{mybox}{ enhanced, boxrule=0pt,frame hidden, borderline west={3pt}{0pt}{Peach}, colback=Peach!5, sharp corners } But I would like for ...
user avatar
1 vote
1 answer
21 views

Pass environment arguments to nested environment

I have the following environment. \newenvironment{myenv}[0]{% \begin{enumerate}[label = {My Label}]% }{ \end{enumerate} } I would like to have an optional argument for myenv that is a list of ...
user avatar
  • 175
0 votes
3 answers
80 views

Numbering quotations

I want to create a new environment nquote based on displayquote (form csquotes package) that I can number, and display that number on the side so I can cite quotations in my document, like you can do ...
user avatar
  • 307
1 vote
1 answer
37 views

Showing theorems with a given number

I need to write up solutions (in LaTeX) for the problems which our instructor will give throughout the course. In order to do that I created an environment called prob (see below). Basically, it is a ...
user avatar
  • 279
0 votes
1 answer
28 views

Custom command which increments alphabetically

I want to create a custom command, e.g. \foo, which contains a counter which increments alphabetically. \documentclass{article} \begin{document} \foo % foo A Some random text \foo % foo B Some ...
user avatar
  • 3
3 votes
1 answer
48 views

Environment with a given number n of empty pages at the end works for n > 0, but fails for n = 0

I'd like to construct an exam environment that allows to add a number of empty pages at the end of each exam. Each exam consists of a) a cover page, b) main pages with problems and c) empty pages at ...
user avatar
1 vote
0 answers
136 views

weird verbatim-like manual environment writing with luatex preprocessing

I'm currently trying to make my wrapper around tikzpicture while preserving the tikzexternalize functionality (see this post, this and this one for reference where some of my ideas came from): a real ...
user avatar
  • 393
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
0 votes
1 answer
22 views

Pullquote with background color and different font

I have been able thanks to this answer to create a pull quote on the left side of the page. However, it’s missing a couple of parameters to make it more readable, such as the font family and the ...
user avatar
  • 119
1 vote
1 answer
34 views

how to create a new environment like chapter in a book that reads as "Unit"?

For a book (lecture notes) I am writing for an M. Tech course, I like the name the 5 Chapters as 5 Units (Unit 1, Unit 2, Unit 3, Unit 4, Unit 5). How to do this? Thanks for great help!
user avatar
0 votes
1 answer
22 views

The environment inside the new environment

There was a need to create an environment that uses a different environment inside. I can implement this, for example, like this: \newenvironment{new}{ \begin{old} }{ \end{old} } And everything works ...
user avatar
1 vote
2 answers
49 views

To convert a macro to an environment

I decided to convert the macro \scases defined in the nice answer of my previous question by wipet to improve the legibility of the code. (Whether it is really an improvement is based on my personal ...
user avatar
  • 413
0 votes
1 answer
47 views

How to make an environment out of a command with one argument

Given any command with one argument \Command{<arg>}, I want to be able to define an environment EnCommand such that \begin{EnCommand} <arg> \end{EnCommand} has the same effect. In the ...
user avatar
  • 13
0 votes
0 answers
25 views

Pandoc problem reading custom latex environment inside of a custom list

I want to compile a Latex document with the following structure in Pandoc: \documentclass{article} \newenvironment{myenumerate}{\begin{enumerate}}{\end{enumerate}} \newenvironment{myenvironment}{}{} ...
user avatar
  • 1,081
4 votes
3 answers
132 views

Turning soul:hl function into an environment

I am using the function hl from package soul to highlight text. I would like to create a specific environment, that would be used for the highlighting. I tried with newenvironment, but did not figure ...
user avatar
  • 400
0 votes
1 answer
31 views

Theorem in quote environment [duplicate]

I would like to use a theorem-like environment inside a quote environment (or with the same spacing as a quote environment). In this answer the following solution is presented: \documentclass{article} ...
user avatar
  • 1,110
0 votes
1 answer
27 views

environment with an optional argument relating to counter

This question is on the basis of my last question: Define own class options relating to counter. With the help of egreg, here is a class file in which there is an environment named exercise: \...
user avatar
  • 343
0 votes
0 answers
16 views

Cross-referencing Custom Axiom Environment

I made an environment corresponding to @musarithmia’s response to Custom List-Like Environment. However, I wanted to make each axiom cross-referenceable individually, so I wrote this after an ...
user avatar

1
2 3 4 5
58