{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
45 views

Spacing Between environment

I want to define an environment to detach text from the document. I would like to have one blank line before and after my quote. I defined the following environment: \newenvironment{myenv}{ ...
3
votes
2answers
60 views

Left bar in the margin of an environment with figures/tables

I am writing a document with theorems and proofs. Since, some reader may not be interested by the proofs I want to highlight them so they can be skipped easily. The best idea I came up with is to ...
2
votes
4answers
101 views

Switching between environments

I teach at the university and I write exams in Tex. I'd like to write an exam with a number of questions, where for each question I include either empty lines and empty figures with axes (for the ...
5
votes
1answer
49 views

how to use conditional to define different \begin and \end environment at compile time

I just need little help on the syntax for this. I am using tex4ht, and I get an error when I use empheq for the align environment. I want to build this TeX file both in pdflatex and htlatex. I ...
3
votes
1answer
38 views

How can I put an environment within a subsection?

I have this code, but the environment is put at the top of the page above the sections. \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage[italian]{babel} ...
1
vote
0answers
83 views

Kile syntax highlighting: A single dollar sign in the preamble

I'm using Kile to edit my LaTeX documents. I define my own custom environment to hightlight LaTeX code named lstLaTeX with the following code: \documentclass[a4paper]{scrartcl} ...
0
votes
0answers
88 views

Change the color of the “remark” environment in Beamer

I would like to change the color (bg and fg) of the remark environment in a Beamer document. I have setup my document using: \usetheme{AnnArbor} \usecolortheme{crane} I read in some other question ...
1
vote
1answer
45 views

Elementary question about new environment

I want to create new environment without a "closing argument". For example, \MakeLowercase{\textsc{MAKE LOWERcase textsc}} to have all text in small caps independently from upper- or lowercase ...
3
votes
1answer
228 views

Color highlighting text and environments in LyX

I am using LyX 2.0.5 with document class article and 'Theorems (AMS)' in the modules. I am wondering if it is possible to make it so that the titles of different environments will be highlighted in ...
4
votes
1answer
56 views

Shared counter (between description environments) results in “undefined control sequence” [closed]

The objective is to share the counter SharedCTR1 across the description environments. The following code works with only one description environment, but not with both. \documentclass{report} ...
1
vote
0answers
36 views

How to store the definition of an environment? Or, how to disable locally an environment?

what? I would like to "store" the definition of the environment figure into \something so that the following logics will work: % the following line is what I am looking for store(figure, \something) ...
2
votes
0answers
28 views

can I use changes package to highlight added environments, say, itemize?

I am using changes package to track modifications to a LaTeX documents, but found simply wrapping \begin{itemize}\end{itemize} with \added command doesn't work. It works fine if I wrap the contents of ...
2
votes
1answer
55 views

Make a counter “update” exercise in environment exercise

I wrote a book in about year 2010. Now I want to add (update) some exercises and count all updated Exercises. But I only can Update 2014. How can I make Update 0ne 2014, Update two 2014, ... or ...
1
vote
2answers
43 views

custom newline style in environments

I want to add something to each newline, like this: \documentclass{article} \newenvironment{mystuff}{dark magic goes here}{or here} \begin{document} \begin{mystuff} first row second row \end{mystuff} ...
0
votes
0answers
45 views

Problem with sectionning with my example

I want to number my example environments like [section]. However, example environments are numbered with chapter, not section. What should I do? This is my MWE: \newcounter{example} \makeatletter ...
3
votes
1answer
63 views

How to prevent page break in the last three lines of an environment?

I want to create an environment, thats content should not allowed a page break in the last three lines of the last paragraph. If the last three lines of the text inside the environment reach the ...
5
votes
1answer
172 views

First paragraph in environment without indent or space

I'm trying to create an environment that does not indent the very first paragraph of the text inside the environment. My latest attempt and the corresponding output are shown below. As you can see, ...
4
votes
1answer
65 views

Command to disable environments [duplicate]

I have defined an environment called answer that displays the answer of a question of a test I'm supposed to prepare. The idea is to compile a version where the answers are displays and one were they ...
8
votes
2answers
160 views

How to ignore everything in the document environment?

Yes, you did read the title correctly! I want to ignore everything that is between \begin{document} and \end{document} when I \input a file. I thought that that would be very simple, just use the ...
2
votes
1answer
58 views

How to get AucTex to prompt me for a name, when inserting an environment using Ctrl-C, Ctrl-E?

I'm using emacs auctex. I've defined an environment template, as follows. \documentclass{article} \newtheorem{definition}{Definition}[section] \begin{document} \end{document} I insert instances ...
6
votes
1answer
77 views

How to change QED sign for theorem classes

I'm writing an article which contains some quite long proofs, some of which include claims with proofs of their own. I dealt with that by adding a claim environment using \newtheorem, but there's a ...
2
votes
1answer
51 views

Semantic table markup with environments inside {tabular}

I run into issues trying to markup tables semantically in LaTeX. Background Either standard \hline together with \firsthline and \lasthline from array.sty (I think) or \midrule, \toprule and ...
1
vote
0answers
18 views

Custom environment shorthand for multiple environments [duplicate]

I am interested in doing something like the following. \documentclass{article} \usepackage{amsmath} \newenvironment{customeq}{\begin{equation}\begin{split}}{\end{split}\end{equation}} ...
5
votes
1answer
73 views

How to enable line breaking in the standard proof environment with amsmath?

I want to redefine the proof so it accepts linebreaks in the name \renewenvironment{proof}[1][\proofname]{\par \pushQED{\qed}% \normalfont \topsep6\p@\@plus6\p@\relax \trivlist ...
6
votes
3answers
174 views

Set enumeration level explicitly

I have the need for a custom list environment at the outermost level, defined as follows: \newboolean{odd} \setboolean{odd}{true} \usepackage{environ} \newcounter{exnum}[section]% Exercise counter ...
8
votes
2answers
141 views

Errors when trying to define a custom align environment

I'm currently trying to create a custom environment with its own counter. \documentclass[a4paper,11pt]{report} \usepackage[fleqn]{amsmath} \newcounter{grammarcounter} \newenvironment{grammar}{ ...
3
votes
1answer
83 views

How to define this new environment and avoid the hidden errors?

I want to define a new environment ends with a $\omega$ in newline. But environment like displaymath already start a newline after itself, so I do not start a newline in this case. That is, start a ...
8
votes
1answer
97 views

Automatically Insert Environment Arguments

How can I automatically insert [<+->] arguments to the itemize environment when I'm in a beamer frame so I get pretty incremental display during presentation?
8
votes
3answers
219 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
0answers
56 views

Checking environment in order to end it

I used to typeset verse with memoir package using some heavy \vspace trickery. The verse environment was too hard to control in terms of vertical space due to the immense amount of obscure glue. For ...
7
votes
1answer
110 views

Hide an environment and show it later in the document

I am trying to set up an environment for making exercises with corresponding answers for students. Idea I would like to be able to write the text for an exercise in an environment, and directly ...
1
vote
1answer
1k views

File ended while scanning use of \frame [closed]

I am a beginner in Latex. My code: \documentclass[xcolor=dvipsnames]{beamer} \mode<presentation> \usetheme{Antibes} \usecolortheme[named=Green]{structure} \title[HUM-THE SABHAl]{Training ...
4
votes
1answer
87 views

Redefining environment within a macro

Hel-lo, I am a LaTeX programming newbie. While formatting my document, I found that it will look nice if I can modify the theorem environment (with amsthm package). So I tried the following code ...
9
votes
2answers
114 views

Creating a new environment containing a tikz environment

I would like to create a new environment in order to ease the process of making plots. It should be able to something like this: \begin{graph} \addplot [domain=-10:10, samples=1000]{x)}; \end{graph} ...
7
votes
1answer
95 views

Using shortcut with argument in tcolorbox

I want to do something like this: \documentclass{article} \usepackage[ngerman]{isodate} %for printing the date \usepackage[dvipsnames]{xcolor} %for color names \usepackage{tcolorbox} ...
5
votes
3answers
127 views

Proper vertical spacing and pagebreaks in custom environment

I would like to design a simple environment which displays examples. This is what I got so far: \documentclass{article} \usepackage{xcolor} \usepackage{parskip} \usepackage{lipsum} \makeatletter ...
17
votes
1answer
522 views

How to typeset programming code syntax with annotations?

If possible I would like to know how to this on latex/tikz to add this like (environment and graph) on my ebook. Thanks a lot!!! Code im trying to implement: \documentclass[11pt,fleqn]{book} ...
4
votes
1answer
241 views

Add an image on the top-left corner of a customized block in beamer

I would like to use some customized blocks in my beamer presentations, with a layout that is inspired by these examples found on a website : The idea is to build a specific block environments, ...
2
votes
0answers
40 views

Is there a shorthand for matrices that doesn't use an environment [duplicate]

I understand that environments are very nice where the content is complex. But for simple cases, the \begin and \end and duplication of the environment name gets quite wordy and dominates the actual ...
6
votes
3answers
368 views

Adding vertical space (\vspace) around custom environment

I have document with custom environment myenv which left margin is 4em. \documentclass{book} \usepackage{lipsum} \newenvironment{myenv}{ \setlength{\leftskip}{4em} } \begin{document} \lipsum[1-2] ...
4
votes
1answer
95 views

Changing the Look of Proof

I am using the document class amsbook. I had an issue with my theorems having a good deal of space between the statement of the theorem and the proof. I have a new theorem style: ...
0
votes
2answers
70 views

Proof environment on LaTeX

I want to make a new environment in LaTeX. It'll be a proof environment (for math papers), and what I want is to indent all the paragraph. How can I do that? I do this: ...
5
votes
1answer
47 views

How to redefine gather environment so it has justification to the left and allows to use enumerate?

I need redefinition of gather (cannot be equation because of some other problem I asked about earlier on this forum) so it would have justification to the left, has no empty line after enumerate ...
7
votes
1answer
106 views

Problem of newenvironment usage with several parameters

I am trying to use \newenvironment, written by somebody else: with this code: \documentclass[10pt,a4paper]{article} \usepackage[latin1]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} ...
0
votes
1answer
106 views

TeXShop cannot print hello world

I'm running TeXShop on a mac. My latex environment somehow has somehow stopped working and can no longer even print hello world. Here's my complete latex document: \documentclass{article} ...
1
vote
2answers
100 views

Understanding the arguments in newtheorem e.g. \newtheorem{theorem}{Theorem}[section] [duplicate]

I would like to understand what the arguments following \newtheorem are e.g.: \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} ...
3
votes
0answers
74 views

Understanding differences between newtheorem and newenvironment

The difficulty that I am having is that I make a newtheorem: \newtheorem{definition}[theorem]{Definition} It however seems to act nearly the same as with newenvironment: ...
5
votes
1answer
58 views

How do I write a book with two 'authors', one on all left pages and one on all right pages?

I've used LaTeX for a while to write math articles, so I have a general idea how to use it, but I've never had to make my own document class, environment, or package. I want to write a short story ...
8
votes
2answers
182 views

How to define an environment with a colored tikz node included

I would like to define a new environment like \begin{mybox} some text \end{mybox} that would automatically expand to something like \begin{tikzpicture} \node[fill=red!0.5] {some text}; ...
2
votes
1answer
110 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 ...