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

4
votes
1answer
124 views

An environment with custom justification

I would like to create an environment called "question" with one argument (being the question number) with a certain alignment/justification. How might I define one so that it comes out like how it ...
2
votes
0answers
24 views

How can I create a wrapper environment for a complicated usage of tabularx? [duplicate]

Possible Duplicate: tabularx inside a \newenvironment I know (at least basically) how to create my own environments using \newenvironment, but I recently encountered a problem trying to ...
7
votes
3answers
198 views

How to change color in an environment?

I have an environment defined as follows: \usepackage{framed} \usepackage{listings} \usepackage{color} \usepackage{tikz} \usetikzlibrary{shapes.arrows} \usetikzlibrary{backgrounds} ...
3
votes
1answer
262 views

passing text to alltt embeded in command (extra newline needed)

I wanted to close alltt inside a command (to add some ornaments around the text), but the spaces that were used for putting the monospaced text into columns was not preserved. I found the solution ...
15
votes
2answers
1k views

mdframed and wrapfig

Before starting the question, I apologize for the large pictures. I had to use some long text to demonstrate the problem. To generate something like: I used the following command: ...
2
votes
1answer
180 views

How to avoid that the \newenvironment text is placed on one single page

I am using the \newenvironment command for the first time and well it's causing troubles. I am using it for creating a new theorem environment \documentclass{article} \usepackage{amsmath, amssymb} ...
5
votes
1answer
131 views

Preferred way of creating problem and solution environments

I know we can create problem-solution pairs using the exercise package but I am looking for something that is much simpler and similar to theorem and proof environments. I have solved this problem in ...
12
votes
2answers
2k views

Difference between \begin{theorem}…\end{theorem} and {\theorem …}

I see that both attempts to display a theorem in the following code generates similar output. \documentclass{article} \usepackage{amsthm} \newtheorem{theorem}{Theorem} \begin{document} ...
8
votes
1answer
3k views

Usage of \hskip \labelsep while creating an environment with trivlist

I am trying to learn how to create a theorem like environment from http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/Theorems.html To keep the code below simple, I am not really defining a new ...
5
votes
1answer
292 views

Savebox with \bgroup/\egroup doesn't work in beamer (for environment)

This works: \documentclass{article} \newsavebox{\mybox} \begin{document} \savebox{\mybox}\bgroup This is a test.\egroup\usebox{\mybox} \end{document} But this fails (Missing } inserted. at the ...
5
votes
1answer
393 views

How to prevent pagebreak for a custom environment?

I use the following custom environment emailHeader and macros to format an email header (credits belong to egreg). \definecolor{emailHeaderBackground}{RGB}{225,225,225} ...
2
votes
1answer
175 views

Strange chapter influence on quotation environment

The code below give a strange result when I comment out the \begingroup end \endgroup: the quotation environment has different vertical space to the text before ("Some text"). What is it that chapter ...
5
votes
1answer
172 views

How to isolate / confine / contain a new font inside of a \NewEnviron (new environment using eviron package))

I have a situation here. I am designing an IPA Vowel Chart and I have created a new font environment for the IPA characters using the IPA font Doulos SIL like this: \newfontfamily{\ipafont}{Doulos ...
3
votes
1answer
571 views

Environments with thmtools => too much space if using itemize at the end (also problem with q.e.d. symbol)

I want to use the thmtools package, because it provides some awesome features for declaring environments (proofs, theorems, examples etc.) And I especially like the "qed" feature which places some ...
1
vote
1answer
454 views

Using WrapFigure near an environment. (Some text inside environment is not wrapped by the wrapfig)

To count words in a document, I am using a custom environment, as suggested here on tex.stackexchange. As can be seen below, when this environment is used next to a wrapfigure, the wrapfigure fails to ...
1
vote
0answers
194 views

Extraneous text from \NewDocumentEnvironment (corrupted TeXLive2012 ?) [closed]

I seem to be getting spurious text (red text) containing the name of the environment, when using \NewDocumentEnvironment (blue text) to define a custom minipage environment with TeXLive2012: Things ...
6
votes
1answer
153 views

alignment problem under new environment

i have defined a new environment called "example" \newenvironment{ex}{\begin{quote}% \refstepcounter{examplecounter}% \textbf{Example \arabic{chapter}.\arabic{examplecounter}}% \quad }{% ...
1
vote
0answers
132 views

xparse regression? Unable to create environment with single optional argument [closed]

I've created a custom environment for displaying code examples in a beamer presentation (for an introductory LaTeX couse no less), but compiling my "old" code suddenly results in an error. According ...
6
votes
2answers
517 views

Making the font size smaller in this mdframed, and turning into a reusable environment

I am very close to getting the mdframed setting that I want: \documentclass[a4paper,10pt]{book} \usepackage[paper=a4paper,twoside=true,lmargin=4cm, rmargin=4cm,bindingoffset=0cm]{geometry} ...
9
votes
3answers
2k views

No indentation at the beginning of environment

I am using the common approach of having indentations for new paragraphs and no indentation directly after a headline. I have an environment for 'information boxes' defined like this: ...
9
votes
2answers
191 views

Continuance of environment

I am using an continuous example in my text, but I don't know how to do define the corresponding nice environment. I am using the amsmath and ntheorem package and defined my own example-environment: ...
6
votes
2answers
621 views

Problem with \renewcommand in LaTeX

Please consider the following code: \documentclass[11pt,twoside,openany]{book} \usepackage[svgnames,x11names]{xcolor} \usepackage{wallpaper} \usepackage{changepage} \usepackage[explicit]{titlesec} ...
2
votes
1answer
211 views

Equation labels in the block environment of beamer class are too close to the right boder

I am using bearmer to write a poster. In the block environment, I have same labeled equations. The problem is the labels are too close to the block border. Is it possible to move the label a little ...
5
votes
1answer
91 views

Problem setting lengths in an environment (spilling outside of the environment)

I am having with spacing between paragraphs in my document, and I think I have been able to trace back to a custom environment I have defined. \makeatletter \def\remarkname{Remark} ...
4
votes
1answer
568 views

How can I create a customized environment?

I would like to write some theorems down like this: \begin{theorem} \begin{preconditions} $A := \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$\\ $B := \begin{pmatrix} 2 ...
2
votes
1answer
224 views

expandable optional parameter to enumerate environment

The MWE below, by using paralist package, is supposed to allow \begin{enumerate}[...] where ... is flexible in "some way" (inherits from enumerates above). \documentclass[a4paper,10pt]{report} ...
3
votes
2answers
109 views

Padded two-column arrays

I am using the following kind of 'padded array' many times: \setlength{\fboxrule}{0pt} \setlength{\fboxsep}{3pt} \fbox{ \ensuremath{ \begin{array}{|l|l|} \hline A & B\\ C & D\\ \vdots ...
5
votes
1answer
196 views

Newenvironment not cursive

I created a new envrionment and it looks good, but I want to distinguish between normalfont and cursive font, so here is my code: \newshadetheorem{beispiele}{Beispiel} ...
2
votes
1answer
833 views

Overwriting environment style

How can I change the style of an element in LaTeX ? I would like to do some basic modifications on some environments. For example changing the text size in quotation, margins in verbatim or the line ...
6
votes
1answer
1k views

Equations in fancy boxes

I've checked the post here, where the package empheq is used for embedding equations into coloured boxes. With that idea, I wrote in my file the following: % in the preambule \usepackage{empheq} ...
1
vote
1answer
576 views

using macros within a (new) environment [closed]

I'm working on my CV, and am trying to format job/education listings to look something like follows: Company or University (Location) Job title or degree received Some description of what I ...
4
votes
1answer
676 views

Onecolumn till end of page in twocolumn mode

I know about using the widetext environment for setting text in onecolumn mode and the multicols package for effortless switching between one- and twocolumn mode, but I think this is not too great if ...
12
votes
2answers
177 views

Is it safe to abbreviate \begin{foo}…\end{foo} with something like \bfoo … \efoo

Can I safely do this: \newcommand\bfoo{\begin{foo}} \newcommand\efoo{\end{foo}} where foo is a standard LaTeX environment? Probably the verbatim environment breaks, but others as well? That way one ...
10
votes
1answer
1k views

Environment to underline/strikeout for comparing versions

I have a TeX file that I'm editing with several collaborators and we use environments to highlight and discuss proposed changes like the following: Some text. \begin{old} Text that I propose to ...
10
votes
1answer
1k views

I need a customized verbatim environment

I would need a verbatim environment with the following behaviour: It is centered (left and right distance to the page edge should be equal). It can be much wider than the regular text, almost using ...
5
votes
1answer
132 views

Customize environment “proof”

I need to create (or customize) an environment "proof" that has the option to explain after the word 'proof' the name of the theorem (or environment) along with its automatic numbering of the theorem ...
5
votes
1answer
284 views

Emulating a shell environment

I'm trying to define a new environment, which emulates a shell. The way I would like to use it: \begin{shell} \item{echo foo}{foo} \item{echo bar}{bar} \end{shell} Which should produce: This is my ...
1
vote
2answers
164 views

Testing if \BODY is empty in Environ

I would like to test whether the string in \expandafter\long\expandafter\xdef\csname\currfilebase\Introduction is empty so that the section is not displayed. This environment introduction is defined ...
3
votes
1answer
75 views

avoid imported pdf page taking whole page embedding pdf within text

I'm using \usepackage{pdfpages} to drop charts into a .tex file. It seems that this is generating a lot of wasted space. Anyone with a suggested fix?
2
votes
1answer
1k views

Example environment with numbering, caption, “verbatim” content

I need to use an example environment like the following. \begin{example}[My Caption, mylabel] My example text \end{example} It should show the text inside a verbatim environment, the caption (like ...
1
vote
1answer
514 views

Howto use Vim + LatexSuite to convert plain text lists to itemize/enumerate etc

I am often burdened with "converting" and "including" stuff into larger documents. I have compiled some scripts and voodoo to ease my work but rather often I'm still facing the task of manually ...
3
votes
1answer
198 views

New environment. Highlight content with symbols and indentation

I'm writing my thesis and I want to highlight some part of my text which resides in a separate paragraph. I like the well-known example of \newenvironment{king} {\rule{1ex}{1ex}\hspace{\stretch{1}}} ...
2
votes
1answer
463 views

Create Custom tabular

Is there a way to make something like tabular such that in a loop we get each column in a line and render them in a custom format. Like this \begin{custom_tabular} l1c1 & l1c2 & l1c3 \\ l2c1 ...
3
votes
2answers
254 views

Ignoring whitespace in a custom environment

I know there has been questions similar to this previously but none of the proposed solutions seem to work for me. I have a few custom environments I am using in LaTeX. Below is the code for a ...
6
votes
1answer
654 views

Beamer newenvironment for theorems

I'm trying to define a new environment for theorems and I'm using this code: % Theorem box \pgfdeclarelayer{background} \pgfsetlayers{background,main} \tikzstyle{thmbox} = [inner sep=1em] ...
4
votes
1answer
184 views

Append the contents of an environment to a hook using \gappto

I have a global hook (=macro) that should be appended to whenever an environment is executed. (Here, defined by the \bhook-\ehook pair.) However, I was unable to derive a working solution. ...
14
votes
2answers
209 views

LaTeX adds an additional blank paragraph after the end of my custom environment

A friend, who is a LaTeX user but isn't very confident with customising it, told me that he would like to be able to put framed paragraphs and framed equations into his documents. So I took it upon ...
1
vote
0answers
187 views

how to create a fully-expandable environment [closed]

I know DeclareDocumentCommand from the package xparse. I am wondering if there is a version for environment ? I could also imagine a trick based on : declare the environment with ...
1
vote
1answer
434 views

Align environment

I'd like to ask how in align environment to number only one of the equations. \begin{aligned} \mathsf{E}[W^{i}_{t}-W^{i}_{s}]&=0,\\ ...
3
votes
1answer
93 views

Storing contents of environment within align

Now we are at it here is another one that has been puzzling me. \documentclass[a4paper]{article} \usepackage{amsmath,environ} \def\storer#1{\def\data{#1}} \makeatletter ...