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

4
votes
1answer
54 views

How can I use arabic numbering for theorems?

I used the newtheorem command to create exercises in a book in the following way. \newtheorem{xca}[theorem]{Problems} So in the body I use the following command to create a set of exercises, ...
6
votes
2answers
115 views

Seemingly trivial: verbatim, newenvironment, and colorbox

I am, once again, trying to achieve what seems like a trivial goal. I want to use \newenvironment to define a verbatim environment with a background color. I need to define my own environment because ...
6
votes
1answer
87 views

Cross-reference of custom environments created with environ and TikZ package

Problem: I want to create an environment named Example, and the environment has a counter (number within chapter). I want to refer to the counter for illustration just as the table, figure and ...
1
vote
1answer
70 views

How to make an environment such as “theorem” not have italics [duplicate]

I found this: How to change the font style in theorem environment? as well as this: Italic in theorem environment Neither however seem to make sense to me as I have been using the following: ...
5
votes
1answer
84 views

Spreading newenvironment over two pages

I am using a template found online to do my CV and I am getting a hard time trying to spred the content of a newenvironment over two pages. I want the content of one of my rubrique to be over the end ...
2
votes
1answer
62 views

Can't define environment whose macro code contains dot2tex environment

I try to define a new environment whose macro code contains the dot2tex environment from the dot2texi package (look at the appended MWE). Unfortunately the compilation ends with the following error ...
6
votes
2answers
182 views

How to rewrite this command using \newenvironment?

I once defined a customized latex command, which works well. And now I would like to convert it into a latex environment using \newenvironment command. However, I failed after trying several ways. ...
3
votes
1answer
55 views

Giving a custom environment a name

I have defined a custom environment: \documentclass[11pt]{article} \usepackage[table,hyperref]{xcolor} % Better control over color \usepackage[colorlinks=true, linkcolor=DarkBlue, ...
10
votes
3answers
707 views

Found it tiring to type so many \begin and \end

Is there some way to get rid of the \begin and \end's? For example, I need to type a small matrix, but I should type \begin{matrix}...\end{matrix}. I tried to define a macro ...
6
votes
2answers
48 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
75 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
116 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
57 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
39 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
98 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
119 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
51 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
396 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
72 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
30 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
65 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
48 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
48 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
69 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
205 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
78 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
166 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
77 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
92 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
61 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
81 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
215 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
161 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
92 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
221 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
59 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
120 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
2k 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
99 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
124 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
101 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
138 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
546 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
282 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
502 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
104 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: ...