{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
14 views

Prevent gather* from creating new line [duplicate]

I've been trying to use the gather* environment for non-aligned centered equations within enumerate but I would like to prevent the new line that gather* inserts at the beginning of each item. Is ...
1
vote
1answer
24 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
35 views

How to edit proof environment or minipage

Im actually working at my faculty as assistant teacher, and I like to write in latex everything we do in classes, so I use the following format: \fcolorbox{white}{light-gray}{\begin{minipage}{18cm} ...
3
votes
2answers
24 views

Partial center in environment

I'm writing a lab manual with step by step directions. Some directions include screenshots. To keep the screenshot with the line of direction, I use samepage. I am exploring an environment I can use ...
1
vote
1answer
123 views

Longtable integration Stata

As far as I am aware, the available commands that produce LaTeX-formatted tables of stored estimates using Stata, will only produce tables using either the table or tabular environments. Do any other ...
1
vote
1answer
12 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
19 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} ...
1
vote
2answers
45 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 ...
6
votes
2answers
132 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
27 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 ...
12
votes
4answers
1k views

How to pass an optional argument to an environment with verbatim content?

This is an attempt to make clear what happened in this question of xport (now deleted, sorry). The now deleted question included code that tried to make my answer to this question of xport work for ...
0
votes
0answers
16 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?
2
votes
2answers
56 views

\indent doesn't work as expected in custom nested environments

I have a custom environment that I use as follows: \documentclass[12pt,draft]{memoir} \usepackage[dvipsnames,usenames]{color} \definecolor{shadecolor}{gray}{0.85} \newenvironment{Myenv} ...
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} ...
2
votes
2answers
123 views

Suppress paragraph indentation after tcblisting environment?

I am writing a document containing lost of snippets of code, and I've defined an environment using tcblisting from the tcolorbox package to do this. The environments work fine. What I want to do ...
0
votes
1answer
26 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 ...
5
votes
2answers
248 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 ...
20
votes
0answers
246 views

How can I make a custom environment that wraps listings? [duplicate]

Thanks to this answer, I know it is possible to float and wrap text around a listing. I would like to setup an environment for mini-code snippets that always floats and wraps the same way. I can ...
0
votes
0answers
33 views

Transforming subenvironments

I need a way to access the subenvironments of an environment. So when I have code like: \begin{env} \somecommand{...} \begin{someenv} ... \end{someenv} \begin{A} ... ...
0
votes
1answer
49 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
73 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 ...
3
votes
1answer
85 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 ...
2
votes
1answer
29 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} ...
0
votes
1answer
63 views

code using the same packages of tikzcd works on one project but not other [closed]

I'm using the package \usepackage{tikz-cd}. Note that this code works good: \documentclass{amsart} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} & D \arrow[d,"f"] \arrow[dl, ...
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. ...
2
votes
1answer
36 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 ...
5
votes
2answers
49 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 ...
0
votes
1answer
28 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 ...
1
vote
0answers
45 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. ...
8
votes
1answer
86 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 ...
1
vote
2answers
57 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 ...
4
votes
1answer
1k views

Reduce space before and after an environment

A simple(?) question, how do I reduce the space before and after a environment? I suppose I'm after a redefine environment command that I can put at the top of my document. Example I'm using ...
5
votes
2answers
84 views

Display environment differently for one use vs. two

My issue can be boiled down to this: \documentclass[10pt,oneside]{article} \usepackage{enumitem} \newenvironment{mygroup}{ \vspace{.15in} \textbf{\large MyGroup Heading} }{ } ...
3
votes
1answer
95 views

lilypond environment inside a table

While making a song book I came to a point in which I wanted to insert lilypond code inside a table (tried also a box); this was due to some placing notes around texts and similarly things. But this ...
3
votes
1answer
39 views

edit an environment to add to a new extra parameter

I'm trying to define a new \newenvironment but I'm having some problems. I need an environment that uses a counter and uses an extra parameter to write some text. I'm working with this environment: ...
0
votes
3answers
73 views

Problem with lstlisting environment

I'm writing \documentclass{beamer} \usepackage{listings} \begin{frame} \begin{lstlisting}[language=bash] #!/bin/bash echo "Hello,world!" \end{lstlisting} \end{frame} But the output ...
1
vote
1answer
219 views

Combine listings package with my own environment [duplicate]

Possible Duplicate: How to use different lstset settings for listings? I have defined my own environment as: \newenvironment{codegui}[3]{% \def\tmplanguage{#1}\relax ...
4
votes
1answer
54 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
32 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 ...
4
votes
1answer
15 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} ...
2
votes
1answer
60 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 ...
4
votes
1answer
90 views

newenvironment using pgfplotstable

I want to have a newenvironment body as an inline input argument for pgfplotstable. Is it possible to do this without using braces in the body itself? \documentclass{article} ...
2
votes
1answer
411 views

Insert text before end of page, and at the beginning of the next page

I'm putting a template together and I have created a custom command which I'm going to use to set specific margins on the text passed to its argument and a few more formatting things, like this: ...
5
votes
2answers
85 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
45 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
35 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 ...
1
vote
2answers
85 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 ...
2
votes
1answer
32 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} ...
1
vote
1answer
92 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. ...