{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.
3
votes
2answers
68 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
136 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
114 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
155 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
84 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 ...
6
votes
1answer
169 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
133 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 ...
14
votes
2answers
588 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 ...
0
votes
0answers
202 views
“missing number treated as zero” because of newenvironment
I always get the same errors with these environments. "missing number treated as zero" and "leading text: \begin{satz}" and "Illegal unit of measure (pt inserted)."
\documentclass{article}
...
19
votes
7answers
444 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 ...
10
votes
2answers
206 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
89 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 ...
7
votes
0answers
267 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
49 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
47 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
70 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
75 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
133 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 ...
2
votes
1answer
43 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
103 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
145 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
103 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:
...
7
votes
1answer
168 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
139 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
73 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
99 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
134 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 ...
6
votes
1answer
344 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
1answer
120 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, ...
2
votes
1answer
161 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
194 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
75 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
87 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
47 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
42 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 ...
2
votes
1answer
117 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
87 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
166 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
106 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
57 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
70 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
48 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 ...
5
votes
3answers
162 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:
...
3
votes
1answer
199 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
66 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 ...
4
votes
2answers
78 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
70 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}
...
6
votes
2answers
150 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
124 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
82 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}
&
...

