{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
0answers
92 views

Using cprotect and environments with multiple arguments

Is there a way to use the cprotect package's \cprotEnv command to use verbatim inside environments that have optional or multiple arguments? My motivation for this question: I am working with ...
2
votes
2answers
40 views

Use \newtheoremstyle to define a custom example environment

I am trying to define a custom example environment for my thesis, but with my limited knowledge of LaTeX I am not able to figure this out from the amsthm documentation. Here is a minimum working ...
10
votes
2answers
9k views

pdfTeX warning: destination with same identifier has been already used, duplicate ignored (weird behavior)

Here is a minimal example: \documentclass{amsart} \usepackage{amsthm} \usepackage[pdftex]{hyperref} \newtheoremstyle{myexercise}{\baselineskip}{\baselineskip}{}{}{\bfseries}{.}{ ...
5
votes
4answers
154 views

Use \newcommand in \newenvironment - content of environment is argument of \newcommand

I want to create an environment, that generates a new command. There are some similar examples on google, but nothing fits exactly. The minimal (not) working example shows best, what I want: ...
3
votes
1answer
30 views

Defining an environment using the collect package

I want to define an environment aufgabe which uses the collect* environment from the collect package. If I built a file like this (without a custom environment), everything is fine: ...
2
votes
1answer
45 views

\renewenvironment{document}

I would like to use \usepackage{filecontents} to write another version of my document to a file later with \write18 and compile it. My question is: How do I create a custom \begin{document} to ...
3
votes
1answer
68 views

Using newcommand inside newenvironment to print a table

I have the following self defined counter and command: \documentclass{article} \newcounter{usecase}[section] \newcommand{\usecasenumber}{\arabic{usecase} \stepcounter{usecase} ...
1
vote
0answers
24 views

Using newcommand and newenvironment to print a labled tabular [duplicate]

I posted this question as guest with some issues that should be fixed in this version so here it goes. I have the following self defined counter and command: \documentclass{article} ...
1
vote
0answers
16 views

Small wrapper for easylist using \item like syntax and a new environment

I'm trying to create a new environment for using the package easylist so that some users that are not used to LaTeX can easily make use of it. Right now the environment and its custom commands are ...
2
votes
2answers
86 views

How to not typeset LaTeX content? Or how to leave out LaTeX content?

Consider the following minimal example: \documentclass{article} \begin{document} foo \setbox0=\vbox\bgroup \label{baz} \ref{baz} \egroup bar \end{document} Whenever you run LaTeX you get a warning ...
5
votes
0answers
63 views

How to tell LaTeX to throw a warning if argument is not being used?

In this question the given argument wasn't used, because #1 was missing.. One would actually assume an error or a warning be thrown. A little MWE based on 1: \documentclass{article} ...
1
vote
1answer
25 views

change caption of multiple listing styles

I want to have different listing environments, each with an own caption. My try was this (vorlage.tex): \documentclass{scrreprt} \usepackage{regexpatch}% http://ctan.org/pkg/regexpatch ...
1
vote
0answers
13 views

How to let table stay in example environment? [duplicate]

My table is choosing not to stay in the example environment I created for it, however the text I placed in there are included. I notice that when I remove the table environment and let tabular remain, ...
1
vote
1answer
30 views

Supressing indent on the following paragraph

I have made a environment that formats some example text in a box that sets it apart from the main text of the book. It becomes a sort of a figure that the other text refers to. There is plenty of ...
2
votes
1answer
28 views

How can I apply a custom-defined theorem environment to nested theorems WITHOUT using a proof environment?

I'd like to combine a couple of constructions I've found on this site to create a custom-defined cases environment so that each case will: be nested within a larger theorem environment; end with a ...
1
vote
1answer
33 views

Tie two environments together

I have a rather large document with the following structure \newenvironment{A}{sth.}{sth.} \newenvironment{B}{sth.}{sth.} \newenvironment{C}{sth.}{sth.} \begin{A} \begin{B} \end{B} \begin{C} \end{C} ...
1
vote
1answer
57 views

Environment inside \newcommand [duplicate]

This is my first question so feel free to correct it in any way. I am struggling with the following problem: using an environment in a \newcommand. I want to define the command \describe this way: ...
4
votes
2answers
78 views

Multiple Environment Options

How does the tikzpicture environment support multiple options, e.g. \begin{tikzpicture}[red, thick] ... \end{tikzpicture}? According to some LaTeX documentation, multiple options are not permissible ...
6
votes
1answer
60 views

Create custom note environment with tcolorbox

I just stumbled upon the tcolorbox package but can't seem to find my way through its extensive manual. What I'm trying to achieve is to create a custom environment to add short notes into a body of ...
3
votes
2answers
36 views

Avoid recursion in \renewenvironment

I'm trying to redefine an environment in order to add a command after the \begin without having to add this command in manually everywhere. For example, I'd like to replace every instance of ...
1
vote
1answer
34 views

Show normal font in a definition environment instead of italics

In the code below, how do I go about having the font show up as normal font instead of the italicized font in the commentt environment? Here is the code: \documentclass[11pt]{book} ...
4
votes
1answer
50 views

Strange error message due to xparse and \newenvironment

I get the following strange error when I compile my document: ! Incomplete \ifcase; all text was ignored after line 256. <inserted text> \fi l.256 \foo[ ...
6
votes
2answers
243 views

Write easily a TIKZ flowchart

I created a npm package to write easily a TIKZ flowchart. Flowtex facilitates maintenance of a flowchart. Such as the insertion of new nodes or the positioning of the nodes as a function of others. I ...
5
votes
3answers
537 views

How to write a sentence full of symbols

I just started using LaTeX and I have a problem including this in my file: X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* is there some kind of a "de-specialized" environment? ...
3
votes
1answer
91 views

Itemize Environment: Change only size of the bullet not the text

I would like to change only the size of the bullet not the text of item as mentioned in the question. I tried following approach but it changes the bullet size as well as text size. Thanks in advance ...
0
votes
0answers
19 views

Detect if environment contains a page break [duplicate]

Is it possible to detect if a custom environment goes over a page break, i.e. get a warning/something I can use for further processing (and preferably also tells me where the page break occurs)? ...
10
votes
2answers
243 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, ...
3
votes
2answers
44 views

Example Environment with two boxes

I am trying to get my "example" environment to look this: with the two boxes before the word "Example". Can you help me get this effect? Here is some code: \documentclass[11pt,fleqn,table]{book} ...
4
votes
2answers
45 views

Defining an environment for aligning elements in a table and labeling them alphabetically

I'd like to automate this process in an environment as far as possible: \documentclass[12pt,ngerman]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{babel} \begin{document} ...
2
votes
1answer
36 views

Cross Reference of Environments

I defined a personalized table environment as follows: \newcounter{Table}[section] \newenvironment{Table}[1][]{ \refstepcounter{Table} \newcommand{\tbtitle}{#1} \begin{center} } { ...
3
votes
1answer
89 views

How to make a new figure environment that does additional stuff?

Currently I have a document in which most caption of figures and tables is placed in the margin, using mcaption. But for some figures and tables I need the full width (textwidth and margin). Both ...
5
votes
3answers
120 views

New environment to vertically center text

Consider the following code: \documentclass{article} \usepackage[ papersize = 50mm, margin = 2mm ]{geometry} \begin{document} \topskip0pt \vspace*{\fill} test \vfill \end{document} What is ...
1
vote
1answer
23 views

Changing global properties of figure caption

I'm just looking for a list of global properties which can be changed for the figure captions, such as changing the font size, font type/family etc. If anyone knows of them, or has a link to a ...
15
votes
4answers
16k views

Defining my own proof environment?

How would I define a proof environment that is basically used with \begin{proof} some proof here \end{proof} and it would be equivalent to: \paragraph{Proof:} some proof here \hfill \box ?
1
vote
1answer
32 views

Forward text to PythonTeX environment

Is it possible to create a new environment in TeX, such that the text in that environment is forwarded to a Python function with PythonTeX? It is possible to forward values to Python (by using ...
1
vote
1answer
33 views

Hyperlink not working for glossaries in table

I am making a glossary list that appears in a two column table, but the hyperlinks now are no longer working when I use this custom style. Can someone explain how to fix this? \documentclass{article} ...
1
vote
0answers
72 views

Terminate and Start and environment from within the environment

How can I terminate and resume an environment by another environment? This also seems to have broken the resume feature which was resolved in Define a List that is Always Resumed. The code ...
13
votes
2answers
262 views

Automatically replace environment align by equation+aligned combination

I would like to automatically replace the align environment by an equation + aligned combination. Specifically, whenever \begin{align} occurs, it should automatically read it as ...
5
votes
2answers
84 views

Using multline or equation based on a boolean flag

I am trying to define a new environment myeq which can either be an equation or a multline. My use case is that in the preamble, I will define myeq to be either replicate the functionaly of equation ...
2
votes
1answer
36 views

Define Custom Page

How do I define environment such that: It will start a new page; it will be followed by a new page; it will have a custom page color and font color.
15
votes
3answers
355 views

Environment to stack a word and a number

There is a requirement to write a list of words, underline each word and place a number centered below the line. Using the stackengine package I have prepared the following MWE. ...
1
vote
0answers
55 views

Italic environment

I'm composing a text, in which people will have access for some math questions, and their sequent solutions. Thing is, I want to put the whole question texts in italics, and \textit{} doesn't work on ...
2
votes
1answer
19 views

How to create an environment that embeds an environment inside a macro?

Let's say I have an environment myenvironment and I have the following code : \makebox[\length][c]{% \begin{myenvironment} content \end{myenvironment} } I want to create an environment foo that ...
33
votes
3answers
43k views

Example environment?

I was wondering if there is any formal environment for specifying 'examples' through out the text. If not, which environments do you recommend?
12
votes
1answer
206 views

When is `\[` preferred over equation* environment? [duplicate]

When is it preferable to use \[ instead of equation*? I find I often use the equation* environment in the following way: \begin{equation*} some expression \end{equation*} Should I instead be using ...
4
votes
1answer
36 views

New document environment and the tabularx package

I am trying to create a new environment but it gives me some trouble. The compiler keeps telling me that I am missing a } but I don't see where it could be. Here is a code sample. Thanks for your ...
2
votes
1answer
38 views

How to color text inside of a \def

I am trying to color some text inside an xdef command. I am getting the following error: Use of \@undeclaredcolor doesn't match its definition. Does anybody know how to resolve this? Thanks! edit: ...
0
votes
0answers
34 views

I can't find the missing } [duplicate]

I just can't find the missing }. Or that is at least what the compiler tells me is wrong. Can you help, thanks? \documentclass{article} \usepackage{multirow, tabularx} \usepackage{xparse} ...
7
votes
1answer
357 views

Redefine verbatim environment

I have a text with source code, which I would like to display. I am using pandoc, so I have to use either verbatim or listings enviroment. Unfortunately, I can't use listings package (due to ...
4
votes
1answer
123 views

How to create theorem boxes

I wrote a chapter for a book, and we use a structure.tex with a lot of definitios and macros. Now I'm writing other book and I would like to use those kind of boxes as below. Note that when the box ...