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

6
votes
1answer
28 views

Interaction of \BeforeBeginEnvironment and \NewEnviron

Consider the following MWE. \documentclass{article} \usepackage{etoolbox} \usepackage{environ} \usepackage{tcolorbox} \usepackage{amsthm} \BeforeBeginEnvironment{proof}{\tcblower} \NewEnviron{...
2
votes
1answer
30 views

New environment with dedicated index and reference

I'm using chemfig to create some structural formulas, but I need to create a new environment, like equation, that have a dedicated index and reference counter. I'm searching about this, but I'm having ...
6
votes
1answer
117 views

Is the document an example of an environment?

Is the document in which you write your code an example of an environment? It seems like it might be, because it requires \begin and \end statements, but I have never seen a source which defines ...
1
vote
0answers
36 views

Environment for example with pstricks

How can do with pstricks the environment that appears in the image ?
4
votes
2answers
370 views

How can I write like this example and boxs in latex

How can I write like this example and boxs in latex thanks very much
1
vote
1answer
28 views

For programming a command: emit \newline iff we are within a paragraph

Short version: I am defining an environment: \newenvironment{myenv}{\begin{trivlist}\item}{HERE something\end{trivlist}} Now at the point marked with "HERE", I need a "conditional newline" doing ...
1
vote
1answer
29 views

simple formatting issue, 2 interfering environments

I am using the Frankensteins dialogue environment as well as the mdframed environment in order to highlight interesting parts of the dialogue. I would like that these two environments don't interfere ...
1
vote
1answer
31 views

Disabling automatic dissimilarity coding in texshade

The package texshade provides an environment to typeset nucleotide and aminoacid alignments. This otherwise great package has a default setting, which I would like to turn off: By default, texshade ...
2
votes
1answer
35 views

Use \(end)comment instead of \begin/\end{comment}

In my document, the comment environment works fine, but \comment and \endcomment stop processing of what comes next in the document: \documentclass{article} \usepackage{verbatim} \begin{document} X \...
0
votes
0answers
11 views

Using arguments in \newenviroment together with \caption [duplicate]

I created \newenviroment for "professional tables": \newenvironment{tabpo}[1]{% \begin{table}[!ht] \centering \begin{tabular}{lllllll} \toprule } {% \bottomrule \end{tabular} \caption{Arg:...
2
votes
1answer
29 views

How to align the left hand skill type?

Within the following piece of code I wish to align the skill type with the top of the text written on the right hand side. Otherwise the text becomes difficult to separate. This is from a template CV ...
5
votes
1answer
64 views

How to “shallow” \renewenvironment of \itemize?

I want to patch exactly the outer level of \itemize, whereas the following MWE (expectedly) patches all of them: \documentclass{article} \begin{document} \setlength{\fboxsep}{0pt} \let\saveditemize=...
0
votes
0answers
35 views

How to make post processing changes?

I'm not a Latex expert so I might be using the wrong terminology. I would like to create a package that make some post processing calculation and write the result to the document. More specifically, I ...
0
votes
0answers
15 views

Change the behaviour of emph per environment

Is there redefine the way emph behaves in the definition environment? Right now, since definition is in italics, emph just makes the text non-italic which is not enough to make it stand out. Is there ...
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]{...
35
votes
3answers
44k 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?
1
vote
0answers
42 views

Using enumerate within theorem environment [duplicate]

I defined myself a \newtheoremstyle a \newtheorem + \newenvironment as in the following %Theoremstyle with \newline \newtheoremstyle{break} {\topsep}{\topsep}% {\normalfont}{}% {\bfseries}{}% {\...
2
votes
2answers
51 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 ...
0
votes
1answer
22 views

“widetext” not recognized in TeXstudio

I use "revtex4-1" document class in TeXstudio. But I find that the environment "widetext" is labeled "command not recognized" even after I check the box before the term "revtex4-1.cwl" in the "...
4
votes
2answers
56 views

reformat section headings to include text

I'm sure that there's a easy answer, but I've reached the point of frustration trying different things with the \renew command. I want to reformat all section headings to include the text "Question" ...
2
votes
2answers
65 views

Defining alternative environment for code listing for tex4ht without code duplication

I am using tcolorbox with listings for code formating, which works well in pdf, but this package does not work with tex4ht (it produces invalid output). I am having hard time figuring the latex magic ...
3
votes
2answers
74 views

help in finding error using \newenvironment

I am learning \newenvironment and I need help in finding where my error is in making \newenvironment. I get a Latex error and I do not see what I am doing wrong. I am trying to reduce code ...
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 ...
0
votes
1answer
26 views

Changing the top margin of the proof environment

In my opinion the proof environment has too big of a top margin. I'd like to have it visually closer to the proposition or theorem it refers to. I have verified that adding \vspace{-3ex} before a ...
3
votes
1answer
37 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?
3
votes
2answers
270 views

Left bar in the margin of an environment with figures/tables

I am writing a document with theorems and proofs. Since, some reader may not be interested by the proofs I want to highlight them so they can be skipped easily. The best idea I came up with is to ...
1
vote
1answer
26 views

Create custom tabular environment

In the process of creating a beamer template from a PowerPoint template, I am trying to create a tabular environment with colored rows, lines between the rows and specific header and footer styles. ...
1
vote
1answer
26 views

longtable and filecontents inside a newenvironment

I'm trying to create a new environment for longtable enclosed by a filecontents environment. But I'm stuck and don't know exactly how to solve my problem. \documentclass[a4paper,parskip]{scrartcl} \...
3
votes
1answer
42 views

“Something's wrong--perhaps a missing \item” error in \newenvironment using a \vtop box

In attempting an answer to "How to label a list / make a line before list stick with the list?" I answered using a \vtop box to contain the entire list including the label. I then, trying to improve ...
3
votes
1answer
26 views

Using/Forcing upright text within theorem environment

I would like to write an equation within a theorem that involves an integrand and the upright symbol $ \textrm{d} $ which I have abbreviated in my preamble with \newcommand{\dmath}{\textrm{d}} (...
3
votes
1answer
29 views

Error: "Something's wrong--perhaps a missing \item.'' using multicol in a \newenvironment, can it be fixed?

The below works, but produces an error message Something's wrong--perhaps a missing \item. Does anybody know why it throws an error, and how to correct my code? \documentclass{article} \usepackage{...
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 ...
7
votes
3answers
265 views

Environment to replace \vbox{\hbox{…}\hbox{…}\hbox{…}\hbox{…}…}

I am using LaTeX (LuaLaTeX,actually) and lately I found myself doing this a lot: \vbox{% \hbox{\strut foo}% \hbox{\strut bar}% \hbox{\strut baz}% } I use it inside tabular environments, ...
0
votes
0answers
16 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 ...
4
votes
1answer
41 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
26 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
138 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
15 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
48 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
137 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
29 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 ...
2
votes
2answers
61 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} {\begin{...
2
votes
2answers
126 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
29 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 ...
6
votes
2answers
261 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
1answer
75 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 ...