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

2
votes
1answer
29 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
58 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
79 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
62 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} ...
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 ...
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[ ...
5
votes
3answers
538 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 ...
6
votes
2answers
244 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 ...
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)? ...
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
46 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} } { ...
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 ...
5
votes
3answers
121 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 ...
0
votes
1answer
31 views

Footnotes in multipage environments

I'm in conflict with how mdframed handles footnotes inside environments that span multiple pages. Consider this MWE \documentclass{article} \usepackage{lipsum} ...
1
vote
1answer
33 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 ...
5
votes
2answers
85 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.
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 ...
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 ...
0
votes
1answer
29 views

Redefining and minipaging of standard environments in preamble

When integrating standard LaTeX output from a database or from software like pandoc, the actual content cannot be changed. To still be able to layout the document, it is important to have ...
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} ...
4
votes
1answer
125 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 ...
1
vote
1answer
32 views

How to check if at first \item in a list/start of the list?

I have a (rather rudimentary) self-defined environment, skipitemize, which is as follows: \newenvironment{skipitemize} [1][1] ...
2
votes
1answer
23 views

How to list all items defined in a predefined enviroment

Code is: \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{fancyhdr} \usepackage{pgfplots} \usepackage[letterpaper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry} ...
6
votes
1answer
36 views

Scope Issues with \renewcommand inside \newcommand

I am creating an environment so I can write a book containing information all formatted the same way based on the environment template. Eventually, I would like to be able to write ...
1
vote
0answers
46 views

Is it possible to \newcommand any type of command?

I have been using \newcommand and \renewcommand for defining simple commands like the typical \newcommand{\R}{\mathbb{R}} But now I wonder if I can renew other types of commands. What I want to do ...
2
votes
1answer
47 views

Environment with sub-tags

Is it possible to create an environment usable in this way...? \begin{myEnvironment} \{title}[This is a title] \{year}[2016] \{content}[Lorem ipsum dolor sit amet, consectetur adipisci elit, sed ...
2
votes
1answer
39 views

Vertical Space Between Environments

im trying to get rid of the vertical space between environments, for example: \documentclass[12pt,a4paper]{article} \usepackage[spanish]{babel} \usepackage{ragged2e} \begin{document} ...
3
votes
1answer
39 views

Underline (or otherwise format) all text in custom environment

I'm trying to define a custom environment, in which all text is underlined. I know the underline command underlines its input, but I can't figure out how to get it to work seamlessly with my ...
2
votes
2answers
31 views

How do I create a new float environment with bigger and colored contents?

I have the following LaTeX snippet: \begin{figure}[h] \centering \[\scalebox{2}{\color{blue}$some formula$}\] \caption{a caption \label{fig:the-label}} \end{figure} I'm trying to create a ...
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 ...
0
votes
0answers
43 views

Including BODY in self-defined environment

This is a follow up question to Create array of specific counter values and Using self-defined fields in NewEnviron. I want to use the function mtadd that fills the array mtarr depending on the value ...
3
votes
1answer
52 views

Define a command that opens and closes an environment

I would like to define a command that, starts (\begin{...}'s it) an environment if not in such an environment, and closes (\end{...}'s it) it if in such an environment, for example: \myenum ...
1
vote
0answers
24 views

Using self-defined fields in NewEnviron

I'd like to use a self-defined function inside a self-defined environment. I add an example showing, that the function work perfect outside the environment, but inside the environment myenv, it seems ...
3
votes
2answers
185 views

LATEX ERROR: BAD MATH ENVIRONMENT DELIMITER. (all caps)

\documentclass[letterpaper, twoside, 12pt]{book} \usepackage{amsmath,amsfonts,amsthm} \usepackage{notes} \usepackage{hyperref} \title{MATH 3142 Notes | Spring 2016} \date{Updated: \today} ...
1
vote
1answer
50 views

Modification of some maths environments [duplicate]

I would like to have a minor modification of some standard AMS-environment and realize it as a new one. The problem is that not all the environments allow this procedure. Say, even the mere ...
1
vote
2answers
47 views

lncs - Changing the counter for a specific environment

I am using the llncs document class and I need to set the counter for the environment 'remark', so that when I use \begin{remark} ... \end{remark} I obtain Remark 1 wherever I am in the document. How ...
6
votes
1answer
124 views

Modifying an existing environment, but keeping the name

In my document, I want to follow the advice that says that quotes should be indented and set in a smaller font. Obviously, this is easily done with: \begin{quote}\small ... \end{quote} But ...
1
vote
1answer
36 views

Creating a new environment that combines samepage with align

I want to avoid pagebreaks within an align environment. I can accomplish this with both the samepage and the minipage environments. However, when I try to create a new environment that combines align ...
2
votes
1answer
28 views

set an alphabetic counter for environment

I have a \newtheorem environment of the form \newtheorem{theorem}{Theorem} \newtheorem{lemma}[theorem]{Lemma} which follows the numbering of the section. How can I change the numbering from ...