{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
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
189 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
303 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
243 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
448 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
317 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
177 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
152 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
327 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
808 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
270 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
752 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
363 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
120 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
629 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
254 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
934 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?
7
votes
1answer
111 views

Feature Page

Lets say that I want to create a feature environment, which has two columns, in one column there is a picture (with a caption), in the second there is text. For the odd pages, I want the picture on ...
2
votes
1answer
73 views

Cross referencing in numbered environment

I picked up a template to write exams a while ago only. Each problem is written between \begin{problem} and \end{problem}. In the preamble I have \documentclass[12pt]{article} \usepackage{amsmath} ...
2
votes
2answers
105 views

Using environment argument in new macro definition

I'd like to be able to define an environment that takes a single argument and be able to use that argument to redefine an existing macro such that the argument of the environment gets used ...
6
votes
1answer
64 views

`advise` Environment in listings package

I was reading the documentation for the latex listings package and there are advises in it which look like so: I had a quick look in the source code for the documentation and it turns out that ...
8
votes
3answers
689 views

An environment for setting \emergencystretch locally

The following environment, copied from this website about dealing with overfull hboxes, allows one to change the \tolerance parameter for just the paragraph(s) it encloses: ...
4
votes
1answer
2k views

How do I left and right justify text within an align environment

I want to simultaneously have text left and right justified around an align environment. I'm able to do this, but my solution seems like a dreadful hack. I really don't want to prepend every line ...
0
votes
1answer
79 views

Creating custom tabularx

I am trying to create a new environment in order to change the layout for tabularx, since the original is not looking like it should. I want the picture to be on the right side wrapped by the text. My ...
5
votes
2answers
144 views

How to write an environment wrapping document environment

I'm working on wrapping up some patterns used in my research group for creating posters. Since we're using beamer and beamerposter to make these, all documents go essentially like this: ...
4
votes
2answers
127 views

Nesting custom `xparse` environments

I've defined two simple environments with xparse. Problem is when I try to nest todominute environment inside minutes environment: \documentclass[a4paper, 10pt]{article} \usepackage{polski} ...
7
votes
2answers
898 views

Nested Environ's give “! Argument of … has an extra }” error

I tried using two Environ's in a nested fashion, but I get the ! Argument of \marray has an extra } error. Any idea why this happens? \documentclass{minimal} \usepackage{amsmath,environ} ...
5
votes
2answers
882 views

Redefine environment to be a synonym for another

I have a document with many description environments. I would like to change all these description environments to LaTeXdescription environments, without manually changing all the occurrences of ...
10
votes
1answer
101 views

Creating Command with environments

So I repeatedly use this format for embedding a picture and some text beside it, \begin{tabular}{l l} \begin{minipage}{0.3\textwidth} \includegraphics[SCALE]{NAME} \end{minipage} & ...
12
votes
1answer
622 views

Creating a new environment with referencing

I'm trying to create a referenceable "system" environment that basically displays an equation with a custom counter. Then I want to reference the environment with autoref, so as to have "System (S1)" ...
2
votes
1answer
211 views

Interrupt environment with command

At the moment I'm trying to figure out how I could interrupt an environment. What I did so far... \documentclass{article} \usepackage{amsmath} \newenvironment{envnew} { \begingroup \csname ...
2
votes
1answer
124 views

How to remove indents for the initial list but indent all nested lists?

I'm trying to use enumitem to modify my lists so that they're flush to the left side of the paper but so that any nested lists are properly indented. This is what I've tried: ...
8
votes
3answers
282 views

Indirectly defining two active characters within an \AtBeginDocument command

I'm trying to define a macro that uses two active characters inside an \AtBeginDocument command. I can write a macro such as the following using only one active character: \catcode`\_=13 \begingroup ...
3
votes
1answer
80 views

How to indent part of line to certain amount?

I apologize if this is a basic question, but I'm new to LaTeX and typography in general, and I'm not sure how to articulate my question properly. I have a document which looks like this: ...
3
votes
2answers
176 views

list environment to set different paragraphs within an item

I'm trying to create a document with exercies and solutions. Since exercises often come in different parts (such as (a), (b) and so on), I want to use lists for the solutions. However, solutions are ...
11
votes
1answer
280 views

New list environment: automatic enumeration with “a posteriori” format

This is a follow-up question to Nested enumerate labels with parent label appended plus a single set of enclosing parentheses First and foremost, sorry for my English, I'm learning it currently. ...
2
votes
2answers
678 views

Problem using \textblock with \newenvironment

I want to redefine the frame environment in beamer so that the contents are inside a box in the center of the frame, but when I try defining the new environment like: \newenvironment{hframe}[1] ...
3
votes
0answers
307 views

problem with mdframed commands [closed]

I was trying to highlight some text as shown in this post, but I'm having problems. the following works for me \documentclass{article} \usepackage{xcolor} \usepackage{mdframed} \usepackage{lipsum} ...
6
votes
2answers
93 views

How to produce white space for all text lines of an environment?

How can I produce whitespace before each line of an environment. If I have the following command in the preamble \newenvironment{myenv} ...
6
votes
4answers
1k views

What is the shortcut for triggering environments in LyX 2.0.4 without having to use the mouse?

I have LyX 2.0.4 installed on Mac OS X Mountain Lion. In earlier versions, there was a shortcut to trigger environment without touching the mouse - allowing a more efficient write flow. I wonder if ...
5
votes
2answers
139 views

\newenvironment creating an extra page

The following code produces: \documentclass[11pt,twoside,openany]{book} \usepackage{amsmath,amssymb} \usepackage{lipsum} \usepackage{multicol} ...
4
votes
1answer
251 views

more margin before block

I have the following: \documentclass{beamer} \usepackage{graphicx} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{xcolor} %\usepackage{colordef} ...
10
votes
3answers
559 views

Creating a new environment for multiple choice questions

I am trying to create a new environment for multiple choice test questions. I want to make sure that every question has a number and has a constant indentation: 1. Lorem ipsum dolor sit amet. ...
7
votes
2answers
293 views

How can I define a custom listing environment?

I am trying to define an enviroment for a specific programming language, F#. Here's my code: \definecolor{bluekeywords}{rgb}{0.13,0.13,1} \definecolor{greencomments}{rgb}{0,0.5,0} ...
8
votes
2answers
101 views

Define a command so that it is only active within the document environment

I would like to configure a custom command so that it only affects the document environment. Because the command changes a number of catcodes, it has to be included after the begin{document} tag in ...