{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
1answer
202 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 ...
7
votes
1answer
432 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
164 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
717 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
135 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
262 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
248 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
394 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: ...
11
votes
2answers
272 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
92 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
162 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
157 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
37 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
118 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
200 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
97 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
913 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
121 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
363 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
64 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
70 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
261 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? ...
4
votes
1answer
128 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
65 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 ...
3
votes
1answer
345 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 ...
13
votes
1answer
319 views

Is there a way to have an “empty” environment to merely limit scope of declarations?

I am fairly new to LaTeX, so I apologize if this is a beginner question, but I have not found a good way to query for it otherwise. I have observed that when I use an environment like ...
4
votes
1answer
710 views

Using tabularx in a custom environment - “misplaced \noalign”

Question Currently, I'm trying to shorten the creation of small tabularx-tables with pre-defined headers, but somehow, trying to use the tabularx-environment, even though I used the \tabularx and ...
2
votes
1answer
100 views

Content being pushed off page, no new page being started

I've got a custom class made for homework assignments, and I'm only just now running into an issue with it. I made a couple of custom environments for problem/solution pairs, and I used a tabular to ...
16
votes
6answers
484 views

A new environment to decide dynamically which commands to run?

I am having some user defined commands defined and used in my latex document. I need a way to check whether any of the commands is used. I want to make decisions based on the argument used in the ...
2
votes
1answer
1k views

Create new environment with options

I'm new to creating new environments and even though I searched at the xparse*documentation I couldn't figured out how to solve my specific problem. I would like to create a new environment, say ...
1
vote
3answers
161 views

Is there other possible way for continuous numbering?

I am creating a document using exam class. I have four question types here which i had created each a command. Is there facility to enforce continuous numbering for each question types instead of ...
5
votes
1answer
451 views

How to prevent indent on second line with packed itemize?

How to prevent indent on second line with packed itemize instead of itemize? In other words I dont want "Major" to be indented. \documentclass[letterpaper]{article} \usepackage[empty]{fullpage}% ...
4
votes
2answers
154 views

My custom theorem/proof environments aren't playing well together

As can be shown in the following MWE, when I have a theorem environment followed by a proof environment, the proof isn't going into the next line; it's rendering right on top of the text I have for ...
8
votes
2answers
399 views

Patch tabular environment with colorbox

I'm trying to quickly add a colored background using colorbox to all tables as shown in this answer. While I could just update all the TeX by hand, I am trying to patch the tabular environment to ...
10
votes
3answers
274 views

Defining a list environment with multiple optional arguments

I'm trying to define a list environment with multiple optional arguments and with a default values for those arguments. For example, creating a new environment with a name newenv, which accepts two ...
1
vote
0answers
47 views

How to avoid text style adoption in environment? [duplicate]

When I define a macro such as: \newcommand{\mymacro}{a_{\text{sample}}} the "sample" text is italic when used in e.g. an example environment. How can I make sure it will not adjust to this ...
4
votes
1answer
79 views

Problem with referencing to a newenvironment

The reference I'm using below doesn't work. I think I'm missing something in the definition of myclaim. Any ideas? \documentclass{llncs} \usepackage{amsmath} \newcounter{claimcounter} ...
6
votes
2answers
151 views

Getting the first line of an environment

as the title suggests, I'm looking for a way to get the first (printable) line in an environment. My first naive attempt (ignoring the printable requirement) was something like this: ...
1
vote
1answer
237 views

Counters for claims

I want to redefine the claim environment so that it will be numbered but I'm having a hard time with the counters. I want the following: \begin{theorem} thm 1 \end{theorem} \begin{proof} ...
9
votes
1answer
206 views

how to redefine \begin{align*} … \end{align*} to \begin{eqnarray*} … \end{eqnarray*}

Scientific word insists in generating displayed math using \begin{align*} ... \end{align*} and htlatex has a bug in that it does not generate bit mapped images in this case. The fix that I found ...
4
votes
2answers
152 views

I can't use & tabs in the `align` environment while using it inside a custom environment

I've got a custom environment made for problem sets, and it uses a tabular to align the question number and question body. When I try to use & to group parts of an equation together - like if I ...
1
vote
1answer
400 views

Problem using enumerate environment in a proof newenvironment definition

I want to define a simple environment to enclose my proofs, actually I just wanted to put a little square right at the end. So, I made this new environment definition: \newenvironment{Proof}{ ...
3
votes
1answer
108 views

Custom environment problems using environ

As shown by my MWE, I have two small issues that I'd like to get assistance with in fixing. First off: When I start two problem environments one after another without a blank space between the ...
0
votes
2answers
141 views

How do I make frame environment play nice with \textbf?

I am getting a strange error message when I put textbf into a frame environment. Minimal Example \documentclass{article} \listfiles \begin{document} \begin{frame} \textbf{Lemma 1} \end{frame} ...
3
votes
2answers
85 views

Cross-referencing a custom environment with two arguments

Sorry if my question title is ambiguous. I want to write an environment called "problem" that works as follows. I want to be able to write \begin{problem}{1}{2} this is a problem statement ...
8
votes
1answer
243 views

Replacing Leading Minus Signs in Environment

In this question concerning negative signs and the alignment of entries in matrix environments, Heiko Oberdiek gave a great answer in which he uses a user-defined command called \matminus instead of ...
0
votes
1answer
201 views

How to get minipage to fill remainder of width up to right margin?

I'm trying to design a custom question\solution environment for homework assignments (I'm aware of the exam class but I am choosing to try and make my own) and am having problems with the alignment. ...
4
votes
1answer
249 views

How can I make an environment so that I can reserve space for text next to a figure?

I'm working on a layout for a custom textbook class, and I'm having issues getting this environment to work as I like. Here's a shot of my current working layout: I'd like to be able to make an ...
3
votes
1answer
468 views

Can't use theorems in lyx (mac)

I want to switch to lyx, but I'm having a hard time trying to use environments. I red that they are supposed to be as a class in the drop down list at the top left (If I'm nor wrong, together with ...