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

7
votes
4answers
421 views

How can I limit the scope of a \renewcommand instruction to “table” environments?

I want to use \renewcommand{\arraystretch}{1.2} to adjust the space between the lines in my table. Since I have used matrices all over my paper (and this command also affect the matrices) I want to ...
6
votes
2answers
151 views

Using an expanded macro for optional environment argument

I'd like to open an environment, passing the content of a macro to the optional arguments. Up to now I tried different approaches using \expandafter, however I could not get the expected behaviour. ...
4
votes
1answer
2k views

Not rounded beamer blocks

I want my blocks to be not rounded. I added this like to my style but without any success. \setbeamertemplate{blocks}[rounded=false, shadow=true] How to make not rounded boxes in beamer? Edit: ...
3
votes
1answer
144 views

Math-mode inception: creating a list environment for individually referenced equations

I'm trying to create a list-like environment properties that could be used as such: \begin{properties} \item[Lemonade Rule] \forall \text{lemons} \exists \text{lemonade} \item a^2 + b^2 = c^2 ...
3
votes
2answers
1k views

\vfill and vertical space

In a two-column document, I would like some text to be positioned at the bottom right of the right column. The text is inside tabular and flushright. An MWE is: \documentclass[twocolumn]{article} ...
5
votes
1answer
194 views

Color part of text and captions

is it possible to color in red part of a text and/or of a caption (let's say, just some words)? I tried to create the environment: \newenvironment{redtext}{\color{red}}{\ignorespacesafterend} ...
2
votes
1answer
75 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
53 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
114 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
171 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
89 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
193 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
118 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
397 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
532 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
132 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 ...
5
votes
1answer
1k 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
189 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
367 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
94 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
58 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
79 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
182 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
107 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
92 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 ...
5
votes
1answer
327 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
112 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
63 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
214 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
283 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. ...
13
votes
1answer
137 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
85 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
154 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
82 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
71 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
698 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
744 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
335 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
69 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
493 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
97 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
475 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
80 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
294 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
2k 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
120 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
120 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 ...
8
votes
1answer
758 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
652 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
269 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 ...