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

4
votes
1answer
105 views

catchfile(betweentags) and obeylines

I'm writing two large documents, both containing much of the same text. To ease the maintenance, I'd like no redundant paragraphs, but rather to use catchfilebetweentags. Everything works well, ...
2
votes
1answer
94 views

Custom caption text

How do you set the caption name to say foo instead of figure? I have tried using a custom environment but am encountering several issues.
5
votes
3answers
11k views

Footnote in tabular environment

It seems as if footnotes would have only a problem with the table environment but in my minimal example non of those answers Footnotes in Tabulars? Footnote in table seem to work for the tabular ...
3
votes
1answer
176 views

LaTeX2rtf with pdftooltip

I'm using LaTeX2rtf to convert LaTeX article or report documents into rich text format. I also compile the PDF using pdfLaTeX. In my document, I use the pdfcomment package to create tooltips. ...
4
votes
1answer
132 views

How to change an environment into newcommand?

Suppose that I want to create a new command named step, which functionally add Step 1., Step 2., and so on in the proof. This can be done by: \newcounter{stepnum} ...
6
votes
3answers
195 views

How to adjust a counter depending on whether or not we are inside a section or subsection

I want to create an exercise environment that can be used in either section, subsection, etc. As an illustration, consider the following: when in section 1, the third example should be titled as ...
8
votes
2answers
547 views

Combining `tikzpicture` and `lstlisting`

I'm working on a custom lstlisting environment, in which I use TikZ to add a frame and a title. Because of the widespread curly braces of node I cannot use newenvironment, so I have to resort to ...
5
votes
1answer
1k views

How to define environments for questions and answers

I wish to do a simple question and answer sheet for my students. I'd like to have something like this: \section{Differential Equations} \begin{questions} \begin{question} ...
0
votes
0answers
50 views

\renewenvironment optional arguments using old environment [duplicate]

I ran into a problem and haven't quite figured out how to solve it. I would like to reuse an existing environment definition with optional argument to get a new one, which should also have one ...
2
votes
0answers
207 views

Using autoref with my own label to my own new environment [closed]

I defined my own environment. Now I want to refer to my environment with autoref. But autoref should refer with my own defined name. But I don't know how to do this. Could someone help me? My code ...
4
votes
3answers
222 views

Can't include a 'tabu' inside \newenvironment with cells in the postamble

I'm trying to include a tabu inside a new definition of an environment but it fails if the postamble (enddef) of the new environment includes tabu's contents, so cells. With tabular or tabular* works. ...
0
votes
1answer
122 views

Can't use \left. … \right| in a custom environment

I'm writing a Hebrew (RTL) document with equations and I compile it with xelatex. The equation numbers are wrong and I have found that placing \LTR tag before the equation fix this. I have created an ...
9
votes
4answers
393 views

How to redefine an environment to produce no output?

I am using the verbatim environment with \begin{verbatim} XXXX \end{verbatim} I would like the option of redefining the verbatim environment so that nothing between \begin{verbatim} and ...
11
votes
4answers
398 views

Is there a ready solution to typeset a diff file?

In a text about Git I want to typeset diffs similar to this visualization: Commit details on GitHub. Is there any ready-made solution to that, especially the coloring of the diff lines? (In other ...
6
votes
2answers
166 views

Delaying command expansion that appears in \begin handler until \end handler executes

I have a custom environment for handling a code interface declaration that is specified as: \begin{decl}{FOO} \param{in}{bar} the bar input parameter \param{out}{baz} the baz input parameter ...
4
votes
2answers
364 views

How to scale prooftree environment (bussproofs package)

I am using package bussproofs in order to draw sequent calculus style proofs. The proofs are often lengthy and would like to scale them but I can not do it. There is an uninformative error raised: ...
1
vote
1answer
6k views

LaTeX Error: Environment table undefined

When I try to compile a latex file, I get the following error: LaTeX Error: Environment table undefined. I think the line that is causing the problem is: \begin{table} Does anybody know how I can ...
6
votes
1answer
1k views

Create a “claim” environment

I am writing a quite long proof in a LaTeX file and I would like to create a "claim" environment to put inside said proof. Can someone help me to understand how this can be done, or at least redirect ...
1
vote
1answer
130 views

Custom Wraptable Environment [duplicate]

Let's say I have something like this text text text \begin{mywraptable}{r}{6cm} my beautiful table \end{mywraptable} text text text And now I define the following custom environment: ...
2
votes
1answer
65 views

System: XeLaTeX, Circumstance: Automation, PROBLEM: error message “missing \item”

I am currently generating PDF's with variable contents from a template I made. Data is fetched from a database and used to create reports. This has been working greatly until recently I needed to ...
3
votes
2answers
317 views

Defining a newenvironment with optional caption

I am trying to define a new table environment with optional caption. However, if I don't pass it the caption, I am still getting the "Table 1.1:" below the table. What am I missing here? Thanks. ...
3
votes
2answers
96 views

How to avoid unwanted Spaces in \NewDocumentEnvironment?

I tried to make my own "quote"-Environment and I wanted the first Letter to be bold and a little bit bigger than the rest. As \lettrine doesn't work the way i wanted, i tried to code it on my own. ...
4
votes
1answer
137 views

How can I define a new environment which limits the scope of \newtheorem commands?

I am attempting to make an environment out of the command given in one of the answers to this question: Customizing theorem name. \documentclass{article} \usepackage{amsmath} \usepackage{amsthm} ...
10
votes
5answers
465 views

How to create a “delay expansion” environment?

I don't want to use the following \begingroup \edef\next{\endgroup \noexpand\const{Xp}{\X(tp)} \noexpand\const{Yp}{\Y(tp)} \noexpand\const{Xf}{\X(tf)} \noexpand\const{Yf}{\Y(tf)} ...
0
votes
1answer
257 views

Can't use caption in new environment

I am trying to make some consistent tables and looked into the nenenvironmentcommand. However, I am having trouble having a caption and using the defined environment at the same time. newenvironment ...
8
votes
1answer
556 views

Controlling parindent in enumerate inside customized list environment

I'm trying to control the indentation of paragraphs in an enumerated list that is inside a customized list environment. I find that changing \parindent in the inner list has no effect. Here's an ...
1
vote
1answer
179 views

new quote-based environment end spacing [closed]

In order to insert quotations, the document uses a quote-based \newenvironmentx \newenvironmentx{QUOTE}[1][1=.]{% \begin{quote}% \tiny\noindent% \gdef\parQ{#1}``% }{\parQ''% \normalsize% ...
1
vote
1answer
937 views

TeXstudio: How to add custom highlighting for custom environment?

Until there is a cwl file for the paralist package, I would like to just include the compactenum environment into the custom highlighting list in the TeXstudio Options. I tried adding compactenum in ...
4
votes
1answer
141 views

Class Design: Environment vs. Macro

I have seen What are the consideration when choosing either newcommand or newenvironment? but I think this is a little more specific. If it's a duplicate, then so be it. If the second part of the ...
13
votes
4answers
283 views

What are the consideration when choosing either newcommand or newenvironment?

The first time I learnt LaTeX, I thought \newcommand properly fits for inline mode and \newenvironment for displayed mode. Later I noticed it is not correct. So the question is What is the rule of ...
3
votes
1answer
319 views

prooftree from bussproofs package inside “cases” environment

I am using bussproofs package to provide some type proofs. According to bussproofs manual, it is impossible to use prooftree inside math mode. However, I would like to insert prooftree in the cases ...
7
votes
1answer
462 views

Define a command for italic, bold and centered title inside a quote

Inside my quote, I have a bold, italic and centered header. How can I define a command so that I can typeset this text all in one go? I tried: ...
12
votes
2answers
295 views

What is the problem with nested environments using \BODY (environ package)?

This question led to a new package: newenviron I want to define some environments, which place their content into multiple different other environments. To access the contents I used the ...
2
votes
2answers
97 views

Add parameter to existing command produces error

I have this command in a template given by my prof \newcommand{\homeworkProblemName}{}% \newcounter{homeworkProblemCounter}% \newenvironment{homeworkProblem}[1][Problem ...
7
votes
3answers
179 views

Using commands inside environment definitions

I want to do something like \newenvironment{definition} { \textit{ } { } } but of course it doesn't work, the braces get mixed up. (In other words, I want that within my environment, the ...
2
votes
1answer
202 views

Creating a particular environment with a left-side rule

I don't have much experience in creating environments, and my understanding of them allows me to create environments which do something at the beginning and at the end (like for instance, in a "proof" ...
1
vote
0answers
39 views

How to implement a floating text box? [duplicate]

I'm trying to write an environment that creates a new float type for text boxes. These are used for example in some books to provide interesting tidbits that aren't really part of the main line of ...
5
votes
1answer
130 views

Automatic numbering of nested environments / items

I would like to have an environment, let's call it nested, which produces output like Case 1: top level item 1 Case 2: top level item 2 Case 2.1: nested item 1 Case 2.2: nested item 2 Case 2.2.1: ...
1
vote
1answer
242 views

Word count excluding certain environments

I would like a way to get a word count while ignoring certain environments. The reason for this is that I have quite a bit of pseudocode enclosed within multiple verbatim blocks. Ideally, a solution ...
3
votes
1answer
106 views

Is it possible to get the current item number and perform arithmetic on it in enumerate environment?

That is, suppose that I am at item n and I want to make a reference to item n - 3 without explicitly specifying it.
2
votes
2answers
1k views

Create environment out of eqnarray with frame box

Could you help me to create an environment out of this code: \smallskip\centering\framebox[0.9\textwidth]{ \begin{minipage}[c]{0.8\textwidth} \begin{eqnarray} I & = & ...
5
votes
1answer
128 views

Using environment argument inside a new environment doesn't work

I know it must be something trivial: \documentclass{article} \usepackage{amsmath} \usepackage{amsthm} \usepackage{thmtools} \usepackage[svgnames]{xcolor} \usepackage{framed} ...
2
votes
1answer
474 views

newenvironment tabularx and begin center

I try to create a custom env, based on a tabular. I try to make a \begin{center} before my tabular to remove identation at the beginning of the tabular, but he tells me "File ended while scanning ...
1
vote
1answer
78 views

How do I embed a gather environment within a custom environment?

I've tried defining the following custom environment, but I get errors: \begin{gather} ended by \end{solution} etc... Here's a MWE showing my problem: \documentclass{article} ...
1
vote
1answer
84 views

How do I redefine a custom environment that I have previously defined elsewhere?

I made a custom class for homework assignments and I've defined a solution environment as follows: \def\qed{\ensuremath{\square}} % <-QED Symbol \newenvironment{solution}{% <-Solution ...
7
votes
2answers
300 views

What is wrong with defining \bal as \begin{align}?

I'm trying to define two commands \bal and \eal instead of inserting \begin{align} and \end{align} in my document, but in the code below, I'll get some errors. What is wrong with it? ...
5
votes
1answer
148 views

Define environment with two parts

I would like to define an environment having two parts, i.e. \begin{myenv} some text \nextpart{myenv} some more \end{myenv} I think I could do this by exploring the definition of ...
3
votes
1answer
72 views

Remove the automatic generation of number?

I looked for my past thread which can be found here: Create a two column static small box the solution i accepted was the truefalse environment. My question is, how will i remove the automatic ...
4
votes
1answer
460 views

Create an environment like the `checkboxes` in exam.cls

I am having trouble on how will i create something like the checkboxesor oneparcheckboxes environment in exam.cls. The only difference is that since the checkboxes gives circle, i'd like to create ...
2
votes
0answers
49 views

Is it possible to check if I am inside a float environment? [duplicate]

I have a class file that I am writing (it's my first one and I am new to LaTeX). I have a situation where I'd like to know if I am inside a float so that I can prevent attempting to create a nested ...