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

6
votes
2answers
3k views

Create a \lstnewenvironment that creates named listings

I am using the \lstnewenvironment to format a set of code listings in my document. \lstnewenvironment{code} {\lstset{language=haskell, basicstyle=\small\ttfamily, numbers=left, ...
7
votes
1answer
1k views

how to define commands within custom environment

I am working on a custom .cls for typesetting my CV. I am trying to create a custom environment to provide formatting for job/education history. I would like to specify it as follows: ...
3
votes
1answer
224 views

Modify example dropdown in memoir

In LyX, in book format memoir, the drop down has the Example format. Just wanted to know how do I change this Example format layout. Or where is the code to be changed. Edit: The example might be ...
5
votes
1answer
309 views

Suppressing remarks when not needed

I have written some remarks in some of my works that are somewhat informal and repetitive in nature (mainly for my own clarification). I was wondering if there is a way of suppressing them when I ...
1
vote
0answers
43 views

Hidden environment [duplicate]

Possible Duplicate: Suppressing remarks when not needed Is there a way that I can define a new environment in my manuscript which will only be typeset when a flag is activated? Otherwise ...
2
votes
1answer
851 views

Homework template

I've been using this homework template I found online that is pretty light. I am very new to using LaTeX, and although I find writing basic mathematical expressions easy, some of the cooler more ...
1
vote
1answer
180 views

Environments with matched parens in \begin and \end

Suppose I have this sort of expression in a document. \multicolumn{8}{l}{% \parbox{25em}{% \begin{itemize} \addtolength{\itemsep}{-1em} \item foo \item bar \end{itemize}% }} I'd like to define a ...
5
votes
2answers
349 views

Boolean based environments

I know that this question is basically identical to that of Hide custom environment content based on boolean Except I want to avoid using the environ package, which, otherwise, would be the best ...
5
votes
2answers
321 views

Using align within savebox?

I have a custom environment called 'quiz' which puts its input into a savebox and then uses it later depending on a package option. The code works fine, unless I use an align* environment in which ...
14
votes
2answers
448 views

Is it possible to make an image gallery with tikz images?

I create many images with TikZ and I would like to make an image gallery. It should look like this: The gallery should put the image in front of a (gray) background resize the image to a maximum ...
1
vote
1answer
59 views

Show code similar to documentation of packages

I saw that several documentation packages use the environment to show macrocode long codes with page break, the example implementation of the package geometry. How do I do this? I wanted to show a ...
5
votes
1answer
81 views

inner-column labeled matrix

I am slowly becoming more efficient with math environments and macros in TeX, but occasionally come across something where I'm not really sure what the best solution would be. I wanted to hear from ...
1
vote
1answer
95 views

A flag to switch between simple and full mode [duplicate]

Possible Duplicate: How to write hidden notes in a LaTeX file? Conditional typesetting / build Is it possible to add a flag (variable) in my .tex file, so that I can switch among two ...
7
votes
2answers
827 views

How can I change the whitespace above and below center?

Is it possible to control the space above and below center, e.g. the way it can be controlled above and below math display? In other words, is there an equivalent to, say, ...
3
votes
1answer
123 views

A command/environment for “spot the error” type of multiple choice tests

I wonder if there is already a package that makes me create a spot the error kind of test like the one below: This must preferably be in an enumerate environment. I tried a tikz approach but I ...
4
votes
3answers
127 views

Own environment with own label

I want to have an environment for strategies. So far I used the package ntheorem to define such an environment. I use it like this: \begin{strategy}[bla] bla bla \end{strategy} And get: ...
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
25 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
202 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
267 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
184 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
132 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
3k 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
300 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
410 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
176 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
179 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
583 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
472 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
195 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
155 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
134 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
535 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: ...
10
votes
2answers
193 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
646 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
213 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
92 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
587 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
225 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
200 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
851 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
581 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
685 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
2k 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 ...