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
0answers
8 views

Hangparas environment makes text go off the page

I've been manually making a bibliography by using the hangparas environment from the hanging environment, but the text runs off the page. Here is what it looks like when I compile. Here's a MWE: \...
0
votes
0answers
33 views

How to replace the 'Chapter' in the Chapter title with 'Appendix' in both the TOC and Appendices

I am working on my dissertation and I would like the Appendix Chapters to be labeled 'Appendix' in both the TOC and Chapter title within the Appendices. I am using the book document class. I tried ...
4
votes
3answers
191 views

\color{} inserts blank line after environment!

I use \begin{@empty}\color{red} . . . \end{@empty} to delimit colored text. But it inserts an extra blank line after \end{@empty} in the following situation: \documentclass{article} \usepackage{xcolor}...
1
vote
0answers
16 views

Problem with change the Abstract name

I use the next enviroment for the abstract section: \newcommand{\abstractname}{Prefacio} \makeatletter \if@titlepage \newenvironment{abstract}{% \titlepage \null\vfil \@...
2
votes
2answers
96 views

expl3 - An environment to explain the calculation of an expected value (finite case)

I would like to automate the production of the following output (the formatting is not so good but I will do a better one later). This picture has been obtained using this code : \documentclass[12pt,...
1
vote
2answers
54 views

How to use keyword arguments in a LaTeX environment?

I would like to define a convenient way to pass arguments to an environment using the notation key=value. I don't know how to find this on the documentation. For exemple: \newenvironment{foobar}[3]{ .....
0
votes
1answer
35 views

Increase spacing between paragraphs

I wrote a small environment to write exercises: \documentclass{book} \usepackage{lipsum} \usepackage{tocloft} \usepackage{xparse} \newcommand{\listofexercises}{List of exercises} \newlistof{exercise}{...
0
votes
1answer
21 views

Unable to use macro for \end{<environment name>} for environment defined using \NewEnviron

I would like to use a shorthand to begin and end an environment, such as \be and \ee. This works as expected for standard environments, such as equation as illustrated below. % this compiles fine \...
1
vote
1answer
21 views

KOMA-scripts' \makenote*{} in \newenvironment?

I am using KOMA-scripts' \makenote*{} command to make notes in the margin. Example: %! TEX program = lualatex \documentclass[oneside, titlepage = false, fontsize = 12pt]{scrbook} \usepackage{...
0
votes
0answers
14 views

Using align* inside a newly defined environment [duplicate]

I would like to take this : \newenvironment{myfind}[1] {{\em Find : #1}\begin{eqnarray*}}{\end{eqnarray*}} \begin{myfind} {$\lim_{x \to -1} f(x)$} \lim_{x \to -1^+} f(x)&=+\infty \\ \lim_{...
0
votes
1answer
46 views

Displaying all page numbers in ToC on the left-hand side?

I'm trying to display the page numbers on the left side of the ToC. I used code from the Moving the page number in a table of contents to the left of the titles with tocloft thread and was able to ...
0
votes
1answer
31 views

How to renewenvironment that wrap the base environment?

I would like to add wrap something around an existing environment. Consider an existing environment sphinxVerbatim, I would like to renew this environment by adding something before and after that ...
0
votes
2answers
20 views

Why is code appended to \endabstract still indented?

I'm trying to automatically append "keywords" (defined in the preamble) to the end of the abstract environment. The keywords should not be flush with the abstract, but flush with the body ...
1
vote
1answer
46 views

Same environment with different names [duplicate]

A new environment can be made with: \newenvironment{name}[1]{stuff at the beginning}{stuff at the end} In the document the environment can be created with: \begin{name} different stuff \end{name} ...
1
vote
1answer
29 views

How to redefine the proof environment for INFORMS papers

In almost all journals, proofs are written in a "proof" environment, like this" \begin{proof} PROOF BODY \end{proof} But INFORMS journals have an idiosyncratic way of writing proofs: \...
0
votes
1answer
28 views

Needing suggestions/guidance to create a newenvironment for a table that will be used multiple times

I'm a beginner with LaTeX or TeX in general. I use Tex Studio to write any LaTeX document. I'm writing a document that requires many tables, all based on the same template, think about copy&paste ...
1
vote
1answer
25 views

How to reuse the output of an environment

I have created an environment with \NewEnviron that processes some input. For the sake of the discussion, it is something like \NewEnviron{myworkingenvironment}[1] { \BODY % BODY is expected to ...
2
votes
1answer
33 views

How to build a newenvironment out of a parametric command?

I'm very new here even if I've used Stackexchange looking for answers a lot. For once I can't find the one I'm looking for so I have to ask it. I'm a bit afraid it is a very simple question but I've ...
1
vote
0answers
23 views

Integrate some macro into math environment

For alignment, I write a macro called \protectbox, the core part of it is a minipage environment. And now every time I write a displayed equation, I have to type: \protectbox{% \[ ... \] } ...
0
votes
0answers
24 views

Lined-paper line spacing, and redefining the math environment

(The description is kind of long, questions are at bottom) I'm currently using a lined-paper style, thus need all the contents to be strictly sticking to the line. I've changed the \baselineskip, have ...
0
votes
1answer
15 views

Indent a problem description defined by \newenvironment

I am having trouble figuring out how to indent text in a custom environment \newenvironment{problem}[2][Problem]{\begin{trivlist} \item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}...
0
votes
1answer
81 views

Put the header at top of page (which is now at bottom of previous page)

This question is based on this answer. As it can be seen from this example below, the header "Abstract" is pushed to the bottom of the previous page when the abstract is longer than one page....
0
votes
0answers
16 views

SVMono Example Environment

I am writing a book using Overleaf with the SVMono Document Class (since the book will be published by Springer-Nature). The problem I am encountering concerns the "Example" environment (...
0
votes
0answers
21 views

How to set the length for all sidecaps equally independent from picture?

I have several pictures from different sources like jpeg, tif, tikz, pdf. I would like the captions for all these beside of the figure. I'm looking for a possibility to set the length of the caption ...
2
votes
1answer
38 views

newenvironment and chemfig

Since can't set a label to a chemical reaction with chemfig package, the only solution is put the scheme between \begin{equation} and \end{equation} \begin{equation} \schemestart 2 \ce{H_{2}O} \arrow{&...
1
vote
1answer
18 views

Preventing extra line-skipping before and after an equation environment

I am looking for something I can insert into my preamble which will yield the output of lorem ipsum \begin{equation} math \end{equation} lorem ipsum when I type it with double carriage returns before ...
1
vote
2answers
40 views

Hide environment but keep labels for cross-referencing

I'd like to do something that is very similar to what is asked for (and answered) here: Hiding an environment but keeping equation labels and their numbers inside, but I'd like to go one step further. ...
1
vote
2answers
43 views

How to change dot to colon after theorem in amsthm?

How do I change the dot to a colon in a theorem environment? Minimal Working Example: \documentclass{book} \usepackage{amsthm} \newtheorem*{test}{Test} \begin{document} \begin{test} \end{test} \end{...
0
votes
1answer
54 views

Numbering within sections

I am writing up lecture notes for a class and it gets quite long and has many theorems, lemmas, etc. I would like to know how to get the numbering of these environments to reset at the start of each ...
0
votes
0answers
30 views

Why my \AtBeginDocument and \AtEndDocument don't work in .sty file…?

I'm looking to set up a class that allows me to type a document for both teacher (complete) and students (with holes instead of text) that is differentiated using an \ifprof boolean. My macros and my ...
0
votes
0answers
52 views

Enregistrer dans un fichier annexe dans une classe perso, à l'aide de \AtBeginDocument et \AtEndDocument

Bonjour, Je cherche à mettre en place une classe me permettant de taper un document à la fois prof (complet) et élèves (avec des trous) qui se différencie à l'aide d'un booléen ifprof. Mes macro et ...
0
votes
1answer
22 views

Using tabular in newenvironment for style sheet

What I'm trying to do: Define an environment ''explanation'' in my style sheet that I can use in my documents. It should take the explanation text and label it with ''Explanation:'' on the left of the ...
0
votes
1answer
14 views

Changing linespread in newenvironment

I'm trying to construct a figurenotes environment that should have \footnotesize and a different \linespread but can't seem to adjust the latter. My MWE is \documentclass{article} \usepackage{graphicx}...
3
votes
1answer
26 views

Extra space after \newenvironment

I have a file with the following environment \newenvironment{system}{\begin{equation} \left \{ \begin{aligned} }{\end{aligned} \right . \end{equation}} Which produced the result that I'm looking for ...
2
votes
2answers
54 views

Redefine eqnarray environment to render its content in red

For (copy) editing purposes I'd like to redefine the eqnarray envinronment to render its content in red (or any other colour). How can I do it? Edit. I'll use this trick to better spot and (eventually)...
1
vote
1answer
45 views

Including Graphics in reaction Environment

I want to include graphics from chemdraw etc. (i.e. .eps) within a reaction env of the chemmacros package. With this i I hope to achive usage of the same counter, labeling etc. used in the reaction ...
0
votes
1answer
63 views

How can I format an exercise between horizontal rules with a footer linking to the solution?

How can I get this style of exercise and click at the correction to go there thanks
0
votes
1answer
50 views

Why in numcases centering is disabled when using texlive2020 in win10

I found recently in environment numcases centering is diabled, and the displayed result is pushed right. Below is a screenshot of this problem: I am using TeXLive2020 in Win10. How can I solve this ...
2
votes
1answer
61 views

Does using an option or argument create a space at the end of the beginning of an environment?

This: \documentclass[12pt]{book} \usepackage[T1]{fontenc} \newenvironment*{testenvironment}[1][]{% #1 some% } {} \begin{document} \begin{testenvironment} text \end{testenvironment} \begin{...
0
votes
1answer
45 views

What are the internal macros of a star environment?

What are for example the star versions of the internal macros \flalign and \endflalign ?
2
votes
3answers
63 views

Change color of item label including item[CUSTOM]

I need to create a custom environment for a list which takes a parameter as item label and colors all the item labels red. Additionally, I need to be able to specify a different label for some items ...
0
votes
1answer
34 views

tufte-book: Custom fullwidth environments [duplicate]

I'm using tufte-book and would like to define and environment that is fullwidth but also align-ed (from amsmath). I've tried doing this with \newenvironment{walign}{ \begin{fullwidth}\begin{...
0
votes
0answers
21 views

Align for inside math mode

I would like to have an environment that is the same as align(*), except that it doesn't enter math mode itself, so that the environment can be nested inside math mode. I can find the code for align ...
0
votes
2answers
24 views

Why does a columnbreak between equation environments insert vertical space?

\documentclass{article} \usepackage{lipsum} \usepackage{multicol} \usepackage{nccmath} \begin{document} \setlength{\columnseprule}{0.4pt} \begin{multicols}{2} \begin{equation} a = a \...
2
votes
1answer
24 views

Save environment for redefinition

I want to write a switch that puts my Document into "landscape-mode". If active I want to redefine the multicols environment to do nothing, but I also don't want to loose it for good, since I want to ...
1
vote
1answer
32 views

latex environment writing generate tikz code but insert it later - maybe with tikz keys

I'm trying to write an environment where the user should be able to insert some commands inside the environment (easy by defining new commands inside the environment) but the output of the commands ...
0
votes
1answer
42 views

Change the default font of the equation environment and math mode globally

Is it possible to change the default font in the equation environment and also in math mode globally to mathcal or mathscr? By this I mean that if I typeset $...$, or $$...$$ or \begin{equation} ... ...
0
votes
1answer
52 views

improving theorem environment

The following is a theorem from Algebraic topology written by A. Hatcher. I'm interested in to know how is possible do theorems like this: I know that a new environment has the following form, how ...
1
vote
1answer
45 views

See frames in article mode

My question ignorenonframetext in beamer enables to have only what's between \begin{frame} and \end{frame}. But in Beamerarticle, how can we skip code between \begin{frame} and \end{frame} (i.e. it ...
0
votes
2answers
36 views

Error caused by \ifthenelse within \newenvironment

I am trying to write a new environment for proving mathematical theorems. What I have is \newenvironment{proof}[1][] {\textbf{proof}\ifthenelse{\equal{#1}{}}{.}{of #1.}} {\begin{...

1
2 3 4 5
49