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

1
vote
2answers
859 views

In Lyx turn greyed out text into comments

In Lyx I would like to convert greyed out text into comments. The Lyx environment is lyxgreyedout. I have considered switching to another IDE already and it is not an acceptable solution. The ...
11
votes
2answers
970 views

Environments with conditionals in: why doesn't this work?

In response to this question I thought the obvious thing to do was the following: \documentclass{article} \newif\iffoo \newenvironment{foobar}{\iffoo}{\fi} \begin{document} \begin{foobar} Here is ...
5
votes
1answer
971 views

How can one pass the contents of a LaTeX environment to a macro?

I'm working on an exam document class where the user enters in questions something like this: \multiplechoice{Question} {Answer #1} {Answer #2} {Answer #3} {Answer #4} {Correct answer} {Explanation} ...
3
votes
1answer
600 views

Create environment inside another environment?

Why can't I define an environment, that encloses another tabularx environment inside it? For example, why can't I do this: \newenvironment{customTabular}{ % This is the begin code ...
22
votes
2answers
2k views

How to automatically add text immediately after \begin{document}

I attempted to redefine the document environment as follows, but get a complaint that: LaTeX Error: \begin{MYdocument} on input line 13 ended by \end{document}. \documentclass[12pt]{article} ...
3
votes
1answer
825 views

Def in renewenvironment

I redefine a custom environment of mine that uses "local variables": \newenvironment{asdf}[3]{ \def\argi{#1} \def\argii{#2} \def\argiii{#3} %.... } { } But when I do: ...
5
votes
2answers
911 views

How to redefine (via `environ` package) the `pmatrix` environment?

I want to redefine the pmatrix environment provided by the amsmath package (and changed by the mathtools package) for adding good-looking delimiters. The code is below: \documentclass{article} ...
14
votes
5answers
6k views

Customizing theorem name

Suppose I have a series of theorems that I would like displayed as Jim's Theorem. Bob's Theorem. Will's Theorem. rather than as “Theorem (Jim).”, “Theorem (Bob).”, and “Theorem ...
4
votes
0answers
680 views

Declaring environments with xparse [closed]

I'm having trouble with the xparse package's environment creating commands. What I'd like to do in the end is write my own list environment. The toy example below shows my current problem: the list ...
4
votes
2answers
396 views

Strange expansion of a macro inside an environment

I'm, I should confess, a total newbie. I'm trying to generate invoices with LaTeX, so I'm using the fp package. But the strange thing is that calculations occur many times when they should only ...
8
votes
1answer
2k views

Defining my own description environment

I need help writing my own description environment. The only thing I want to change is the appearance of description label. I can achieve what I want universally just fine with the following bit in ...
5
votes
1answer
531 views

Newenvironment and floating figures

I want to create an environment for a list of items, that should look like this for each item: Name Image ....... Image .............. .............. with this environment ...
8
votes
2answers
292 views

How to make a wrapper for the figure and table environments.

I am familiar with the newenvironment command, but I was wondering, how do I carry on the parameters that are used between [ ], i.e [bht!]? I want to make a newfig and a newtab environment that will ...
2
votes
1answer
149 views

Equation name display, not equation labeling/cross-referencing or equation tagging

Is it possible to display an equation name similar to theorem name displays: \begin{theorem}[Convergence of Cauchy Sequences in $\mathbb{R}$] Every Cauchy sequence of real numbers is also a ...
2
votes
2answers
881 views

LaTeX verbatim environment inside lists

I am using LaTeX and I have a verbatim environment inside an enumerate one. However, there is much whitespace between the verbatim text and the following list item. What I have now is something like ...
1
vote
1answer
3k views

Adding Tables to a Minipage Like Environment?

I'm trying to set up an environment to use for examples in my thesis document. I would like to increase margins, change the line spacing, open with "Example :", and close with $\Box$. Minipage works ...
7
votes
1answer
2k views

How to define a new environment with a fancy box (tikz) around sample source-code (listings)?

This is what I want to do: \documentclass{beamer} \begin{document} \begin{frame}[fragile]{Frame 1} Some \structure{Python} code here: % I want to define a new "pythoncode" environment, so ...
1
vote
1answer
237 views

How to make my unusual environment accept one argument?

I cannot find a good title to express my question. Therefore, please parse the following code first. Minimal Code \documentclass[dvips,dvipsnames,cmyk,table]{book} ...
2
votes
1answer
382 views

How to hide a verbatim-like environment in another environment?

I cannot find a good title to express my question. Therefore, please parse the following code first. Minimal Code \documentclass[dvips,dvipsnames,cmyk,table]{book} ...
10
votes
1answer
2k views

verbatim useable with a newenvironment definition?

I'm trying to create a simple newenvironment allowing me to display source code in a verbatim text block with a caption, numbering etc. The solution I'm after is with the in-built LaTeX verbatim ...
15
votes
3answers
1k views

Why does LaTeX make a distinction between commands and environments?

Why does LaTeX make a distinction between commands and environments? Or also: why do we need environments? I ask this because I am defining a number of custom commands (like \question{} and ...
9
votes
4answers
1k views

Use column-separator & (ampersand) inside \newenvironment

I'd like to define a grammar environment which basically wraps a tabular environment. Inside the grammar environment I'd like to use an environment called production to insert rows. Example: ...
3
votes
2answers
394 views

Can this command be converted to environment?

I have a command as follows: \newcommand{\Comment}[1]{&&&#1\tabularnewline\hline} And now I want to convert it to be an environment as follows: \newsavebox{\tempDescription} ...
5
votes
2answers
334 views

Processing the body of an environment multiple times

Dear all, I am new to package writing (LaTeX2e) and to this forum, and I probably read to much of the TeXBook and not enough on LaTeX. My package works, except that verbatim is verboten. Given a user ...
5
votes
1answer
995 views

Defining a custom ‘wrapfig’ environment

[ This is an updated version of http://stackoverflow.com/questions/3233031/latex-defining-a-custom-wrapfig-environment ] The wrapfig package interacts badly with the setup and teardown done by \begin ...
2
votes
1answer
1k views

array package breaks references in a tabular environment

This is a follow-up question to my last question: Defining a new LaTeX environment for numbered two-column proofs Basically, I'm trying to define the following environment: \newcounter{proofc} ...
1
vote
1answer
1k views

bottomrule not working in a self-made environment

I have this environment for consistent tables in my LaTeX documents: \newenvironment{defaultTable}[2] { \@float{table}[h] \noindent \tabularx{\textwidth}{#1} \specialrule{0.5pt}{10pt}{0pt} ...
4
votes
3answers
1k views

Defining a new LaTeX environment for numbered two-column proofs

I'm trying to write up problem sets for my programming languages class, and I want to create an environment for a certain style of proof. Proofs in this style will have two columns, with numbering on ...
6
votes
1answer
867 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) ...
2
votes
2answers
435 views

Beamer and newenvironments

I'm trying to combine beamer overlays and newenvironments: \newcounter{scount} \setcounter{scount}{0} \newenvironment{sitem}[1] {%before \def\data{#1} \stepcounter{scount} ...
8
votes
1answer
973 views

Disable environment contents

I want to prevent the content of a custom environment from being shown. I've tried: \newenvironment{asdf}[3] { %some stuff happens here %...... \begin{comment} }{ \end{comment} } but this ...
22
votes
2answers
2k views

Defining a new environment whose contents go in a TikZ node

I would like to define an environment which typesets the contents in a box, and I'd like to use TikZ (I'm aware of alternatives like fancybox). So I would like something like \newenvironment{abox}% ...
5
votes
2answers
1k views

LaTeX strange new environment definition

I'm creating a Beamer presentation and I wanted to change margin size for single slides. I've found a solution on some old mailing list, adapted it a little and it works perfectly, but I have no idea ...
10
votes
2answers
502 views

LaTeX: non-verse text in verse environment.

I'm writing text in LaTeX in the verse environment. But there are some parts the should not be in verse inside the verse. The way I've done it so far is to define a new environment that begins with ...
5
votes
2answers
637 views

How to get rid of vertical space before and behind the lists

I cannot get rid of the vertical space before and behind the lists. I have code like below: \begin{list}{-}{% \setlength{\itemsep}{0pt} \setlength{\parskip}{0pt} \setlength{\parsep}{0pt} } ...
12
votes
2answers
588 views

How to set preferred PDF viewer for texdoc in TeXLive 2010 pretest.

I had evince, installed TexLive 2010 pretest (ubuntu lucid linx, fresh install). texdoc was using evince. Then I installed kubuntu ontop, and texdoc switched to okular. Now I've installed acroread and ...
4
votes
1answer
908 views

Reduce space before and after an enviroment

A simple(?) question, how do I reduce the space before and after a environment? I suppose I'm after a redefine environment command that I can put at the top of my document. Example I'm using ...
11
votes
1answer
1k views

Insert quotations

I would like to insert some literature quotations in my thesis. My first thought was to modify the verse environment as demonstrated in another question, though the result is not so pleasing. I would ...
10
votes
2answers
968 views

How do I define new environments, and why would I want to?

Asking this question mainly because I could not find it being here already. If this is a dupe, sorry! I've read about defining new, custom environments that can be used like \begin{thisismyown} % do ...