{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
2answers
79 views

Using multline or equation based on a boolean flag

I am trying to define a new environment myeq which can either be an equation or a multline. My use case is that in the preamble, I will define myeq to be either replicate the functionaly of equation ...
2
votes
1answer
36 views

Define Custom Page

How do I define environment such that: It will start a new page; it will be followed by a new page; it will have a custom page color and font color.
1
vote
0answers
55 views

Italic environment

I'm composing a text, in which people will have access for some math questions, and their sequent solutions. Thing is, I want to put the whole question texts in italics, and \textit{} doesn't work on ...
2
votes
1answer
19 views

How to create an environment that embeds an environment inside a macro?

Let's say I have an environment myenvironment and I have the following code : \makebox[\length][c]{% \begin{myenvironment} content \end{myenvironment} } I want to create an environment foo that ...
12
votes
1answer
206 views

When is `\[` preferred over equation* environment? [duplicate]

When is it preferable to use \[ instead of equation*? I find I often use the equation* environment in the following way: \begin{equation*} some expression \end{equation*} Should I instead be using ...
0
votes
1answer
26 views

Redefining and minipaging of standard environments in preamble

When integrating standard LaTeX output from a database or from software like pandoc, the actual content cannot be changed. To still be able to layout the document, it is important to have ...
4
votes
1answer
32 views

New document environment and the tabularx package

I am trying to create a new environment but it gives me some trouble. The compiler keeps telling me that I am missing a } but I don't see where it could be. Here is a code sample. Thanks for your ...
2
votes
1answer
38 views

How to color text inside of a \def

I am trying to color some text inside an xdef command. I am getting the following error: Use of \@undeclaredcolor doesn't match its definition. Does anybody know how to resolve this? Thanks! edit: ...
0
votes
0answers
34 views

I can't find the missing } [duplicate]

I just can't find the missing }. Or that is at least what the compiler tells me is wrong. Can you help, thanks? \documentclass{article} \usepackage{multirow, tabularx} \usepackage{xparse} ...
3
votes
1answer
103 views

How to create theorem boxes

I wrote a chapter for a book, and we use a structure.tex with a lot of definitios and macros. Now I'm writing other book and I would like to use those kind of boxes as below. Note that when the box ...
1
vote
1answer
32 views

How to check if at first \item in a list/start of the list?

I have a (rather rudimentary) self-defined environment, skipitemize, which is as follows: \newenvironment{skipitemize} [1][1] ...
2
votes
1answer
22 views

How to list all items defined in a predefined enviroment

Code is: \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{fancyhdr} \usepackage{pgfplots} \usepackage[letterpaper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry} ...
6
votes
1answer
31 views

Scope Issues with \renewcommand inside \newcommand

I am creating an environment so I can write a book containing information all formatted the same way based on the environment template. Eventually, I would like to be able to write ...
1
vote
0answers
46 views

Is it possible to \newcommand any type of command?

I have been using \newcommand and \renewcommand for defining simple commands like the typical \newcommand{\R}{\mathbb{R}} But now I wonder if I can renew other types of commands. What I want to do ...
2
votes
1answer
47 views

Environment with sub-tags

Is it possible to create an environment usable in this way...? \begin{myEnvironment} \{title}[This is a title] \{year}[2016] \{content}[Lorem ipsum dolor sit amet, consectetur adipisci elit, sed ...
2
votes
1answer
37 views

Vertical Space Between Environments

im trying to get rid of the vertical space between environments, for example: \documentclass[12pt,a4paper]{article} \usepackage[spanish]{babel} \usepackage{ragged2e} \begin{document} ...
3
votes
1answer
37 views

Underline (or otherwise format) all text in custom environment

I'm trying to define a custom environment, in which all text is underlined. I know the underline command underlines its input, but I can't figure out how to get it to work seamlessly with my ...
2
votes
2answers
30 views

How do I create a new float environment with bigger and colored contents?

I have the following LaTeX snippet: \begin{figure}[h] \centering \[\scalebox{2}{\color{blue}$some formula$}\] \caption{a caption \label{fig:the-label}} \end{figure} I'm trying to create a ...
1
vote
1answer
21 views

Changing global properties of figure caption

I'm just looking for a list of global properties which can be changed for the figure captions, such as changing the font size, font type/family etc. If anyone knows of them, or has a link to a ...
0
votes
0answers
42 views

Including BODY in self-defined environment

This is a follow up question to Create array of specific counter values and Using self-defined fields in NewEnviron. I want to use the function mtadd that fills the array mtarr depending on the value ...
3
votes
1answer
50 views

Define a command that opens and closes an environment

I would like to define a command that, starts (\begin{...}'s it) an environment if not in such an environment, and closes (\end{...}'s it) it if in such an environment, for example: \myenum ...
1
vote
0answers
24 views

Using self-defined fields in NewEnviron

I'd like to use a self-defined function inside a self-defined environment. I add an example showing, that the function work perfect outside the environment, but inside the environment myenv, it seems ...
3
votes
2answers
168 views

LATEX ERROR: BAD MATH ENVIRONMENT DELIMITER. (all caps)

\documentclass[letterpaper, twoside, 12pt]{book} \usepackage{amsmath,amsfonts,amsthm} \usepackage{notes} \usepackage{hyperref} \title{MATH 3142 Notes | Spring 2016} \date{Updated: \today} ...
1
vote
1answer
49 views

Modification of some maths environments [duplicate]

I would like to have a minor modification of some standard AMS-environment and realize it as a new one. The problem is that not all the environments allow this procedure. Say, even the mere ...
1
vote
2answers
39 views

lncs - Changing the counter for a specific environment

I am using the llncs document class and I need to set the counter for the environment 'remark', so that when I use \begin{remark} ... \end{remark} I obtain Remark 1 wherever I am in the document. How ...
6
votes
1answer
121 views

Modifying an existing environment, but keeping the name

In my document, I want to follow the advice that says that quotes should be indented and set in a smaller font. Obviously, this is easily done with: \begin{quote}\small ... \end{quote} But ...
1
vote
1answer
32 views

Creating a new environment that combines samepage with align

I want to avoid pagebreaks within an align environment. I can accomplish this with both the samepage and the minipage environments. However, when I try to create a new environment that combines align ...
2
votes
1answer
28 views

set an alphabetic counter for environment

I have a \newtheorem environment of the form \newtheorem{theorem}{Theorem} \newtheorem{lemma}[theorem]{Lemma} which follows the numbering of the section. How can I change the numbering from ...
4
votes
1answer
55 views

New environment with marginnote

I'm trying to make a new environment that uses marginnote like so: \newenvironment{myname} { <some stuff> \marginnote{ } { } <other stuff> } so that when I do \begin{myname} My Text ...
3
votes
1answer
45 views

Convert custom footnote environment with “environ” to endnotes

To convert footnotes to endnotes, I know I can use the endnotes package with the commands shown below. Because I often have long footnotes I have created a custom environment for them using the ...
7
votes
1answer
178 views

Have a command acting on the environment body

I need to turn this \begin{FOO} my little pony \end{FOO} into this \bar{my little pony} I have tried this: \newenvironment{FOO}{\bar}{} But this seems to only make \bar apply on the first ...
2
votes
1answer
71 views

Problem defining a new lstlisting environment

I'm relatively new to Latex and having a bad time using listings inside a beamer presentation. I know I have to use a [fragile] frame to get verbatim environment inside a frame, but for some reasons ...
3
votes
2answers
103 views

hangout first line of paragraph in new environment

This question follows the question 282721 (\command without {} ending at the end of the line?). My new environment does three things: Creates a paragraph of its kind \quote Hangout the first ...
2
votes
1answer
33 views

Problems with creating abstract in custom class

I am working on creating a thesis template for myself and others in my lab to use. I have gotten stuck on creating a specialized abstract environment however. As a MWE (well minimum broken example) ...
1
vote
1answer
64 views

Local equation numbering inside proofs

According to the question asked here and a possible suggestion to the problem which equations should be numbered given here I want to ask following question; I find it a good solution to number all ...
5
votes
2answers
128 views

Comment-like environments and spacing

I often need to "turn off" environments. One way I do this is below in my minimal working example: \documentclass{article} \newenvironment{nothing}{\setbox0\vbox\bgroup} {\egroup} \begin{document} ...
3
votes
1answer
41 views

Footnote environment (memoir, article or amsart)

Is there a footnote environment? Few cases are known% \begin{footnote} The first experiments date back to 1912, when\ldots A second paragraph. \end{footnote} Context I have a customized ...
0
votes
0answers
25 views

highlighting of \begin{} and \end{} in TeXworks

I previously worked in TexShop, where I could for example click on '\begin{enumerate}' and the corresponding '\end{enumerate}' would be highlighted in the same colour. The same went for math mode, ...
1
vote
1answer
34 views

Replacing figure with figure* globally in Pandoc-created documents

I use Pandoc to create TeX files as chapter templates that are then fed back into Pandoc to create the final PDF. This sets some limitations, since some of the ways Pandoc writes TeX is hard-coded. ...
2
votes
1answer
27 views

New environment with parameter for caption [duplicate]

This is my first attempt to define my own environment. I fail with the number of parameters. LateX complains Illegal parameter number in definition of endperformance. This should be a standard ...
0
votes
1answer
55 views

\leftbar color specification

I'm trying to use the \leftbar feature, but I would like the document to support two different bar colors. This issue gets the color set, but only a single global color. I would like some \leftbar ...
10
votes
2answers
240 views

list of all used commands in compiled *.tex-documents

Is it possible to get a list of all the commands used in the compiled documents? I mean, if I use in my various .tex-documents commands such as \emph, \section, \cite, \begin, \documentclass, ...
2
votes
1answer
32 views

Determining whether a line is inside an itemize or enumerate environment

I would like to be able to tell whether a line is inside \begin{itemize} ... \end{itemize} or \begin{enumerate} ... \end{enumerate}. My need for this stems from incrementing a counter for the ...
2
votes
1answer
22 views

tabulary fails inside another environment

The tabulary package works fine in the setup below when I write out the table header explicitly. But when I wrap the exact same commands inside a custom environment, TeX halts at the \par, with this ...
5
votes
4answers
72 views

Change Content Font in tabular Environments

I am trying to change the font in the content of all of the tables in a document from a serif font to a sans-serif font. Specifically, I need something that can be applied to tabular and tabular* ...
0
votes
0answers
31 views

Is it possible to revert a line break after an environment?

Most environments seem to automatically break a line after them. This of course makes sense but I am having a case where I would like start writing in the same line where the environment (minted) ...
3
votes
2answers
40 views

Environment definition error

I am attempting to create my own wrapper for a tikz image but the output is not as expected. Here is the code \documentclass{article} \usepackage{tikz,lipsum, wrapfig} \newenvironment{wraptikz}[4]{ ...
0
votes
0answers
25 views

NewDocumentEnvironment causes extra row [duplicate]

When I use NewDocumentEnvironment of xparse and place a table to be inside this environment, I get an extra row at the end. Same code does not cause extra row in standard newenvironment. Is there a ...
1
vote
0answers
19 views

vim-latex: Environment mapping with arguments

Is it possible to use <F5> to enclose in an environment with arguments? For instance, if I type enumerate and then <F5>, I get the following \begin{enumerate} \item <cursor> ...
0
votes
1answer
43 views

How can I create a problem environment where I specify the problem number?

The ams package's \newtheorem{prob} doesn't work here (without resetting the counter every time I want to skip a problem}. It would be nice if I could use something like \begin{prob}{2-5} Some ...