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

3
votes
2answers
128 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
42 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
1answer
17 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 ...
1
vote
2answers
18 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
98 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 ...
2
votes
2answers
26 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 ...
2
votes
1answer
24 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
35 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 ...
34
votes
4answers
3k views

Most useful/important (La)TeX commands/environments

A friend of mine asked me why I use LaTeX instead of Word/OpenOffice/LibreOffice etc. (no, this is not going to be a question like 'Word vs. LaTeX') I showed him some of the showcases here on TeX.SX, ...
7
votes
1answer
156 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
30 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
78 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
25 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
42 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
122 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} ...
0
votes
1answer
80 views

Longtable integration Stata

As far as I am aware, the available commands that produce LaTeX-formatted tables of stored estimates using Stata, will only produce tables using either the table or tabular environments. Do any other ...
3
votes
1answer
30 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
1answer
19 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. ...
9
votes
4answers
430 views

How can I have numbered verbatim environments?

How can I have an automatically numbered verbatim environment, just like equations? I tried putting it like this: \begin{equation} \begin{verbatim} bla... bla... bla... \end{verbatim} \end{equation} ...
4
votes
1answer
75 views

newenvironment using pgfplotstable

I want to have a newenvironment body as an inline input argument for pgfplotstable. Is it possible to do this without using braces in the body itself? \documentclass{article} ...
0
votes
0answers
17 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, ...
2
votes
1answer
19 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
20 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 ...
4
votes
1answer
152 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
27 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
18 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 ...
3
votes
1answer
244 views

How to change the behavior of user-defined environments using overlays?

first I have to give a link to a related question+answer. I am trying to create a beamer presentation and defined an environment. The environment has an optional parameter and I want that beamer sets ...
8
votes
4answers
950 views

Making an anti-clockwise circled arrow around a + sign in a math environment

\makeatletter \newlength\@SizeOfCirc% \newcommand{\CricArrowRight}[1]{% \setlength{\@SizeOfCirc}{\maxof{\widthof{#1}}{\heightof{#1}}}% \tikz [x=1.0ex,y=1.0ex,line width=.15ex, draw=black]% \draw ...
5
votes
4answers
57 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* ...
24
votes
3answers
10k 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} % ...
0
votes
0answers
28 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
39 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
23 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
17 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
34 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 ...
6
votes
2answers
264 views

How to rename or “copy” a latex environment

I want to rename or "copy" the enumerate environment twice in order to have two different named enumerate environments. E.g. \begin{questions} \item lorem ipsum \item lorem ipsum ...
2
votes
0answers
32 views

Wrapper around `picture` environment causes page break [duplicate]

A picture environment at exactly the size of the text area can fit snugly on one page. However when I replace the environment with a wrapper environment with exactly the same definition, it takes two ...
6
votes
1answer
156 views

Why do these three changes fix this equation-numbering error?

When I use \equation...\endequation instead of \begin{equation}...\end{equation}, all equations have the same number (I know this isn't best practice for environments; I'm trying to understand the ...
11
votes
2answers
227 views

Extract source code on the fly to a file?

I'm trying to create a programming text to use for my students. My goal is to have an environment (say, "code", for instance), so, if I type the following in my .tex file: \begin{code}{Sample script} ...
8
votes
3answers
2k views

How to change the font in the description environment?

How to change the font in the description environment, for the term word (e.g. First, Second...) and for its definition (The first item, The second item...)? How to restore the paragraph indentation ...
2
votes
2answers
36 views

How to “align” the LyX aligned math environment

I frequently use the aligned math environment in LyX to typeset my equations. However, if I want to save space on the page and set two equations simultaneously in the same aligned math environment, ...
2
votes
1answer
25 views

Switching between wrapfigure and figure environments

I'm trying to realise switching between wrapfigure and figure environments, using boolean control. But for some reason wrapfigure does not do what it should do - be wrapped, instead it is placed in ...
4
votes
2answers
171 views

How to nicely split proofs into different parts?

I often break long proofs into smaller pieces, in order to make it easier to read and understand. I'm doing that by adding a fbox with "Part X: ...". However, this doesn't work out very well all the ...
2
votes
1answer
22 views

\ref to existing \label do not works, but index and url yes

This is my code and my results: \begin{figure}[h!] \label{fig:ppe_xyz} \begin{lstlisting} §$ppe_x$§ = ppe(§$A_x$§, s, order, overlap, H); §$ppe_y$§ = ppe(§$A_y$§, s, order, overlap, H); ...
5
votes
2answers
42 views

Reset counter at beginning of proof

My goal is to get a new claim environment which automatically numbers. This is fine - I can make a counter, define a claim environment and claimproof environment which number automatically, and this ...
2
votes
2answers
29 views

Changing Abstract name does not work

Here is my MWE: \documentclass[11pt]{article} \usepackage{fontspec,xgreek,polyglossia} \defaultfontfeatures{Mapping=tex-text} \setmainfont[Mapping=tex-text]{Liberation Serif} ...
3
votes
2answers
52 views

Including figures in custom environments.

In my preamble I have the following custom environment that is counted. \newtheorem{exmp}{Example}[section] When I call this in the text I always write the following piece of code, \begin{exmp} ...
27
votes
2answers
15k views

What does the titlepage environment do and what are its benefits?

I'm speaking about the article document class only, because report and book deal with titles in a different way. Obviously, the titlepage environment triggers a new page after it, and it resets the ...
2
votes
2answers
56 views

How to expand ExSheets question environment to show user-defined blank space for solution?

This is my minimal not-working example: \documentclass[a4paper,10pt]{book} \usepackage{mdframed} \usepackage{exsheets} \newenvironment{exerciseWithSpace}[1]{\begin{question}}{\end{question} ...
4
votes
1answer
50 views

\command without {} ending at the end of the line?

In a work, I have to write a lot of dialogue. This is my MWE: \documentclass{article} \newenvironment{dialogue}{% \noindent% \newcommand\one[1]{\textit{##1}\newline}% ...