Tagged Questions

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

3
votes
1answer
77 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
105 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
289 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
111 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
62 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
212 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
255 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
79 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
151 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
81 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
69 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
680 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
704 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
330 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
68 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
465 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
464 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
78 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
281 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
119 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
119 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
688 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
602 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
256 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 ...
6
votes
3answers
850 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
148 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
129 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
99 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
152 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 ...
3
votes
1answer
98 views

Prevent environments from breaking in two pages

I am making my own environments for a mathematical document (environments such as Theorem, Definition, Lemma... which often consists of a title corresponding to the environment and possible things at ...
5
votes
1answer
150 views

environment and newcommands

I am writing a summary of my methods in c++ where the outputstyle is always the same like that: TestFunc (Title as subsection) Method Boolean TestFunc(Integer MyPar) (this should be in a Lstlisting ...
4
votes
3answers
2k views

DeclareDocumentEnvironment: missing control sequence inserted — \inaccessible

I'm setting up a skeleton CV package for a friend for him to customize, and I'd like to make it as user-friendly as possible. To effect this, I'm using keyval and xparse. ...
3
votes
1answer
105 views

How to make star Exercise and its environment answer?

At here How to make an environment star Exercise?, I posted make star Exercise. How to make star Exercise and its environmet answer? Example, with Exercise 1.1, we have Answer 1.1, with Exercise ...
5
votes
3answers
259 views

Problem with newenvironment

I'm defining new environment and I'm trying to pass to it two arguments: \newenvironment{ctable}[2]% {% \begin{center}% \begin{tabular}{#1}% }% {% \end{tabular}% \captionof{table}{#2}% ...
6
votes
0answers
334 views

How to create a framed proof attached to a theorem?

I am trying to create a customized "proof" environment attached to a theorem. It looks like this: So there is first the theorem, and then a gray bar starts on the inner margin. It ends, when the ...
14
votes
1answer
338 views

Theorem with separate tikz environments for header and body

My initial question: I'm writing my lecture notes in LaTeX and used some customized theorem environments with amsthm so far. Now I wanted to redesign those theorems with help of tikzpicture. That's ...
2
votes
1answer
136 views

Using data from tabulary to typeset columns

While trying to write a better answer to this question, I've made several (probably quite bad) attempts to use the tabulary environment to typeset paragraphs to try to in some way be able to split a ...
4
votes
1answer
339 views

Converting string to number

I am trying to write an environment which provides (some of) the functionality parallel environment through tabular syntax so that the following two code snippets would give equivalent results: ...
5
votes
1answer
477 views

Splitting a command syntax across a \newenvironment definition

This question is a direct follow-up to the question Can a \newcommand Definition Contain Braces as Substitution Text? I asked yesterday. The following example is once again a counter-intuitive one, ...
2
votes
0answers
87 views

Custom environment splitting between pages [closed]

I created a custom environment for theorems using mdframed package: \newtheorem{theorem}{Theorem} \newtheorem{twierdz}[theorem]{Twierdzenie} \newenvironment{twierdzenie} ...
7
votes
2answers
122 views

An environment for two-way rules in category theory

I want to typeset some category-theoretic calculations involving adjunctions (sometimes called two-way rules). In short, they look approximately like this (MWE): \documentclass[a4paper]{article} ...
3
votes
2answers
625 views

New environment using mdframed

I'm trying to write a collection of problems and their solutions for my course's textbook. I've created an exercise environment. I'm currently using the mdframed package to create a leftbar that spans ...
3
votes
2answers
169 views

Checking in LaTeX for a specific character?

I have a LaTeX problem that I cannot solve by myself. I have a repeating arrangement of characters which I want to format automatically in LaTeX. 1H-NMR (400 MHz; DMSO-d6): \textdelta 12.41 (s, ...
0
votes
1answer
98 views

Strange white line with \lstnewenvironment

I'm trying to write a \lstnewenvironment for my LaTeX class but I have a strange behaviour. Here's my code : \lstnewenvironment{console} { \lstset { ...