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

1
vote
1answer
16 views

Implementing a new environment for Log Entry Journal

I am trying to define a new environment to create a log journal. In the left margin I wish the display the entry date. Each entry should be separated from the entry above via blank line and have a ...
2
votes
1answer
20 views

Parameter numbering doesn't work in a \newenvironment footer. How to make it work? [duplicate]

I try to create a new environment for a monotonously repeating tabular, which has one parameter. This must be at the end of the tabular. I tried this way: \documentclass[12pt]{article} \usepackage[T1]...
1
vote
2answers
49 views

Environment behaves different inside \cslet{}

Please scroll down for the EDIT and most recent version This is not a good title, but I didn't come up with a better one. I've got an environment which should be used like this (The way this looks ...
6
votes
2answers
140 views

What happens if you use a command form of an environment?

Despite the fact that tex.SX is warning me that this seems to be a subjective question, it isn't. (I don't think it's a dup either, this was the closest I found.) I want to know precisely what ...
2
votes
1answer
30 views

Forcing qed symbol to stay on same page

I've made this enviroment: \newenvironment{rjesenje}{ \emph{\textbf{Rješenje:}}}{\vspace{0.1cm} \begin{flushright} $\clubsuit $ \end{flushright} } And in my work I've got this output. How do I ...
3
votes
1answer
38 views

How can I begin a new page inside the environment codebox?

If I write all codes inside one codebox, it will overfill the page. And if I write it in two boxes, then the line counter will restart from 1. How can I save the line counter?
0
votes
1answer
30 views

Vertical Spacing After NewEnvironment Definition

How can I modify this, \newenvironment{definition}[1][Definition]{\begin{mdframed}\begin{trivlist} \item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}\end{mdframed}} so that a newline (vertical ...
3
votes
2answers
34 views

Modifying the end of the section environment, without changing its name

I would like to add certain behavior to the end of an environment (vspace). I would like to do so without changing the name of the environment. I found the following code in a different Stackexchange ...
0
votes
1answer
101 views

SAS to LaTeX: Environment longtable undefined

My general problem is that, after oh so many hours, I cannot find a way to bring SAS output into LaTeX. I have one way where SAS spits out a table using the sas package, where it gives you tables in ...
2
votes
1answer
109 views

\chaptermark undefined error in classicthesis.sty when I (attempt to) redefine \spacedlowsmallcaps

My MWE does not compile and the error is: ! LaTeX Error: \chaptermark undefined. I have debugged to the extent that I know the error is the interaction between classicthesis and my \SC command ...
6
votes
2answers
265 views

How to create very customized “numbered” environments

I want to have an environment alike or identical to the itemize or enumerate environments in such a way that I be able to fully customize each item. For example, I want to use my very own defined "...
2
votes
1answer
31 views

\linebreak \\ causes error inside \BODY of \NewEnviron

I've got some code, which is mainly based on the solution of this: Other question I asked The code looks like this and it works so far, except for the \\-stuff: \documentclass[12pt,a4paper]{article} \...
3
votes
1answer
87 views

How to create a fully customized and compatible LaTeX environment

I want to create a simple environment in LaTaX that's alike the following figure. If, for example, this environment has some spare comments like references or so, to be added above the environment (...
3
votes
1answer
42 views

Using a command for a property within an environment

I want to use a command within an environment to set an environment's property. I could do this using a parameter, but if I had more properties, parameters might be mixed up. \newenvironment{...
2
votes
1answer
47 views

New environment with parameter

This is my first question on this forum, so don't hesitate to correct me. I want to create a new environment who I can pass a parameter "color". This environment call a new command named \...
1
vote
0answers
48 views

What is a good environment for writing problems and solutions? [closed]

I'm writing a book where I record interesting problems and their solutions. However, there does not seem to be an organized list, or other reference to these types of latex packages and tex macros. ...
1
vote
2answers
77 views

Abstract page of babel[magyar] undefined

I am working on a document that uses a custom class. I want to change the class so that it would use the babel[magyar] instead of the english version. However, when I try to do so, I get the ...
8
votes
1answer
88 views

Irregular spacing around a user-defined environment

I have defined an environment for consistently typesetting a pair of alternative assumptions being made. The idea is that wherever I make an assumption, the assumptions are indented and on the left ...
5
votes
2answers
50 views

Checking if a subenvironment is unique inside an enviroment

I would like to define a environment inside another environment, but I need to make sure the new environment is unique, so there can only be of them. The unique environment should also be able to be ...
2
votes
2answers
56 views

Compatibility issue with \renewenvironment{figure} and [H] placement

This is related to Shift all floats on page horizontally. While trying to redefine the standard figure environment I've run into compatibility issues with the [H] placement specifier from the float ...
4
votes
1answer
59 views

Defining a null environment

I am writing a mathematical document and I want to make a overview document, in which I only present the theorems and definitions and not the proofs, so I thought that I can change the environment ...
0
votes
0answers
37 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
91 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
53 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
34 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
3answers
124 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
57 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
35 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
171 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
50 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
73 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
25 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
77 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
38 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
71 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
29 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
37 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
37 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
69 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
85 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
79 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
44 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
88 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 ...