{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.

learn more… | top users | synonyms (3)

1
vote
1answer
23 views

font consistency in environment (theorem…) and in general text

I am using a template, and it uses the font \usefont{T1}{bch}{m}{n}\selectfont{}, the third font in the code and output, for the text in general. But this font is not used inside environments, like ...
2
votes
1answer
316 views

New float environment in tufte-book with alternate caption placement for full width figures

I am trying to define a new environment for photographic plates in a tufte-book.cls book. The environment should: Work just as the existing figure / table environments do for non-starred uses, and ...
5
votes
1answer
26 views

How to end a user-defined environment having conditional start definitions?

For silly example, the following user-defined environment initiates either the itemize environment or the enumerate environment, depending on the optional argument. But if the argument variable cannot ...
1
vote
1answer
41 views

Remove whitespace around own environment

Does anyone know how to remove the whitespace which is created by TeX everytime I use my own created environment? I tried the tricks with \ignorespaces and \ignorespacesafterend but that doesn't seem ...
2
votes
2answers
76 views

Definition of a macro with multiple arguments and usage of \csname

Why does the following code not work ? \Requirepackage{amsthm} \renewcommand\newtheorem[2]{% \NewEnviron{\csname #1\endcsname}[1]{% ##1 : \BODY } } I have seen examples of the use ...
15
votes
2answers
313 views

Environment to stack a word and a number

There is a requirement to write a list of words, underline each word and place a number centered below the line. Using the stackengine package I have prepared the following MWE. ...
3
votes
1answer
55 views

What to use for itemize/enumerate/description type question

I have a lemma in which I want to say something like this: Let f be a function which satisfies either (A) f=0 and f is continuous, or (B) f=1 and f is well-defined. Then f is good. ...
1
vote
1answer
31 views

Problems using hooks

I am trying to duplicate a document using hooks at the beginning and the end. Here is a minimal example of my problem : \documentclass{minimal} \usepackage{environ} \usepackage{forloop} %Repeat ...
4
votes
1answer
47 views

Blank left and right delimiters produce an unknown symbol

I recently compiled one of my files after updating my TeX distribution (including the unicode-math package, as I use the MinionMath font set) and noticed a strange error. In my file I used a cases ...
4
votes
1answer
55 views

How to condense environments and options to one environment?

In order to make grey boxes around code in my document I am using: \usepackage{listings} \usepackage{xcolor} %custom colours \usepackage{mdframed} %nice frames \definecolor{light-gray}{gray}{0.95} ...
0
votes
1answer
24 views

how to create a list for mdframed example boxs

So i found the question Make an Example and shaded box like in the book which fitted to my desires. I modified the box and counter so it fits to my whishes. (first number is the chapter second number ...
2
votes
1answer
26 views

Misplaced frametitle in new environment

In beamer, I defined a new environment for frame. My problem is, the frame title now comes along the text, instead of appearing at the top. See the working example. \documentclass[]{beamer} ...
0
votes
0answers
20 views

Call environment lstlisting without begin-end [duplicate]

I want to create a command for calling the lstlisting environment without the use of \begin{lstlisting}...\end{lstlisting}, i.e. I want to write something like \lst{text in enviromnent}. I have tried ...
3
votes
1answer
214 views

How to change the behavior of user-defined environments using overlays?

first I have to give a link to a related question+answer. I am trying to create a beamer presentation and defined an environment. The environment has an optional parameter and I want that beamer sets ...
1
vote
1answer
57 views

Enumerate with \noindent

I am creating a custom macro for enumerated lists, but with this attempt, I haven't been able to eliminate the indentation of the item numbers. Every time I use \myitemize, the lists still indents. ...
0
votes
1answer
366 views

Making boxed “problem” environment and a solution environment [closed]

I'm trying to make a template for my homework. I've been using a modification of the Harvey Mudd homework class, but there are some things I don't really like about it (functional and aesthetic). ...
1
vote
1answer
23 views

Wrap single command as environment [duplicate]

I am trying to define a note environment, currently it is just a wrapper of \marginpar function like this: \newenvironment{note}{\marginpar}{} but \begin{note} Important Notes \end{note} will ...
1
vote
0answers
36 views

How to make a new figure environment that does additional stuff?

Currently I have a document in which most caption of figures and tables is placed in the margin, using mcaption. But for some figures and tables I need the full width (textwidth and margin). Both ...
6
votes
1answer
109 views

How to track a page change within an environment?

I'm trying to define an environment that can automatically detect when the material within it moves to a new page, reprint one of its arguments at the top of the new page, and change how it closes as ...
4
votes
1answer
60 views

How to define a new left-aligned environment?

I am working on preparing a document in latex, and I need to define an new environment as follow: When the code is: \begin{IF} the sum of $a$, $b$, and $c$ is 10,\\ the product of $a$, ...
1
vote
1answer
32 views

Redefining an environment and summary box using grid and gridleno

This question is inspired by Gonzalo's great answer here concerning his creation of gridleno.sty to enhance the functionality of grid.sty. Ultimately I have two seemingly simple questions (please ...
2
votes
1answer
47 views

Shaded theoremstyle

I'm trying to create a theoremstyle whith a shaded background. As I already have a working preamble I'd like to change as less as possible. Previously I defined an own theoremstyle 'selfdefined' which ...
4
votes
2answers
66 views

Move tag next to equation in align environment

It's my first time asking here but I have got so much help from this site :D My particular case is that I need order and tag Maxwell's equations but I need set the tag in a particular location, just ...
1
vote
1answer
32 views

How to automatically escape special characters in your own environment?

I need to create my environment for examples of source codes. I want it to look like this: Code example: ------------------------------------------------ # This is the code example echo 'Hello' ...
33
votes
3answers
727 views

Do fontsize environments exist?

Without any doubt there are fontsize switches in the form of control sequences (described here for instance.) But, from time to time I ran into code examples where environment versions of those were ...
2
votes
0answers
34 views

(Is it wrong to) Use commands to begin and end equations (?) [duplicate]

I'm helping a professor write the second edition of his book, so I'm working with a lot of "old" code and bad practices. Something I've found is that he has defined macros for beginning and ending ...
2
votes
0answers
39 views

How do I make unruled footnotes within an environment?

I have a single environment, fancyfoot, in which I would like footnotes to have no rules. \documentclass{memoir} \usepackage{lipsum} \newenvironment{fancyfoot}{ \renewcommand{\footnoterule}{} ...
3
votes
2answers
30 views

How can I print beginning and end values of a counter within an environment?

I'm working on a formatting system for standardized tests. Within each section of a test, there are groups of consecutive questions that I might choose to contain inside an environment. ...
1
vote
1answer
22 views

Use macro as totcount counter name

In the top level of the document environment, a macro defined (using \def) can be expanded into the name of a totcount counter. This, for some reason, does not work inside an environment definition. I ...
8
votes
3answers
872 views

Making an anti-clockwise circled arrow around a + sign in a math environment

\makeatletter \newlength\@SizeOfCirc% \newcommand{\CricArrowRight}[1]{% \setlength{\@SizeOfCirc}{\maxof{\widthof{#1}}{\heightof{#1}}}% \tikz [x=1.0ex,y=1.0ex,line width=.15ex, draw=black]% \draw ...
2
votes
1answer
49 views

NewEnviron, \BODY and lstlisting [duplicate]

I was trying to understand egreg's answer to Hide content to show later, and I noticed that there were some problems when using lstlisting or tcblisting environments inside the solution environment ...
1
vote
1answer
57 views

Legrand Orange Book template Example colorbox from black to ocre

In the Legrand Orange Book template, I would like to change the begin and end of the Example Box color from black to ocre: and Here is the code from the structure.tex file where the example ...
3
votes
2answers
77 views

Is it possible to “scan” the text within an environment?

Say I have an environment env which is used like this: \begin{env} *Text* \end{env} Is it possible to "use" *Text* in the definition of the environment (top or bottom part) - similar as a ...
5
votes
1answer
424 views

TikZ Nodes in margin gets overwritten by page-wide tikz environments

I'm trying to improve the typesetting of openly licensed books created by my company. We do the typesetting of all our books with LaTeX. The design of these books requires coloured environments that ...
4
votes
1answer
221 views

converting documentclasses into environments: is it possible?

Rewritten question. For my phd-project i need to quote screenplays. I would like to keep the screenplay layout in my thesis. I know there is the document class called screenplay. Now i am wandering ...
1
vote
1answer
33 views

“Problem definition” environment

Is there such a thing as an environment for defining problems? See this picture for an example of what I want to achieve: Thanks!
10
votes
2answers
135 views

Strikeout all text, including enumerated lists

Is it possible to define an environment that strikes out all text, even in enumerated lists? I am basically trying automate what is currently being done manually in Microsoft Word. I have a body of ...
2
votes
3answers
2k views

Problems with environments in TeXStudio

This document \documentclass{article} \usepackage{amsthm} \newtheorem{lemma}{Lemma} \newcommand{\mycommand}{Here is the command} \begin{document} \begin{lemma} Here is the lemma \end{lemma} ...
4
votes
2answers
89 views

Compilable custom environment when in the body text becomes uncompilable when defined as a new environment

I attempted to make a table which has gray backgound cells except for the first column and the first row colored blue. The following code successfully generates the desired output (although I do not ...
1
vote
0answers
13 views

Is it possible to include a lstlisting code block inside an lstlisting? [duplicate]

I am trying to include a LaTeX code within an lstlisting. But the problem is that the LaTeX code includes an lstlisting, so the \end{lstlisting} within the included code is terminating the actual ...
0
votes
0answers
35 views

Predefining placement of figures and tables in custom package

I am trying to define figures in a new custom package using \newenvironment{name}{begin defs}{end defs} and minipage command (code is given below). if i create a \newcommand{\name}{defs} (named as ...
5
votes
1answer
87 views

What are the uses of being able to refer to an environment body by a macro?

The packages environ and newenviron both provide an alternative to the standard environment macros included with LaTeX. The main difference is that they make it possible to refer to the environment ...
3
votes
0answers
40 views

Extensions to the standard environment, what is out there?

\NewDocumentEnvironment from the xparse package allows accessing environment arguments also in the code that is supposed to go after the content. environ and newenviron allow referring to the ...
1
vote
0answers
69 views

what is the change in macro expansion when using environ and newenviron as compared to the standard environment

The packages environ and newenviron both provide an alternative to the standard environment macros included with LaTeX. The main difference is that they make it possible to refer to the environment ...
2
votes
0answers
41 views

Can the hygiene problem of environ and newenviron be eliminated completely?

The packages environ and newenviron both provide an alternative to the standard environment macros included with LaTeX. The main difference is that they make it possible to refer to the environment ...
3
votes
0answers
44 views

wrap around task environment not working

I am trying to create an environment wrapping a task environment (from the tasks package). To build the new environment I am using the xparse package. \documentclass{article} \usepackage{xparse} ...
15
votes
1answer
274 views

LaTeX programming Inheritance with \newcommand \newenvironment \renew… etc

I'd like to create (or renew) several LaTeX commands and environments, and understand how it works. One of my new environments would be equivalent to \begin{quotation}. So, imagine my \begin{foo} ...
4
votes
1answer
88 views

Macro for creating a table

I want to have a macro that creates tables of a specific type which specialize in multiple choices questions. The required command \createtable{#1}{#2}{#3} has three arguments: The total number of ...
4
votes
1answer
89 views

Intended Paragraphs Inside Environment

I have decided to come back to beautiful LaTeX typesetting after several years. I have just decided to hone up my LaTeX skills but have found out that it will be not easy. Here is my question: I have ...
2
votes
1answer
53 views

Problem with adding exercises - “missing \item error”

I have the following MWE: \documentclass[12pt]{article} \makeatletter \usepackage[dutch]{babel} \usepackage{blindtext} %Paragraphs get numbered continuously \usepackage{chngcntr} ...