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)

3
votes
2answers
6k 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
361 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
113 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
47 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
104 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
243 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
50 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
329 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
120 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
161 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
62 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
171 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 ...
3
votes
0answers
42 views

How can I redefine (or alter) the bmatrix envrionment such that all entries are flushed right? [duplicate]

I've checked around here and have been unable to find anything that solves my problem. There are several other questions that ask similar things, but the solutions do not give a global way to apply ...
4
votes
1answer
3k views

Using amsthm but still getting “Environment theorem undefined”

I'm trying to write up all my university theorems and I cant get the theorem environment to work. Here is a mini example of what I'm trying to do. \documentclass[a4paper,12pt]{article} ...
13
votes
1answer
162 views

How can I undefine an environment?

How can I undefine an environment? This is how to undefine a command: \newcommand\foo \makeatletter \let\foo\@undefined \makeatother I need to undefine the spacing environment from the setspace ...
8
votes
2answers
138 views

Setting the left margin of a trivlist in an environment?

I'm working on defining an environment that's further indented than the rest of the page. This is my document so far: \documentclass[12pt]{article} \usepackage[margin=1in]{geometry} ...
2
votes
0answers
42 views

Heading being duplicated

I have a thesis.tex file that is set up as \documentclass{report} %packages \usepackage{thesis_uvm} %maketitle etc \begin{document} %abstract etc %chapters \nocite{*} \bibliographystyle{chicago} ...
5
votes
1answer
120 views

Group statements, avoid pagebreak

I make an FAQ document, for this I redefined environments like \newenvironment{question} % no indenting, bold and new paragraph {\setlength\parindent{0pt}\bfseries} {\par} \newenvironment{answer} % ...
4
votes
1answer
81 views

Listings environment within another environment

\newtheorem{alg}{Algorithm}[subsection] \begin{alg}\label{alg:1} \begin{lstlisting}[frame = single, breaklines = true, numbers = left] test code \end{lstlisting} \end{alg} How can I prevent the ...
5
votes
0answers
49 views

Repeat a Theorem [duplicate]

For my thesis I have to repeat my theorems, not just the number but the exact wording of the Theorems. I found the question How to repeat the content of a quote (e.g. introduction+conclusion) without ...
1
vote
0answers
61 views

Theorem environment in Italic form [closed]

In my whole report, I want to write all the theorems and definitions in Italic format. And the example and some other observations and Remark in Non-Italic format. I have put all these within \rm ...
4
votes
2answers
366 views

Bold text in newenvironment

I want to define my own environment, like \newenvironment{question} {\begin{tiny}} {\end{tiny}} That may not make much sense, but it works. How can I do the same with bold font?
2
votes
3answers
298 views

\renewcommand or \renewenvironment with multicols

I'm trying to create a horizontal white space in my multicolumn environment every time I start a new subsection. It stops people from having to trawl their eyes up and down the page between ...
5
votes
1answer
153 views

A new environment in the memoir class

I write my thesis with the memoir class and want to include an Acknowledgment in the same style as the standard abstract from the memoir class. How can this be done?
1
vote
1answer
295 views

how to change spacing between align environments and equation environments?

I am using align and environment for various equations. There is some space that comes before and after the equations that I would like to minimize. Is there a single command that could be used to ...
8
votes
2answers
146 views

Customise counters, cross references to environments

I would like to make cross references to own defined counter on environments. So far I have tried the following, \documentclass{book} \newcounter{entryc}[subsection] ...
3
votes
1answer
160 views

Environment for two columns with lstlistings

In order to reduce copy-pasting, I want to create an environment that will produce a two-column table with headers and two listings in different languages, like below: \begin{tabular}{l l} Python ...
4
votes
1answer
98 views

How to create an unnumbered theorem?

I'm looking for a way to create a new theorem without numbering. I found Theorem without numbering and tried the accepted answer, but I get the error "Command * already defined". This is the code I'm ...
7
votes
1answer
150 views

Creating an example environment structured exactly like amsthm's proof environment

I want to create an environment for examples that is structured exactly like the \begin{proof}...\end{proof} environment, i.e. starting with an italic "Example.", continuing in the same line and ...
2
votes
0answers
68 views

Duplicate an environment

How can I duplicate an environment? I want to create an environment which is almost exactly equal to another environment. I just want to change the heading. Right now I use ...
6
votes
3answers
139 views

How to create same text structure every time?

My document contains 'blocks of text' with the same structure. They always have a title (which is always a date), a review part and a to do part. This is what the code looks like: ...
10
votes
3answers
681 views

How to start itemize on same line as text?

I've created a new environment called 'Example' like this: \newenvironment{example} {\textbf{Example:} \begin{itemize}} {\end{itemize}} The environment works fine, but the items are ...
5
votes
1answer
88 views

Bottom hline in a tabularx wrapper environment

I want to define a wrapper environment for a table where one of the columns stretches to fill the available width. I'm using the tabularx package and its X column for that. As mentioned here and in ...
5
votes
1answer
159 views

Forcing the first choice of an newtcblisting environment

I have created a new environment based on "tcblisting" from package "tcolorbox" is code (MWE) is as follows: \documentclass[10pt]{article} \usepackage{tcolorbox} ...
7
votes
1answer
104 views

Two block commands in \newenvironment [duplicate]

What is wrong with following document? \documentclass{article} \usepackage{xepersian} \usepackage{verbatim} \newenvironment{code} {\begin{latin}\begin{verbatim}} {\end{verbatim}\end{latin}} ...
4
votes
3answers
152 views

How to replace \\ with \\& in math mode?

I am having the following isssue: I have to write a mathematical paper/book with many different optimization problems formulated. To be consistent all over I'd like to create an environment to ...
4
votes
1answer
84 views

In standard, interpret characters as vectors

I need to write many equations with way more matrices and vectors than scalars and I would like to have LaTeX interpret "normal" characters as vectors and matrices. Consequently I need to mark the ...
3
votes
1answer
135 views

Indicator at end of theorem

I'm writing a text with some very long theorem-environments in it and I find the italicised theorems visually not pleasing when they are rather longish. So I'm using the definition theorem style most ...
4
votes
1answer
559 views

using fbox in a newenvironment [duplicate]

I am trying to write a new enviroment to add text into a \fbox, when I use \fbox on its own, it works quite nicely \fbox{\begin{minipage}{0.9\textwidth} does this work, I would love if it did ...
5
votes
0answers
46 views

What are the differences between creating a new macro command vs. a new environment? [duplicate]

For the purposes of collaboration, I want to create a number of short commands or environments that will color the text within its scope so as to identify the author. My first thought was to simply ...
2
votes
2answers
517 views

\begin{problem} analogue to \begin{proof}

I recently learned about \begin{proof} ... \end{proof}, which is a good environment to work in. My question is whether there exists a similar environment to state a problem, or whether I can write ...
1
vote
0answers
26 views

Different outputs with/ without \newenvironment [duplicate]

I'm trying to setup my own CV without Curve. To do so, I intend to separate sections the same way with a \newenvironment. %[...] \newlength{\margin} \setlength{\margin}{.3\textwidth} ...
1
vote
0answers
116 views

frame in NewDocumentEnvironment

With beamer frames, this does not work. \newenvironment{itemframe}[1]{ \begin{frame}{#1} \begin{itemize} }{ \end{itemize} \end{frame} } Adding fragile, environment=itemframe as an ...
3
votes
1answer
503 views

Diary in Latex with additional notes on side

I am trying to make a diary that will have the following format Each entry will be inside a colored box Each entry will have a title with the date and an optional title I want the possibility to add ...
0
votes
0answers
178 views

File ended while scanning the use of \@newenv

I am trying to create a diary in LaTeX. I have found a relevant question using latex to keep a diary. I believe that ferahfeza gave a prety answer however there are some points that are not working. ...
4
votes
2answers
171 views

Two kinds of equation labels within one paper

I have looked high and low for an answer to the following (including on this site, Google, etc.) without success, and I hope someone may be able to answer it (and if it is a repeat of something ...
8
votes
3answers
697 views

Insert text into a fixed size box

Is there a way to create a box which has fixed width and height? I tried \parbox and some similar things, but sometimes the text overflows. If the text inserted would overflow: it should be resized ...
3
votes
1answer
88 views

Using savebox around the BODY of environ

I tried to use a \savebox around the \BODY macro of \NewEnviron. Can I keep the linebreaks somehow (they are gone, in the MWE)? \documentclass{article} \usepackage{environ} \newsavebox{\mybox} ...