{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
1k 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 ...
4
votes
2answers
752 views

Making \footnote work in leftbar environment

Sorry, it's me again. Gonzalo has hinted me to the very nice leftbar environment in the framed package, which I now use for definitions, theorems and similar environment. Now I've got a new problem: ...
4
votes
1answer
590 views

Theorems and Definitions as quotes

Most standard styles highlight theorems and definitions using italics. Now this is something I really would like to avoid in my thesis (and generally). Unfortunately, if I just remove this "feature", ...
8
votes
1answer
1k 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
829 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 ...
29
votes
2answers
3k 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} ...
6
votes
1answer
844 views

Starred equivalent in newenvironment

Let's say I want to use the align-environment in a newenvironment like this: \newenvironment{mequation}{\align}{\endalign} This works fine. However, what if I want to use the starred version of ...
22
votes
3answers
9k 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} % ...
7
votes
1answer
7k views

pdfTeX warning: destination with same identifier has been already used, duplicate ignored (weird behavior)

Here is a minimal example: \documentclass{amsart} \usepackage{amsthm} \usepackage[pdftex]{hyperref} \newtheoremstyle{myexercise}{\baselineskip}{\baselineskip}{}{}{\bfseries}{.}{ ...
20
votes
6answers
11k 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
2answers
462 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 ...
10
votes
1answer
3k 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 ...
4
votes
0answers
958 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 ...
11
votes
2answers
20k views

Changing default width of blocks in beamer

I use a custom Beamer theme for my presentations. In my presentations I'd like to use blocks (\begin{block}…\end{block}). These blocks are rendered slightly too wide to fit into my theme. Is there a ...
2
votes
1answer
163 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 ...
3
votes
2answers
2k 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 ...
45
votes
3answers
16k views

Is it a bad idea to use \begin{section} … \end{section} in LaTeX?

In several discussions about relatives merits of LaTeX v. xml, a xml supporter complained that in LaTeX sections, subsections etc are not properly closed, so it is hard to tell where a section ends. ...
14
votes
2answers
421 views

Automatically add quotes

I would like to create a new environment which will behave similar to quote, but with quotes added. I tried something like this: ...
6
votes
3answers
2k views

Number mhchem reactions and create a \listofreactions

Is there a way to create an environment for reactions defined with mhchem that behaves similarly to equation in terms of numbering the reactions (including a \nonumber command)? Can I get a list of ...
14
votes
2answers
3k views

How do you define your environment such as to use […] for some parameter(s)?

In an environment, say \newenvironment{whatever}[3]{...}{...} you instantiante it (if that's the word for it in LaTeX) by \begin{whatever}{first}{second}{third} ... \end{whatever} But how do ...
11
votes
6answers
5k views

Dashed box environment

I am new to LaTeX and I'm having a hard time trying to create a dashed box environment without success. Can someone please share a code for a dashed box environment such as the one in the image? I ...
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 ...
14
votes
9answers
841 views

Looking for a more appropriate version of \cases

Often-times I find myself wanting to write something like, That is, a vertical brace followed by a table consisting of three columns, the first and the last are math, aligned where-ever I like, and ...
13
votes
4answers
12k views

Defining my own proof environment?

How would I define a proof environment that is basically used with \begin{proof} some proof here \end{proof} and it would be equivalent to: \paragraph{Proof:} some proof here \hfill \box ?
25
votes
2answers
789 views

Environment that counts words inside

How can I create the environment that could count words inside itself? More specifically, I want to write an enviroment called "assignment" such that the code \begin{assignment} Some words here. ...
5
votes
2answers
1k 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} ...
10
votes
2answers
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 ...
11
votes
1answer
4k views

How to create (1) a new Environment for LyX's Environment drop-down menu, (2) a new Text Style

My two part question pertains to LyX. How do you create a new "Environment" ("Paragraph Style") for LyX's Environment drop-down list (Standard, Itemize, Enumerate, Chapter, Section, Subsection, ...
11
votes
3answers
1k views

How to pass an optional argument to an environment with verbatim content?

This is an attempt to make clear what happened in this question of xport (now deleted, sorry). The now deleted question included code that tried to make my answer to this question of xport work for ...
1
vote
1answer
253 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
414 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} ...
3
votes
2answers
562 views

Is there package to create a “Problem-Solution” environment that is symmetric for “twoside” pages?

Background The following screenshot shows a Problem-Solution environment that is symmetric for twoside papers. NOTE: The problem heading is on the right side for odd-numbered pages. For ...
10
votes
1answer
3k 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 ...
19
votes
3answers
2k 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 ...
1
vote
1answer
505 views

Listings: new environments with arguments

I have this basic question. How can use arguments with listings? I tried this and it doesn't work: \lstnewenvironment{cor}[2][] {\linerange{#1-#2},\lstset{language=[Sharp]C,,basicstyle=\scriptsize, ...
6
votes
2answers
374 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 ...
3
votes
2answers
494 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} ...
2
votes
1answer
2k 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} ...
28
votes
2answers
4k views

Label and caption without float

I’d like to have an environment that works much like a float, except that it doesn’t float. That is, in fact, I’d like to be able to define an environment that has a label and a caption. I ...
5
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 ...
7
votes
2answers
976 views

Equation environment definition

Where is the full definition of the equation environment? I cannot find it in the .cls files. Is this in latex.ltx? Or something?
1
vote
1answer
2k 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} ...
6
votes
1answer
3k views

Vertical space before environments

How can I control the vertical space before an environment, e.g., taublar or minipage. Here is an example that reproduces my problem \documentclass{article} \begin{document} \noindent ...
5
votes
1answer
502 views

bottomrule not working in a self-made environment [duplicate]

Possible Duplicate: bottomrule not working in a self-made environment I have this environment for consistent tables in my latex documents: \newenvironment{defaultTable}[2] { ...
2
votes
2answers
539 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} ...
3
votes
1answer
955 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: ...
8
votes
1answer
1k 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 ...
18
votes
5answers
4k views

New figure environment

I am writing my PhD thesis. In my manuscript I have Figures in the text and Photographic plates (a figure of figures) in the annexes. The two elements are different and I would like create a new ...
5
votes
1answer
581 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 ...
10
votes
2answers
539 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 ...