{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
140 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 ...
2
votes
2answers
55 views

“Runaway argument?” error with \NewEnviron

I have two files. Basically, the main file just loads the environ package and inputs the secondary file. The secondary file creates an environment that basically does nothing, and creates one instance ...
12
votes
4answers
6k views

How do I generate a check-list?

Similar to the itemize or description environments I would like to have a check-list environment, with neat boxes on the right side, that I may check or uncheck. I guess I'm not the first having this ...
2
votes
2answers
72 views

using \def for my own \newenvironment

I am trying to write a command that shortens for a command for writing proof. At the moment, I used to use \newenvironment{proof}% {\textbf{Proof:}}% {\begin{flushright} $\blacksquare$ ...
1
vote
3answers
73 views

Environment suggestion appreciated

I'm trying to achieve construction like this: however I've been pretty unsuccesfull achieving that so far. I think I tried all the wrong environments for that - added that as math function lead ...
3
votes
2answers
52 views

Changed Macro definition reverts to original

I have two commands \testone and \testtwo. \testtwo appears only if there was a relevant \testone before and takes the same arguments. Hence I want \testone to store its arguments in \@repeat@me where ...
3
votes
1answer
18 views

Use Variable as optional input in enumerate

Can anyone tell me how to fix the following problem: The following code produces the error Package enumitem Error: topsep=0em,partopsep=0em undefined \documentclass[11pt]{amsart} ...
2
votes
2answers
41 views

Custom environment for second-level items not vertically aligning properly

While writing a document with lots of enumerate environments, I wanted to add a little subset, 1. So the item is here — and the inset is here Which I did pretty easily. However, when I ...
3
votes
3answers
44 views

Make use of makebox in custom environment

I am working on a custom environment, that might get larger as \textwidth (so \centering won't work), but should nevertheless be centered. I'm currently manually wrapping it with \makebox but would ...
2
votes
1answer
82 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
4answers
257 views

Quote Environment à la Strunk’s ‘The Elements of Style’

How can I have a an environment similar to Strunk's The Elements of Style:
3
votes
1answer
90 views

Keep float out of a environment (for example definitions)

I knew that floats float around and sometimes are placed far away from where one wants them to be. With the times I learned to work with it, and there are already many posts about it. I have a kind ...
0
votes
1answer
152 views

Renew appendix command to remove blank pages

I'm using Steve R. Gunn's Thesis Class. My issue is that Latex insists on inserting a blank page after the first of my 4 appendices, yet at no other point in the document. I believe this is caused by ...
2
votes
2answers
144 views

Cross-referencing to the number of a customized environment with a counter

On the internet I found a possibility to create an example environment that is helpful for linguistic research papers, because it provides all examples with numbers: \newcounter{exa} ...
2
votes
1answer
63 views

Put one part of sentence outside $ math environment

I want the 'assume' written in normal style. So not within the math environment so it becomes italic. This is my code \documentclass{article} \usepackage{amsmath} \begin{document} ...
21
votes
3answers
7k views

Quote environment with reference at the end right

I want to define a quote environment such that after the quote on the right occurs the author with page number. My solution is yet the redefinition of the quote environment \usepackage{amsthm} % ...
3
votes
1answer
54 views

Additional horizontal space when the last line of an environment is full

I have created an environment env which just adds a \medskip and some text (say "Blablabla") after the text inside \begin{env} ... \end{env}. The problem is that if the last line is full, then I get ...
18
votes
2answers
838 views

Kleinberg-Tardos style of book writing

I recently read a book Algorithm Design by Jon Kleinberg and Eva Tardos, which is written in a very unique style. This book doesn't have any typical LaTeX environments such as theorem, lemma, and ...
1
vote
1answer
63 views

framed environment with fixed image in marginpar

I would like to get the exact output below in the LaTeX. But unable to fix it and how to set image in the marginpar for each example environment. My MWE is: \documentclass{book} ...
0
votes
0answers
12 views

Modify proof environment: new line before qed square [duplicate]

I would like to put the QED square at the end of proof on its own line. How can i do that? The qed square should be right aligned and below the last line of the proof.
2
votes
1answer
43 views

error with @ifnextchar and paralist after texlive 2014 update

I've been using a save/restore TeXnique with let/def to redefine the \@enumerate@ command from the paralist package so that the enumerate environment can accept a second optional parameter (a name of ...
1
vote
1answer
40 views

Redefine obeyspaces to newline

I want to typeset code snippets from different programming languages. I couldn't get listings to do what I want (one complete height of an empty line takes up too much space for my liking) and neither ...
10
votes
2answers
546 views

Environment to allow line breaks at “,” in math mode

I find the question and accepted answer to Allowing line break at , in inline math mode? very useful, BUT I would like to make an environment (e.g. "allowbreaks") out of it. The problem is that I'm ...
2
votes
1answer
43 views

Beamer: splitting environment across \newenvironment

I would like to define a new environment in Beamer that creates a frame containing only an itemize (and maybe some other stuff once I this basic case to work). The following ...
1
vote
1answer
17 views

Adding a new crossref type for a user-defined environment

In short, I'm trying to define an environment comment which has its own crossref type and counter. I want to be able to refer to these comment environments later. Looks like cleveref does what I ...
0
votes
0answers
20 views

Show Answer Key with letter alternatives at the end of document

I have a document in which between some explanation texts I insert some numbered questions (it's a book, actually). Here's the basic of the code I have now: \documentclass[10pt,a4paper,oneside]{book} ...
0
votes
0answers
31 views

justifying and scriptsize for all beamer slides

Following the answer here, I'm looking for a way to justify and set the scriptsize font for all beamer slides inside frame environment, I tried: \setbeamertemplate{frame}{/scriptsize/justifying} ...
1
vote
1answer
141 views

How to make an environment same as itembox environment in ascmac package by using mdframed package

I want to make the output same as what I can make from the code shown below. But for some reasons (e.g. some frames extend to multiple pages etc.), I do not want to use ascmac package but mdframed ...
5
votes
3answers
177 views

How to make more than two fancy gradient stripes in tcolorbox?

I use the following fancy tcolorbox definition: \newtcolorbox{mybox}{colframe=black!80,colback=black!10,sharpish corners, skin=bicolor,interior style={left color=black!5,right ...
7
votes
1answer
166 views

Fancy example environment

How do create a colourful example environment like the one here?
5
votes
1answer
295 views

A command to end any environment?

Wouldn't it be nice if we have a command to end an environment in a generic way? Example: \begin{itemize} \item Apple \item Banana \endenv % replaces / is an alternative to, \end{itemize} ...
9
votes
3answers
230 views

How To Make a Special Position Environment in LaTeX?

So I must admit I am way out of my depth and have no idea what I'm doing. I apologize in advance for a long and complicated question. I'm trying to build this output: Which I have successfully ...
9
votes
4answers
1k views

How to use a \write command inside a \newenvironment ?

I'd like to make a new environment which would store its content in a file, so that I can read that file at another part of the document. More specifically, I want to have an environment {proof} such ...
0
votes
0answers
16 views

Macro that feeds its argument to an environment that changes the catcodes

Suppose an environment that reads its contents with changed catcodes (verbatim, CJK, etc). I want to write a macro that invokes this environment on its single apparent argument. The argument is ...
2
votes
0answers
19 views

Two columns in alltt environment

How do I make two columns in an alltt environment?? \begin{alltt} \hlkwd{options}\hlstd{(}\hlkwc{BingMapsKey} \hlstd{=} \hlstr{"clave de acceso de Bing"}\hlstd{)} \hlcom{## código para Bing} ...
1
vote
1answer
1k views

TeXstudio: How to add custom highlighting for custom environment?

Until there is a cwl file for the paralist package, I would like to just include the compactenum environment into the custom highlighting list in the TeXstudio Options. I tried adding compactenum in ...
4
votes
0answers
85 views

How to make a text environment [duplicate]

How can make an environment in which I can write my text and in output, I see it indented with a coloured vertical line? I want the code be like the following: \begin{textbox}[orange][1cm] % [colour ...
1
vote
1answer
59 views

Tikz nodes with `fit=(top)(bottom)` slightly missized

I like to create textboxes via TikZ. I start with that flexible example. And, Yes :) I do create texboxes. Here it is. But I still have two problems.. Q1 I use fit to create light gray ...
1
vote
2answers
49 views

environment - solution environment for exercises (different than proof environment)

I am typing up solutions to a variety of problems in a textbook, and I want to use the proof environment for proofs but a similar environment for solutions. The link here Duplicating the amsthm ...
1
vote
1answer
22 views

varioref's \labelformat for own environment

I defined my own environment for short pseudo-algorithms, and I would like to use the \labelformat command to change the output of \vref. Varioref's documentation says: "The command takes two ...
2
votes
2answers
77 views

how do I add line numbers to itemize environment?

I have an itemize environment that I use in a figure to describe, say, an algorithm or a process. I want to include line numbers, all aligned on the left most side of the figure so that I can refer to ...
2
votes
2answers
43 views

Environment which sends text conditionally to an appendix?

I am writing a paper and would like an environment that has the following property. If some flag is set to "true" in the preamble, all text wrapped in that environment is sent to the appendix. If the ...
2
votes
1answer
25 views

\csuse inside a \NewEnviron using the environment parameter

I am trying define a environment that displays a text specified by the parameter of the environment. The following example demonstrates it: \documentclass{article} \usepackage{environ} ...
4
votes
1answer
64 views

Problem grouping environments

Below are two examples. The first one works fine, no errors no warnings, but on trying to build a doc from the latter, I get a heap of errors. Working: \documentclass[]{article} \usepackage{environ} ...
4
votes
1answer
59 views

Probsoln customization of solution environment (set as marginpar)

I'm using probsoln, and I want to put the solution as a marginpar and with footnotesize. Please look at the MWE below. Writelatex won't compile, spitting out LaTeX Error: \begin{solutionnew} on ...
7
votes
1answer
1k views

Creating environments with different colours and sizes

At the top of my lecture notes I define the following environments: %Student copy \newenvironment{Notes}{\LARGE\color{white}} %My copy (uncomment out "%" below) ...
1
vote
1answer
43 views

Configure newenvironment with xkeyval

I am having trouble getting xkeyval to work with \newenvironment. If I define the whole thing as a command instead, it works perfectly. So my guess is that the problem is not how I use xkeyval, but ...
4
votes
1answer
48 views

new table environment based on ltablex's tabularx

I defined a new environment for some custom tables (to not have to repeat the header and column definitions etc. again and again). \newenvironment{mytable}{ \noindent\tabularx{\textwidth}{|c|c|X|} ...
2
votes
0answers
43 views

Defining a screenplay dialog environment for breaking across pages

Edit: consider this a followup to the answer here http://tex.stackexchange.com/a/63847/64528 I'm trying to create a LaTeX/XeTeX template for screenwriting, specifically to output from an Emacs major ...
2
votes
1answer
72 views

Can't use command with square brackets in matrix environment

I've defined a command that uses square brackets, and when I use it within a matrix environment, the command is not parsed. I stumbled upon a solution to my problem here: "[" Square bracket ...