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
-3
votes
1answer
70 views

How can I write this equation with LaTeX

I am new here. I would like to type an equation with LaTeX but I could not produce what I want so far.. I tried this example: m[\dot{u} - vr + wq -$x_{G}$(q^2+r^2) + $y_{G}$(pq - \dot{r}) + $z_{G}$(pr ...
3
votes
1answer
25 views

Compile a part of an environment and collect the body

There are a question and a answer in an environment. I typeset the question. Then typeset the question and the answer. How can I do this. My file has over 100 questions. \documentclass[12pt]{article} \...
0
votes
1answer
21 views

Add optional arguments before and after “Exercise”

I would like to create an exercise environment for which I can specify two optional arguments, one appearing before the "Exercise" mention and the other one appearing in brackets after the ...
1
vote
2answers
62 views

remove line break introduced by python environment

Suppose in my LaTeX file I need to create a python environment to execute some python code which does not create any LaTeX code. The python environment would still create a (blank) minipage which ...
1
vote
0answers
32 views

Ignoring \belowdisplayshortskip or \belowdisplayskip at the end of an environment: how to do it?

I would like to ignore \belowdisplayshortskip or \belowdisplayskip when it is at the end of a given environment. In the MWE below, I am looking for a command \lookedForCommand that delete the extra ...
2
votes
1answer
19 views

Using theorem environment but theorems not displayed properly

I am using a class file aptpub.cls (Applied Probability, it can be found here) and one of the suggestions for an environment for theorems in that class file is \newtheorem{theorem}{\noindent Theorem}. ...
0
votes
0answers
35 views

set the counter for a new environment

I am writing an article that has lots of algorithms and protocols.I have defined the protocol environment and I want its counter to be different from the algorithm's counter. The first lines of that ...
0
votes
2answers
81 views

Auto-generated dot lines

I want to create a worksheets which is similar to the first example. The below code meets three problems. It can not be breakable Two examples are not top align The command create dot lines, ...
1
vote
1answer
38 views

Renewcommand inside another environment

I create an environment with three commands in the end. They are not compiled when putting after end of tcolorbox. Please explain why the below code is wrong? How does correct them. \documentclass{...
2
votes
3answers
56 views

Generating a list with commands

I am quite new to LaTeX and am a software engineer by day, so please bear with me. I am trying to create list of items that can be generated through the use of some commands to add to that list, ...
0
votes
4answers
76 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]{...
3
votes
1answer
122 views

List of Definitions, List of Theorems, List of Examples, and List of Activities with Kaobook

This is somewhat a follow-up to this question about custom Kaobook environments. In that question, I was able to successfully define some new environments for the kaobook class and have them all share ...
0
votes
1answer
17 views

Tracking changes in abstractbox, figure and table environments with “changes”

I use the changes package for tracking changes for a publication in a journal. Everything works smoothly, but I have problems that the changes can be included in the environments (figure, table, ...
3
votes
1answer
81 views

LaTeX more “basic” commands

Currently learning how to write packages & define custom environments. In many examples I come across unfamiliar commands (such as \oalign). I so far have had no luck finding their meaning online. ...
1
vote
1answer
56 views

What exactly does \\ do in a tabular environment? How could I use obeylines to do it automatically?

I know that \\ is a very overloaded command in LaTeX, but what exactly does it do in the tabular environment? Following my previous question, I have redefined the description environment, effectively ...
0
votes
1answer
22 views

Undesired spaces in \newenvironment break commands

I created a new environment to change the behavior of the toc for appendices. The commands work fine when using them outside \newenvironment, but not within \newenvironment. The root cause seems the ...
4
votes
1answer
200 views

How can I prevent environment contents from being broken across pages?

Consider the following code, copied almost verbatim from this answer, except that two calls to \lipsum, \lipsum[1-4] \lipsum[5][1-10] have been added inside the document's body. \documentclass{...
0
votes
1answer
32 views

Solution Environment

I want to create solution environment like the image below Please help me. Thanking in advanced.
0
votes
1answer
17 views

Right alignment in a custom dialogue environment

I took this newenvironment code from a different question here at tex.stackexchange. It works well but I would like to distinguish the dialogue partners by either left or right aligning the \item. \...
0
votes
1answer
41 views

beamer custom frame environment with options

I'm developing a large set of slides. Some of the slides are about additional material. These should have a different background color and maybe a little logo to visually stand out. To not repeat bg ...
1
vote
1answer
51 views

How to create an environment that flanks its content from the top and from the bottom with lines, the top of which contains a picture in the middle?

I'd like the following code: \documentclass{article} \usepackage{lipsum} % macro definitions... \begin{document} \begin{signenv}{A} \lipsum[1] \end{signenv} \end{document} To produce this: In ...
1
vote
1answer
23 views

How to reference a theorem's items in Italic in the text?

I have a theorem with different items in Roman numbers I want to use \ref{} to reference one of these items in the text. I use the following code, and I get this reference (highlighted part) non-...
3
votes
3answers
66 views

How to extract equation-environments (or other blocks) inside a Latex document?

Situation: At Table of equations like a Glossary or memory help list user Alastor posted a Latex document, which contains several equation-environments. Assuming the real document from his teacher ...
9
votes
2answers
528 views

Make the $, equation and align math environments globally blue

I'd like to make all my math blue. So far I only use the $, equation and align environment, so it'd we nice it it worked for those. If it works for others, that'd be even greater. \documentclass{...
2
votes
1answer
52 views

new environment for tikz matrix of nodes

I am trying to write a new environment that takes a matrix and draws it as a matrix of nodes in tikz. This is a minimal example: \documentclass[a4aper,pagesize]{scrartcl} \usepackage[utf8]{inputenc} \...
0
votes
1answer
37 views

Customize reference in newenvironment

One of my professors in CS have made us use his template to write our master thesis in Software Engineering. When I use \ref{...} it only appears the number, which is a problem because I have multiple ...
6
votes
1answer
77 views

Renaming an environment then replace the original environment

In my case, I'm only interested in the proof environment, but I believe it applies to any other environment. I would like to present the proof environment in two different formats, the "Default&...
0
votes
1answer
31 views

Vertical line next to example environment changes indentation of itemize and enumerate lists

I am attempting to use this example environmment in my book. I really like how it creates a vertical line next to examples. I would like to customize the appearance, but that is a separate question. ...
0
votes
0answers
54 views

Elegant way to define the math environment as a command

I want to avoid typing "begin align" everytime and so I create such a new command \makeatletter \newcommand{\alignEnv}{\@ifstar{\@alignEnv}{\@@alignEnv}} \newcommand{\@alignEnv}[1]{\begin{...
1
vote
0answers
57 views

How can I typeset dialogue in the style of Shakespeares plays (Cambridge school)?

I want to create a centered environment as shown in the image below, with the speaker's name in caps lock, followed by the quote. The only thing I can think of is using amsmath (the \begin{align} ...
2
votes
2answers
45 views

How to redefine macro \\ within environment bmatrix?

I want to redefine macro \\ within an instance of environment bmatrix from package amsmath. But bmatrix does not respect redefinition of \\ outside or within bmatrix: \newcommand{\im}[1]{{ \...
1
vote
1answer
143 views

Custom example environment with colorbox and vertical line for `kaobook` document class

I am making a custom example environment for the kaobook class and would like to modify the second example environment from this question: \usepackage{chngcntr} \usepackage[tikz]{mdframed} \...
0
votes
1answer
26 views

Prevent `floatingfigure` start a new paragraph

Let's say I have a custom environment called solution: \documentclass[paper = B5]{scrbook} \usepackage{fontspec} \usepackage{lipsum} \setmainfont{Libertinus Serif} \NewDocumentCommand\sparsetext{m}{...
1
vote
0answers
30 views

amsthm, environments and vertical spacing [closed]

Is there a way to increase specifically the vertical space before and after Assumption, Lemma, the proof and so on, without increasing \parskip globally? Thank you very much. \documentclass[a4paper,...
0
votes
1answer
49 views

Is there an environment that acts the same way as framebox?

I am trying to make a tcolorboxenvironment. Without the package tcolorbox, I want to have an environment that acts the same way as declarenewentry: \newcommand{\declarenewentry}[1]{\medskip\noindent\...
2
votes
3answers
98 views

Calling different environments depending on a variable

I would like to use a different environment depending on situations. I tried the following but it does not work. Can you help me understanding what's wrong? \documentclass{article} \usepackage{ifthen}...
0
votes
0answers
52 views

Sans serif environment with maths

Is there a way to create a new environment in XeLaTeX in which all fonts become sans serif (like a beamer page), and then it comes back to normal font when the environment is finished? MWE (Edited) % !...
0
votes
1answer
48 views

How to list Supplementary Tables (table, longtable, landscape)?

I need to list Supplementary Tables separated from main tables. This is, to replicate exactly the answer from this post, but for tables, considering that I have different table environments (table, ...
1
vote
1answer
26 views

Custom environment for sequent calculus proofs

I'm using the package bussproofs to typeset sequent calculus proofs with LaTeX. Whilst I'm more than satisfied with the results, writing the code is cumbersome. Thus, I'd like to define a custom ...
2
votes
1answer
36 views

Ignore newline before \end of environment

How do I ignore newlines at the end of a custom environment? \newenvironment{sentence} {} {.} \begin{sentence} This is a sentence \end{sentence} The output is This is a sentence . And I would ...
2
votes
2answers
40 views

Environment delimited by a lfloor-like bar

I'm trying to reproduce the picture below: I want an environment with 1 parameter for the title (on the picture: "Définition 35" or "Définition 36") which is always bold and ...
1
vote
1answer
38 views

Custom tabular environment: Proof Tables for natural deduction

I'd like to define a custom environment for natural deduction proofs which prints tables that look like this: At the moment, I use the tabular environment to write these proofs: \documentclass{...
0
votes
1answer
18 views

Nested environments within tabbing

It seems as though using nested environments within a tabbing environment along with a new line causes a Extra }, or forgotten \endgroup error. Here is a minimal working example: \documentclass{...
1
vote
0answers
29 views

Define question environment in lyx

Maybe this is a simple question, but I don't know the layouts in lyx. How can I write questions and choices environments (with \CorrectChoice) in a lyx layout? \documentclass{exam} \begin{document}...
2
votes
0answers
31 views

Setstretch in conjunction with align in a custom environment creates unneeded vertical space

I have been a long-time lurker, but have found a problem for which I cannot find answered on this discussion board. I have created a custom alignedat environment for which the sole purpose is to ...
0
votes
3answers
41 views

How to align arrays when enumerate

Hi! I wanted to copy that image in my document, but i don't know how to align the arrays used in that code. Here what I did: \begin{enumerate} \renewcommand{\labelenumi}{\alph{enumi})} \item ...
0
votes
1answer
51 views

How to make “Exercise” section

How can I make an environment like this? 1-15. (Section 1 exercise 15): lorem ipsum | <- start here |
1
vote
0answers
22 views

Behavior of environment with optional argument changes when optional argument is not passed

Recently, when I've been working with environments with an optional argument, I've noticed that the behavior changes when I introduce a set of square braces, even when there is nothing inside them. ...
0
votes
1answer
28 views

Setting fancy headers and footers in an environment

I have a document style where environments set page headers and footers using the fancyhdr package and recently have noticed a change in how these behave. It seems the headers set in the beginning of ...
0
votes
0answers
17 views

Memoir - New environment using new float for including source code highlighter minted

I am using memoir for typesetting some python source code examples. I was able to declare ftlisting float for memoir as per minted's creator's github suggestion. List of these floats was successfully ...

1
2 3 4 5
55