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

5
votes
1answer
548 views

How to prevent indent on second line with packed itemize?

How to prevent indent on second line with packed itemize instead of itemize? In other words I dont want "Major" to be indented. \documentclass[letterpaper]{article} \usepackage[empty]{fullpage}% ...
4
votes
2answers
160 views

My custom theorem/proof environments aren't playing well together

As can be shown in the following MWE, when I have a theorem environment followed by a proof environment, the proof isn't going into the next line; it's rendering right on top of the text I have for ...
8
votes
2answers
488 views

Patch tabular environment with colorbox

I'm trying to quickly add a colored background using colorbox to all tables as shown in this answer. While I could just update all the TeX by hand, I am trying to patch the tabular environment to ...
10
votes
3answers
326 views

Defining a list environment with multiple optional arguments

I'm trying to define a list environment with multiple optional arguments and with a default values for those arguments. For example, creating a new environment with a name newenv, which accepts two ...
1
vote
0answers
47 views

How to avoid text style adoption in environment? [duplicate]

When I define a macro such as: \newcommand{\mymacro}{a_{\text{sample}}} the "sample" text is italic when used in e.g. an example environment. How can I make sure it will not adjust to this ...
4
votes
1answer
83 views

Problem with referencing to a newenvironment

The reference I'm using below doesn't work. I think I'm missing something in the definition of myclaim. Any ideas? \documentclass{llncs} \usepackage{amsmath} \newcounter{claimcounter} ...
6
votes
2answers
160 views

Getting the first line of an environment

as the title suggests, I'm looking for a way to get the first (printable) line in an environment. My first naive attempt (ignoring the printable requirement) was something like this: ...
1
vote
1answer
333 views

Counters for claims

I want to redefine the claim environment so that it will be numbered but I'm having a hard time with the counters. I want the following: \begin{theorem} thm 1 \end{theorem} \begin{proof} ...
9
votes
1answer
227 views

how to redefine \begin{align*} … \end{align*} to \begin{eqnarray*} … \end{eqnarray*}

Scientific word insists in generating displayed math using \begin{align*} ... \end{align*} and htlatex has a bug in that it does not generate bit mapped images in this case. The fix that I found ...
4
votes
2answers
167 views

I can't use & tabs in the `align` environment while using it inside a custom environment

I've got a custom environment made for problem sets, and it uses a tabular to align the question number and question body. When I try to use & to group parts of an equation together - like if I ...
1
vote
1answer
489 views

Problem using enumerate environment in a proof newenvironment definition

I want to define a simple environment to enclose my proofs, actually I just wanted to put a little square right at the end. So, I made this new environment definition: \newenvironment{Proof}{ ...
3
votes
1answer
123 views

Custom environment problems using environ

As shown by my MWE, I have two small issues that I'd like to get assistance with in fixing. First off: When I start two problem environments one after another without a blank space between the ...
0
votes
2answers
160 views

How do I make frame environment play nice with \textbf?

I am getting a strange error message when I put textbf into a frame environment. Minimal Example \documentclass{article} \listfiles \begin{document} \begin{frame} \textbf{Lemma 1} \end{frame} ...
3
votes
2answers
85 views

Cross-referencing a custom environment with two arguments

Sorry if my question title is ambiguous. I want to write an environment called "problem" that works as follows. I want to be able to write \begin{problem}{1}{2} this is a problem statement ...
8
votes
1answer
265 views

Replacing Leading Minus Signs in Environment

In this question concerning negative signs and the alignment of entries in matrix environments, Heiko Oberdiek gave a great answer in which he uses a user-defined command called \matminus instead of ...
0
votes
1answer
238 views

How to get minipage to fill remainder of width up to right margin?

I'm trying to design a custom question\solution environment for homework assignments (I'm aware of the exam class but I am choosing to try and make my own) and am having problems with the alignment. ...
4
votes
1answer
268 views

How can I make an environment so that I can reserve space for text next to a figure?

I'm working on a layout for a custom textbook class, and I'm having issues getting this environment to work as I like. Here's a shot of my current working layout: I'd like to be able to make an ...
3
votes
1answer
660 views

Can't use theorems in lyx (mac)

I want to switch to lyx, but I'm having a hard time trying to use environments. I red that they are supposed to be as a class in the drop down list at the top left (If I'm nor wrong, together with ...
8
votes
1answer
1k views

Defining a new type of floating environment

In a document, I need to provide some details about specific topics without disrupting the flow of the main document, so that the details may easily be omitted at first reading. To do so, I thought it ...
5
votes
2answers
361 views

Multiple split equations

I find myself again and again using a combination of the gather and aligned environments. So it would be nice to not have to write so much. In particular, it is often only clear after writing the ...
16
votes
2answers
855 views

A special example environment

How can I define an environment named "example" so that: can be broken over pages has a horizontal line above "Example \chap.\no" (e.g. Example 4.10), and vertical line that is spread to the whole ...
19
votes
7answers
815 views

How to create a command that automatically escapes curly braces?

How could I create a command that will automatically escape all curly braces within the current environment? For instance, I would like a command (or environment, I suppose) that allows me to write ...
11
votes
2answers
975 views

A new environment based on enumerate

I have defined the following simple environment: \newenvironment{renumerate}{\begin{enumerate}\raggedright}{\end{enumerate}} I wonder how the above can be modified to use with, say, the following: ...
2
votes
1answer
241 views

Parameterised Enviroments in Lyx

Ok, I have a set of structured data that I want to format consistently. In this case a set of spells for a role-playing game. Now in Latex I vaguely remember I could do something using ...
10
votes
1answer
2k views

Adjusting space before and after a latex beamer block

I wanted to ask you if there is a better way to adjust the spacing between two beamer blocks: \documentclass[slidestop]{beamer} \usetheme{Madrid} \begin{document} \addtobeamertemplate{block ...
7
votes
1answer
93 views

newenvironment with displaymath causes strange extra space/indent on following line [duplicate]

Possible Duplicate: Spacing issue for newenvironment wrapper of equation environment I have \newenvironment{mymath}{\begin{displaymath}\begin{array}{l}}{\end{array}\end{displaymath}} ...
1
vote
1answer
61 views

Avoid skipping before environment

I'm having trouble handling vertical space with my custom environments. I noticed that using \unskip after the environment eliminates that space, but I have found now solution for the space before ...
3
votes
1answer
129 views

Using cleveref with newenvironment

I am trying to refer to a newenvironment using cref from the cleveref package. Here is a MWE that demonstrates what I am trying to do. \documentclass{article} \usepackage{cleveref} % define a ...
5
votes
1answer
85 views

Can I redefine \begin so that it does not complain about undefined environment

I'd like to be able to do the following kind of thing: \documentclass{standalone} \begin{document} Foo \begin{MyUndefinedEnv} Bar \end{MyUndefinedEnv} \end{document} without LaTeX complaining ...
14
votes
2answers
195 views

Repeating environment contents twice

I'm writing a document where I have many code blocks like so: \begin{align} d = \sqrt{ (x'-x)^2 } \end{align} \begin{minted}{latex} d = \sqrt{ (x'-x)^2 } \end{minted} So the first line renders ...
3
votes
1answer
66 views

Renewenvironement error

I'm using the epigraphs package, but try to redefine the epigraphs environment (to later on add something to it, e.g. a page break before). So I thought I do it like this: ...
3
votes
1answer
314 views

how to redefine \href to \htmladdnormallink when in \htmlonly?

I use Scientific word (SW), which generates Latex, then I process the Latex output using Latex2html (l2h) to generate HTML as the support for HTML is better with l2h than SW (table of contents, break ...
4
votes
1answer
249 views

Multiple caption names for listings code (lstinputlisting) based on type of code

In my document I have used: \renewcommand\lstlistingname{Algorithm} \renewcommand\lstlistlistingname{Algorithms} to rename my lstlistings titles. The problem is that now I want to add a different ...
6
votes
2answers
473 views

Defining shared counters for theorem environments *after* environments are defined

I am trying to use the same numbering for theorems, propositions, definitions, etc. This is normally easily be solved by using amsmath and defining these environments and using the same counter: ...
8
votes
1answer
322 views

Custom environment with fancy text indentation

I am trying to typeset text by breaking it into smaller cameos, numbering each cameo, and putting a heading. See below for an example of how I want the typeset text to look. The code with which I ...
11
votes
2answers
178 views

How to define an environment that begins with a node?

Please see the following definition: \tikzstyle{boxStyle} = [draw=blue!80, fill=blue!9, very thick, rectangle, rounded corners=3mm, inner sep=10pt, inner ysep=15pt] ...
7
votes
1answer
108 views

Lists, counters, and refs

I'm trying to create an environment containing a single-instance, numbered list (so that I can easily control the spacing, etc.). The problem is that I cannot used \ref to cross-ref to the enumerated ...
7
votes
2answers
155 views

How to add an environment in the table of contents?

For example, if I use amsbook document class and have the section Problems, how to include problem environments created like: \documentclass[a4paper,12pt, reqno, oneside]{amsbook} ...
4
votes
2answers
337 views

Turning parts of text on and off

Is there a way to turn certain parts of the text on and off in LyX/Latex ? I'm thinking of having something like an environment (lets call it "TL" for "traffic light") and a parameter t such that if ...
7
votes
1answer
836 views

define a new Example environment

how can i define a new Example environment like the image shown in the following? this environment should have the following attributes: endmarks must be positioned at the last line, whether it ...
5
votes
2answers
288 views

Address book form

I want to create an environment (or any other command) for entering addresses. For example, I want something like this: \newaddress \home \name{John Doe} \phone{123-456-7890} \address{100 1st Street, ...
6
votes
1answer
809 views

lstlisting in a newenvironment

I have a problem with the lstlisting package. I want to define an \newenvironment with one obligatory parameter, which will be the caption name for the lstlisting. I will also have other lstlisting ...
16
votes
1answer
374 views

What is the difference between \newenvironment and \newenvironment*?

I vaguely seem to recall reading that \newenvironment* gives better spacing than \newenvironment, but I don't recall any details and I can't seem to find a reference by searching. What is the ...
0
votes
0answers
77 views

Is there a way I can get the LaTeX environment? [duplicate]

Possible Duplicate: Where do I find out how a command/environment is defined? Is there a way I can get LaTeX environment for a given set-up? For example I want to get the value of some ...
10
votes
1answer
123 views

Environment with delayed expansion

I'm trying to define an environment test that stores its contents unexpanded in a macro \testcontents. For example, the code \newcommand{\cmd}{bad} \begin{test} \cmd \end{test} ...
3
votes
0answers
51 views

Two consecutive remarks on LyX [duplicate]

Possible Duplicate: Two math sections of the same type in a row? I am new to lyx, and I am searching for a way to create two remarks one after the other. When I create a remark, the only ...
1
vote
0answers
46 views

How to hold all lines in a defined environment? [duplicate]

\def\Grammercaption{\textbf{Grammer}} \def\grammer{\bgroup\ignorespaces\Grammercaption\fontsize{10}{13pt}\selectfont} \def\grammer{\egroup} I want all lines of text within this environment stick ...
4
votes
1answer
675 views

Creating a custom environment

I'm using the following syntax for my code snippets \begin{minipage}{\textwidth} \begin{lstlisting}[caption=<something>, label=<something>] The REST Endpoint URL is ...
6
votes
2answers
261 views

renewcommand for description

I have a document with many \description environments. All of them are defined like this: \begin{description}[leftmargin=2.5cm,style=sameline] \item[\texttt{foo}] bar ...
1
vote
2answers
978 views

Enumeration of equations in the double dollar math mode

How introduce enumeration of equations in the double dollar math mode (i.e. $$...$$)? Or even better, is it possible to make $$...$$ as a particular math environment, e.g. equation or align?