Tagged Questions

{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
1answer
85 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
229 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
172 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
95 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
225 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
61 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
123 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
101 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
102 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
145 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
554 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
304 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
41 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
550 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
107 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
94 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
132 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
153 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
158 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} ...
6
votes
1answer
145 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
63 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
203 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
131 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 ...
3
votes
1answer
94 views

How to expandafter an environment?

I have the following problem: I want to create a beamer presentation and introduced a new environment using xparse. The environment has one optional argument (+ two mandatory). Now I want to create an ...
10
votes
2answers
328 views

Environment that doesn't allow blank lines

Consider the command \mpagetc defined as \newcommandx*\mpagetc[4][1=0.45,2=0.45]{\begin{minipage}{\textheight}% \begin{minipage}[c]{#1 \textwidth}% #3 \end{minipage}% \begin{minipage}[t]{#2 ...
6
votes
1answer
64 views

How can I 'double-dip' environment contents to an external file with expl3?

I'd like to capture the contents of a particular environment and copy them, verbatim (n- type expansion), to an external file already set up as an iow output stream. My first thought was to simply ...
3
votes
1answer
69 views

Nomenclature not being assigned proper page number

The following is my MWE: \documentclass[12pt,twoside]{report} \usepackage[intoc]{nomencl} \newenvironment{preliminary}% {\pagestyle{plain}\pagenumbering{roman}}% {\pagenumbering{arabic}} ...
5
votes
2answers
85 views

An environment for fixed figures

I am trying to create an environment that I can use to include "figures" within a framed environment. Because floats aren't allowed inside framed environments, I want to create a new environment ...
10
votes
2answers
441 views

Get emacs to automatically insert \end{} commands after a \begin{} command

I've recently switched from Kile to Emacs/AUCTeX for LaTeX editing. I like AUCTeX a lot more in general, in part because I've put a lot of effort into learning Emacs really well. One feature I really ...
2
votes
0answers
114 views

Package “mdframed” creating arbitrary gaps in the border

I used to define a small environment with the package "mdframed". I've included the package in the following way: \usepackage[framemethod=tikz]{mdframed} This is how I've set up the environment: ...
2
votes
0answers
192 views

TikZ externalize causing problems with template

I have a large document (I'm using pdflatex with Eclispe and TeXlipse) with many (many) TikZ graphics (math function plots, most of them). In order to reduce (drastically I hope) compilation time I ...
4
votes
0answers
130 views

Using a package only for certain tables

I am using the tabularx environment since it the X component of the columns is very useful and necessary for the tables I want to produce. However, a single one of my tables is longer that a page, and ...
3
votes
2answers
5k views

Define a new block environment in LaTeX beamer

I have two kinds of examples in my document. I want to use different colors, say, red and blue. This is what I am doing now. \documentclass[]{beamer} \usetheme{Madrid} \begin{document} \begin{frame} ...
16
votes
1answer
344 views

What exactly does the \begin{document} command trigger?

Let us consider these two files first. \documentclass{article} \parindent 0.0mm \hyphenpenalty 500 \tolerance 700 \usepackage{lipsum} \begin{document} \lipsum[1-10] \end{document} ...
8
votes
1answer
112 views

Why is this lettrine being bumped into the margin?

Consider the MWE from an earlier question: \documentclass{article} \usepackage{lettrine} %\usepackage{fontspec} %\defaultfontfeatures{Ligatures={Historical}} ...
8
votes
1answer
46 views

Superflous vertical spacing after tagging environment

I would like to use the tagging package to tag parts of a document, which not only contain text, but also other environments like enumerate. If I use the taggedblock-environment for this, this creates ...
6
votes
1answer
100 views

Environment definition gives an error

\documentclass{scrreprt} \usepackage{fontspec} \setmainfont{Linux Libertine O} \usepackage{graphicx} \usepackage{polyglossia} \setdefaultlanguage[babelshorthands=true]{german} % align in enumerate ...
9
votes
2answers
240 views

LaTeX \newenvironment with nested braces

I'm making a beamer presentation and I wanted to show terminal commands in a terminal-styled box. I've created what I want using tkiz but now I have some trouble defining it as a new environment due ...
6
votes
1answer
49 views

Using \begin{collect*} in a new \newenviroment

I'm not terrible experienced with latex, an I'm trying to wrap up the \begin{collect*} command with some common arguments used into its own enviroment, but I'm having trouble getting the whole thing ...
11
votes
1answer
134 views

Defining a particular environment in LaTeX

I need help writing an Example environment. I just want it to look like the figure below which I took from an old book I have in my library. This is what I have done. ...
5
votes
1answer
310 views

tikz node with listing environment

I'm trying to create a c++ class hierarchy. Each node in the hierarchy is a class description with code listing in it and multiple nodes are connected by lines and arrows depicting the hierarchy. I'm ...
2
votes
2answers
116 views

Example title in outer margins

If I have large outer margins (even and odd pages) how I can put Example (and Solution) in both pages in the outer margins?
1
vote
1answer
155 views

How to define a command that could generate similar environments just as \newtheorem does?

It's well known that the LaTeX built-in command \newtheorem could generate a series of the theorem environments that are similar: they share the same theme of layout style but differ in their name and ...
2
votes
1answer
61 views

How to add a predefined box flush right after a custom environment? [duplicate]

I want to construct an environment which prints enclosed text and add a predifined box flushright after the text. Here is MWE: \documentclass{minimal} \newenvironment{problem}{% \bigskip ...
9
votes
1answer
161 views

Suggestions for an automatic taxonomy environment

Background In this site there are excellent examples of How to draw up a hierarchical tree diagram for taxonomic classification of several groups but often you must show only the position of a ...
2
votes
2answers
45 views

Display first (sub) environment in an environment

I would like to make a bank of problems of similar type--however, I only want to display the first of each time. For example: \begin{bank} \begin{exercise} 2+2 \end{exercise} \begin{exercise} 4+3 ...