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

2
votes
1answer
74 views

How to remove \BODY defined in the algorithmic package?

The algorithmic package defines a command \BODY which evidently clashes when used in conjunction with the environ package. More specifically, LaTeX failes to compile when an algorithmic environment is ...
5
votes
1answer
44 views

How make \parshape declared inside an environment to apply the next paragraph outside the environment?

I'm trying to do something like the MWE below: \documentclass{article} \usepackage{lipsum} \newenvironment{myenv}{% \parshape = 4 0pt 0.5\textwidth 0pt 0.5\textwidth 0pt 0.5\textwidth ...
4
votes
3answers
107 views

Creating an environment that uses macros

I have a macro that requires some setup code before being called : \documentclass{minimal} \usepackage{color} \begin{document} % some setup code \colorbox{green}{This is green.} % some cleanup code ...
13
votes
2answers
151 views

Filecontents and newenvironment issue

I need to write some inlined code on an external file, then load it with listings. I would like to define a new environment, but if I do, filecontents does not save the first line of code (see MWE): ...
2
votes
1answer
82 views

Freely movable container

Is it possible to get an environment/container that is able to change the position of its content relative to the position where it would be normally. The content should be able to be anything like ...
4
votes
1answer
174 views

Create new environment on top of another

I'm trying to create a new environment on top of tcblisting (from tcolorbox package) using environ package. Getting weird error about Runaway argument. The MWE: \documentclass{book} ...
1
vote
1answer
110 views

Change heading style in latex environment

I am using the acronym environment to list some acronyms at the beginning of a thesis I am writing. However the default heading style that acronym places doesn't match the rest of my document. I don't ...
4
votes
1answer
313 views

How to make “claim” environments look like “theorem” environment?

I am using LyX 2.0.5 with document class article and 'Theorems (AMS)' in the modules. From what I understand, the claim environment copies its style from the remark environment. I'd like it to copy ...
0
votes
1answer
402 views

Custom environment using the answers package

I want to create a custom environment to be used with the answers package, something like ... \usepackage{answers} \Newassociation{solu}{Soln}{ans} \newtheorem{ex}{Ejercicio}[chapter] ...
2
votes
1answer
115 views

Peculiar pagebreak problem with nested environments

I have been trying to make custom theorem environments because the classical newtheorem command does not suit my needs. I have been stuck with a pagebreak problem which I explain below. Here is the ...
3
votes
1answer
637 views

\newenvironment where all text is typewriter (like \texttt)

I'd like to have an environment that encloses all its content into the typewriter font as \texttt{} does. However, I do not want to use \texttt{} but an own environment, e.g. \begin{allintypewriter} ...
4
votes
1answer
177 views

Making a class to generate colored tables with a predefined layout

This is a follow-up question in which I asked how to define classes with \newcommands into \newenvironments, and I had some good answers to this particular issue. However, the problem that I have ...
4
votes
2answers
263 views

Little indentation despite \noindent after tabu custom-environment

this question is about a (to me) mysterious little indent (looks like an ordinary blank...) after a custom-environment using the tabu-environment. Please compile this MWE: \documentclass[a4paper, ...
4
votes
1answer
91 views

Customized tabular environment

we've quite often have to write tables in our CI layout (colors, borders, fonts, etc). At the moment we use the standard tabular environment with lots of extra instructions (in the environment ...
4
votes
1answer
56 views

Sorted output inside a tabular

Currently I'm trying to create an environment with several different \item-like commands. I want the arguments of the different commands to be ordered by their type. Basically the usage of ...
3
votes
1answer
69 views

Maintain display of arguments for certain folded environments with AUCTeX

When working with some environments (function and friends from l3doc prompted this), it is desirable to have the environment's arguments visible at all times: Some text that, in reality, shouldn't be ...
18
votes
1answer
181 views

Is it bad style to have spaces in environment names?

I've recently realized that, due to how \newenvironment, \begin, and \end work, there is no reason you can't have environment names with spaces in them. As long as you stick with \begin and \end, this ...
4
votes
1answer
92 views

Undefining leftbar environment to eliminate multiple definitions in memoir class and thmbox package

Context : I am using the memoir class, and I was trying to use the thmbox package. But the environment leftbar is defined both in memoir and thmbox. So I was trying to undefine an environment but I ...
5
votes
2answers
90 views

Macro defining environment

How to write an environment such that \begin{comment} Bla, bla. \end{comment} produces no output, and instead defines a macro \@comment whose replacement text is everything that is inside the ...
4
votes
1answer
180 views

How to customize cross-reference numbering of custom environments?

Context: I have several environments with custom counters. As usual, I'm referencing them along to my document but I get only the corresponding counter value as reference. Example: ...
6
votes
2answers
100 views

How can I prevent breaks in a custom environment?

I have a custom example environment: \newcounter{examplecounter} \renewcommand{\theexamplecounter}{\arabic{examplecounter}} \newenvironment{Beispiel}[1][]{% \goodbreak% ...
3
votes
1answer
57 views

Error with nested environment and forced linebreak inside tabbing

I reduced the offending code to this: \documentclass[12pt,a4paper,notitlepage]{report} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \begin{document} \newenvironment{foo}{}{} ...
6
votes
1answer
205 views

The `wrapfigure` environment breaks when put inside another environment

I've tried using the wrapfigure environment (from the wrapfig) package, but it acts in such a way that I can't use it. Consider the following MWE: \documentclass{article} \usepackage{wrapfig,mwe} ...
4
votes
2answers
212 views

How to dim block environments in beamer

One of my beamer slides looks like the following: \documentclass{beamer} \begin{document} \begin{frame}{} \begin{block}{Theorem} Theorem 1. \end{block} \pause \begin{block}{Theorem} Theorem 2. ...
12
votes
1answer
132 views

When is it safe to assume that \begin{<env_name>} and \<env_name> do the same thing

I've been under, apparently, the misapprehension that if you have defined an environment called <env_name> then \begin<env_name> and \<env_name> accomplish the same thing. But ...
3
votes
1answer
76 views

Extracting commands from environment

In Automatic scaling of tikz images in floatrow I was asking how to scale several images in one row to the same height and to scale the resulting row to linewidth. I would like to automate the ...
3
votes
1answer
138 views

Using tabu/tabularx inside xparse NewDocumentEnvironment

My question seems very similar to this, but with tabu instead of tabular*. In fact, switching the options in that example causes the failure I see here. \NewDocumentEnvironment {trace} {} {% ...
6
votes
1answer
76 views

Bullets disappear in nested lists when using \newenvironment

I am trying to typeset interviews using lists. I have created environments for questions and answers to style the \items and their contained text. However, if I try to use these environments within a ...
6
votes
1answer
61 views

The environ package eats a space

I am using the environ package to collect the body of an environment to be used later. It appears that the environenvironment gobbles the trailing space. For example, \documentclass{article} ...
13
votes
1answer
590 views

Typesetting a definition

My current set up for type setting definitions is \newenvironment{definition}[1][Definition:]{\begin{trivlist} \item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}} ...
13
votes
2answers
569 views

Combine minted and tcolorbox

I have the idea to combine minted with tcolorbox. At first, I have created my own minted environments: \newminted[mycsharp]{csharp}{tabsize=2,fontsize=\footnotesize} ...
5
votes
2answers
293 views

TikZ: Using optional arguments in after part of \newenvironment*

How can I pass the optional arguments to a node being drawn in the after part of a \newenvironment*? In the before part this is easy since I can simply use #1. I tried using \edef, but that ended up ...
5
votes
1answer
65 views

Argument in the end of an environment trick is not working

I was trying to define a new environment in which I needed to have an argument in the end code. Thanks to this post, I got that it is not possible without a trick. That is why I defined a command in ...
7
votes
1answer
372 views

defining a centered shadowboxed listings environment

I'm trying to define a environment for code listings wrapped in a shadowbox and centered in the line. Using this code, I can generate the kind of output that I want: ...
4
votes
1answer
96 views

Identical instance of longtabu

Defining a class file, I would like to define a new environment, which is essentially a longtabu. The longtabu is defined to have a variable width left column, which I would like to be identical in ...
3
votes
1answer
437 views

Environment with handwritten font with math support

Environment with handwritten font. I would like to customize an environment called solution as follows. that had the following characteristic proof environment: input "\solution[of Jhon]" output ...
4
votes
1answer
74 views

New environment creates table at the top of document

I have the following code: \begin{table}[ht] \centering \rowcolors{2}{smileOrange!25}{white} \begin{tabular}{|c|c|c|} \theader{Importance & Titre du document & Auteur} ...
3
votes
1answer
222 views

Ignore space in defining environment

Let assume that I want to redefine the quotation environment putting the text in italic and inserting it between quotation marks. I have some problems in adjusting the space after the opening of ...
3
votes
1answer
1k views

Beamer: Custom styles for environments

In beamer, there are some predefined (colour) styles like plain, theorem, definition and remark. My first question is where can I find the list of these styles? and the second one is how can I create ...
9
votes
2answers
115 views

How to improve maintenance of starred/non starred versions of commands or environments

All documentations I've read about starred/non starred versions of commands recommend more or less the following way of doing (following for instance the UK List of TeX FAQ): ...
9
votes
1answer
116 views

Spacing in list with math environment

Check out the following example. I would like to write the code as in the second list, but get output equivalent to the other two. However, there is a lot of extra vertical space after the third item ...
7
votes
1answer
454 views

Duplicating the amsthm proof environment

I am currently writing up some lecture notes and would like to have therefore a "\solution" environment which should work basically as the amsthm \proof environment, just writing "Solution." instead ...
2
votes
2answers
430 views

Undefined control sequence: \undefinedpagestyle at \end{macrocode}

The full source can be found here (static link), but here is the relevant bit: ... % \begin{macrocode} %<*package> % \end{macrocode} % \begin{macro}{\BCSet} % And stuff % ...
3
votes
2answers
214 views

Using more \newcommand's into a single \newenvironment and \newenvironment instances counting

I am trying to write a class (it is my first class) in LaTeX to manage some teams in a tournament, but I am incurring some problems related to \newenvironment and \newcommand. For instance, I wish to ...
5
votes
3answers
648 views

Continuing example Counters in Beamer

I wonder how to get automated continuing example counters in Beamer. Below is my MWE. Thanks for your help. \documentclass{beamer} \usetheme{Warsaw} \setbeamertemplate{theorem}[ams style] ...
5
votes
1answer
128 views

compilation error in creation of new command

I'm trying to manipulate a bit an environment that I've found in internet, in GUIT forum. This is the minimal example ...
3
votes
2answers
111 views

Conditional to \begin and \end some environment

The conditional structure of the macro of the MWE allow print two text strings as "true" and "false" alternatively. So you can print something like "false true false true false true" calling six times ...
4
votes
0answers
91 views

Indentation of Lists in Environments

Based on the answer of Markus Scharrer, I am using the custom lstnewenvironment to get code and Section with my environment. Since I use an environment in an environment (I know it may not be the best ...
1
vote
1answer
120 views

Use Listing in newenvironment

I am trying to do a new environment or command (i tried both) where i can put in the name, description and code of a Method in c++ and it gives me a new section with the MethodName, the code listed ...
0
votes
0answers
32 views

How can I keep an environment all on one page? [duplicate]

In other words, how can I forbid pagination between \myenv and \endmyenv? I thought at first to make the whole thing a box; if I'm not mistaken---this would prevent TeX from breaking it up---but I ...