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

2
votes
1answer
200 views

Custom glossary environment improvement

This is a followup question about the code provided by Nicola Talbot in this question: Automated generation of equation key TL;DR: Defines new environment alignglos which can be used to wrap ...
10
votes
1answer
84 views

How can I detect if an environment is right after a sectioning command?

I'd like to build an environment that would detect if it is right after a sectioning command (\section, \subsection or \subsubsection) and smart enough to detect if a float-type environment (say ...
1
vote
1answer
79 views

How to ignore proofs? [duplicate]

I'd like to print a shorter version of my paper without all the proofs, I'm thinking about something like \renewenvironment{proof}{\begin{comment}}{\end{comment}} but that activates the comment ...
5
votes
1answer
298 views

flush bottom an environment

Suppose, I have defined an environment called myenvironment which typesets multiple lines of text using various formats. So, the height of the environment depends on the text that it has which is ...
4
votes
1answer
56 views

Bad interaction between keycommand and environ?

I suspect the keycommand and environ packages are not playing nicely together, because the following code gives an error. Can anybody explain what's going on? \documentclass{article} ...
13
votes
2answers
933 views

Format a verbatim paragraph

How can I format a verbatim paragraph? I.e. break, fill and join input lines to produce globally balanced output with the lengths of each line approaching the target \textwidth as closely as possible. ...
12
votes
4answers
420 views

Opaque error messages given by common environments

This is a public-interest question. The title of the question Why does this error keep popping up even though I clearly fixed it? poignantly expresses a fundamental truth of LaTeX usage: sometimes ...
2
votes
1answer
198 views

using a restatable before it is stated

This question is related to the question at Recalling a theorem, which uses the thmtools and thm-restate packages and the restatable environment to define a theorem that can be re-stated later on. Is ...
6
votes
1answer
162 views

How to set lengths only for a specific environment (parindent for paracol in this case)?

Is it possible to set a length specifically for an environment? I know it is possible to change lengths for parts of the document only, by placing the \setlength command between {}, but when using an ...
21
votes
2answers
1k views

Reliable code for automatic \noindent after specific environments?

This question led to a new package: noindentafter There are a number of environments which I never want to follow up with an indented paragraph. itemize, enumerate, theorem, definition, etc. I ...
11
votes
2answers
315 views

How can I define a new minted environment with optional arguments?

I have the following mwe: % arara: pdflatex: { shell: true } % arara: pdflatex: { shell: true } \documentclass{article} \usepackage{minted} \usepackage{listings} \usepackage{caption} ...
13
votes
2answers
536 views

How to turn off an environment (e.g. tikzpicture) for faster draft compiling

I'm currently writing my thesis and have been looking for ways to speed up compile time. I can shave off a lot of time by using draft mode so that images aren't processed, but I have several TikZ ...
2
votes
1answer
2k views

Environment lstlisting undefined

Hi I have installed the listings package in order to display my code. I am running the following code within my document: \begin{lstlisting} public static void main(String[] args) { ...
15
votes
2answers
446 views

How to make AUCTeX ignore syntax highlighting within environment

I have a problem with syntax highlighting in the Emacs editor using AUCTeX. The problem occurs in particular with the Verbatim environment from the fancyvrb package. Consider the following code: ...
6
votes
1answer
151 views

Macro to create new .tex files

I borrowed from Extracting the contents of text in a specified environment into a new file some code that extracts lines from a .tex file and puts it into a new file. The code works well, but I would ...
4
votes
3answers
242 views

How to embed a letter?

Suppose I am writing a novel using the book class, in which a correspondence from the hero to the heroine needs to be embeded, like this: Dear Marie, I miss you very much, I'll come home in a ...
3
votes
2answers
639 views

Word count in LyX which does not include Figure captions

Is they a way of obtaining a word count in LyX that does not include text inside captions (Figures, tables etc.)?
3
votes
1answer
219 views

typesetting a physical law

How should one type set one of Newton's law? \begin{definition} environment doesn't seem right since it should say the law's name in bold not definition (some number) and \begin{theorem} doesn't fit ...
2
votes
2answers
675 views

Create a new environment that uses a verbatim environment

Consider the following: \documentclass{article} \usepackage{environ} \usepackage{verbatim} \usepackage{color} \NewEnviron{vred}{% \color{red} \begin{verbatim} \BODY \end{verbatim} } ...
3
votes
2answers
142 views

Centering a wide table that is defined inside a NewEnviron

I am trying to centre a table with a lot of content whose width is larger than the text width. The problem is that I am defining the table environment in the preamble so I can reuse it, and this seems ...
2
votes
1answer
118 views

Get rid of numbering in “remark” environment

I use renewcommand for changing the remark into my native language, more precise, I used : \renewcommand\remarkname{Chú ý} It goes with a counter, i.e each time I start a remark \begin{remark} ...
4
votes
1answer
116 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
97 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.
7
votes
3answers
17k 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
195 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
138 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
210 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
614 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 ...
6
votes
1answer
2k 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
236 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
255 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
129 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
482 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
436 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
182 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 ...
5
votes
2answers
451 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
8k 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
2k 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
143 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
69 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
381 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
99 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
155 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
504 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
300 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
688 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
183 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
1k 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
148 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 ...