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

0
votes
0answers
34 views

Insert portion of code before every line break in gather environment

This is a follow-up question to Redefine equation environment: auto labeling. I want to have something like \AtEndEnvironment{gather}{\label{equ:\theequation}}(at the end) plus \label{equ:\...
4
votes
1answer
17 views

Reference to \lstnewenvironment

\documentclass{scrreprt} \usepackage{regexpatch}% http://ctan.org/pkg/regexpatch \usepackage{color} \definecolor{codecolor}{rgb}{0.8,0.9,0.9} \definecolor{chatcolor}{rgb}{0.9,0.9,0.8} \usepackage{...
2
votes
1answer
64 views

How to delete the contents of the current paragraph and “re-start” from the beginning?

I want to use an environment defined in a 3rd-party package which I cannot modify. Stripped down, the definition looks like this: \newenvironment{myenv}[1]{ % some stuff here \textbf{#1} }{% some ...
5
votes
2answers
89 views

Suppressing whitespace at end of environment

This must have been answered before, but I'm afraid I can't find it. I'm defining an environment and I want the end block to be formatted immediately after the end of the contents, without ...
3
votes
1answer
47 views

Can a scope environment behave like a node?

The following flowchart was made in PowerPoint, and it describes the input and output of a function. As you can see, the diagram is quite intuitive: a set of files are piped into "Function", and it ...
1
vote
1answer
37 views

Redefine equation environment: auto labeling

Hi i want to auto label every equation with its number (\theequation), i found a simple solution (to avoid manual environment redfinition) but i cant figured out what i am missing. Why it doesnt ...
2
votes
1answer
33 views

enclosing a lstlisting environment inside my own environment using matlab-prettifier

I've just started using matlab-prettifier. Since the line \begin{lstlisting}[style=Matlab-editor] is a lot to type, I created my own environment: \newenvironment{myMP} {\begin{samepage}\begin{...
1
vote
2answers
102 views

Combine minted and tcolorbox for code from file (inputminted?)

Thanks to Thomas F. Sturm and Gonzalo Medina I have a nice looking environment for code listings with appropriate ref functionalities. However, I just cannot figure out a way to make the defined ...
1
vote
1answer
94 views

macro: call parameter of level above - double pound ##1 doesn't work

Once again, I have a macro problem. It works almost. I spend a lot of time googling about \expandafter, \noexpand, \unexpanded and others. I used some of them, but nothing lead to the desired result. ...
2
votes
2answers
45 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 ...
3
votes
1answer
33 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: \documentclass{...
5
votes
4answers
166 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: \...
2
votes
1answer
48 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
2answers
72 views

How to implement a verbatim or null environment using a boolean within \newcommand

I am trying to use a boolean environment within a \newcommand statement to selectively implement a verbatim environment. When I set the boolean to true it should put the "Answer" within the verbatim ...
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} \newcounter{...
3
votes
1answer
72 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} \newcommand{\usecase}[...
1
vote
1answer
36 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 ...
5
votes
0answers
67 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} \usepackage{...
1
vote
1answer
28 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 \usepackage{...
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
36 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
32 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
63 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
82 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
72 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
40 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 \begin{...
1
vote
1answer
40 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} \usepackage{...
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[ 0]{|...
5
votes
3answers
541 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
97 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
255 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
50 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
47 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} \begin{tabular}{llllll}...
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} } { \vspace{0.3cm}\\\...
5
votes
0answers
96 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
125 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
33 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} \usepackage[framemethod=tikz]{...
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
37 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
76 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 \begin{...
5
votes
2answers
90 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
58 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
30 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
38 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 help....