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

10
votes
1answer
152 views

Environment with delayed expansion

I'm trying to define an environment test that stores its contents unexpanded in a macro \testcontents. For example, the code \newcommand{\cmd}{bad} \begin{test} \cmd \end{test} ...
1
vote
0answers
46 views

How to hold all lines in a defined environment? [duplicate]

\def\Grammercaption{\textbf{Grammer}} \def\grammer{\bgroup\ignorespaces\Grammercaption\fontsize{10}{13pt}\selectfont} \def\grammer{\egroup} I want all lines of text within this environment stick ...
2
votes
1answer
547 views

Left aligned multi line equations and \newenvironment

I'm building a table of integrals, for my own use. I need simple things: equations must be left aligned, sometimes I need alignment on the equal symbol and to save space sometimes I need 2 equations ...
4
votes
1answer
1k views

Creating a custom environment

I'm using the following syntax for my code snippets \begin{minipage}{\textwidth} \begin{lstlisting}[caption=<something>, label=<something>] The REST Endpoint URL is ...
6
votes
2answers
387 views

renewcommand for description

I have a document with many \description environments. All of them are defined like this: \begin{description}[leftmargin=2.5cm,style=sameline] \item[\texttt{foo}] bar ...
4
votes
1answer
617 views

Issue with \newenvironment and framed and quotation

\documentclass[a4paper,10pt]{article} \usepackage{framed} \usepackage{lipsum} \newenvironment{nb} {\begin{framed}\begin{quotation}} {\end{framed}\end{quotation}} \begin{document} \begin{nb} ...
7
votes
1answer
117 views

Feature Page

Lets say that I want to create a feature environment, which has two columns, in one column there is a picture (with a caption), in the second there is text. For the odd pages, I want the picture on ...
2
votes
1answer
84 views

Cross referencing in numbered environment

I picked up a template to write exams a while ago only. Each problem is written between \begin{problem} and \end{problem}. In the preamble I have \documentclass[12pt]{article} \usepackage{amsmath} ...
2
votes
2answers
123 views

Using environment argument in new macro definition

I'd like to be able to define an environment that takes a single argument and be able to use that argument to redefine an existing macro such that the argument of the environment gets used ...
6
votes
1answer
70 views

`advise` Environment in listings package

I was reading the documentation for the latex listings package and there are advises in it which look like so: I had a quick look in the source code for the documentation and it turns out that ...
8
votes
3answers
1k views

An environment for setting \emergencystretch locally

The following environment, copied from this website about dealing with overfull hboxes, allows one to change the \tolerance parameter for just the paragraph(s) it encloses: ...
14
votes
9answers
840 views

Looking for a more appropriate version of \cases

Often-times I find myself wanting to write something like, That is, a vertical brace followed by a table consisting of three columns, the first and the last are math, aligned where-ever I like, and ...
5
votes
1answer
4k views

How do I left and right justify text within an align environment

I want to simultaneously have text left and right justified around an align environment. I'm able to do this, but my solution seems like a dreadful hack. I really don't want to prepend every line ...
0
votes
1answer
88 views

Creating custom tabularx

I am trying to create a new environment in order to change the layout for tabularx, since the original is not looking like it should. I want the picture to be on the right side wrapped by the text. My ...
2
votes
2answers
862 views

Problem using \textblock with \newenvironment

I want to redefine the frame environment in beamer so that the contents are inside a box in the center of the frame, but when I try defining the new environment like: \newenvironment{hframe}[1] ...
5
votes
2answers
195 views

How to write an environment wrapping document environment

I'm working on wrapping up some patterns used in my research group for creating posters. Since we're using beamer and beamerposter to make these, all documents go essentially like this: ...
7
votes
2answers
2k views

Nested Environ's give “! Argument of … has an extra }” error

I tried using two Environ's in a nested fashion, but I get the ! Argument of \marray has an extra } error. Any idea why this happens? \documentclass{minimal} \usepackage{amsmath,environ} ...
6
votes
2answers
2k views

Redefine environment to be a synonym for another

I have a document with many description environments. I would like to change all these description environments to LaTeXdescription environments, without manually changing all the occurrences of ...
13
votes
2answers
5k views

Split-like environment inside cases environment

I'd like to have a cases environment with some cases that are too long to fit on one line. I tried this: \begin{cases} \begin{split} long expression \\ second line of long expression ...
7
votes
1answer
174 views

How to allow correct environment nesting when the environment definition involves labels?

The code below shows an improved version of the code provided in this answer to Mark (highlight) a paragraph (\item{...}) with a squiggly line for later attention. The environment tikzborder uses a ...
12
votes
1answer
1k views

Creating a new environment with referencing

I'm trying to create a referenceable "system" environment that basically displays an equation with a custom counter. Then I want to reference the environment with autoref, so as to have "System (S1)" ...
10
votes
1answer
108 views

Creating Command with environments

So I repeatedly use this format for embedding a picture and some text beside it, \begin{tabular}{l l} \begin{minipage}{0.3\textwidth} \includegraphics[SCALE]{NAME} \end{minipage} & ...
2
votes
1answer
343 views

Interrupt environment with command

At the moment I'm trying to figure out how I could interrupt an environment. What I did so far... \documentclass{article} \usepackage{amsmath} \newenvironment{envnew} { \begingroup \csname ...
8
votes
3answers
393 views

Indirectly defining two active characters within an \AtBeginDocument command

I'm trying to define a macro that uses two active characters inside an \AtBeginDocument command. I can write a macro such as the following using only one active character: \catcode`\_=13 \begingroup ...
2
votes
1answer
149 views

How to remove indents for the initial list but indent all nested lists?

I'm trying to use enumitem to modify my lists so that they're flush to the left side of the paper but so that any nested lists are properly indented. This is what I've tried: ...
3
votes
1answer
89 views

How to indent part of line to certain amount?

I apologize if this is a basic question, but I'm new to LaTeX and typography in general, and I'm not sure how to articulate my question properly. I have a document which looks like this: ...
3
votes
2answers
227 views

list environment to set different paragraphs within an item

I'm trying to create a document with exercies and solutions. Since exercises often come in different parts (such as (a), (b) and so on), I want to use lists for the solutions. However, solutions are ...
11
votes
1answer
365 views

New list environment: automatic enumeration with “a posteriori” format

This is a follow-up question to Nested enumerate labels with parent label appended plus a single set of enclosing parentheses First and foremost, sorry for my English, I'm learning it currently. ...
4
votes
1answer
284 views

more margin before block

I have the following: \documentclass{beamer} \usepackage{graphicx} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{xcolor} %\usepackage{colordef} ...
5
votes
3answers
2k views

Have verbatim code as an equation

I have a little snippet of program code / input that needs to be rendered with the exact layout as typed in (verbatim). Is it possible to have this as an equation? I tried to nest the Verbatim ...
3
votes
0answers
369 views

problem with mdframed commands [closed]

I was trying to highlight some text as shown in this post, but I'm having problems. the following works for me \documentclass{article} \usepackage{xcolor} \usepackage{mdframed} \usepackage{lipsum} ...
1
vote
1answer
132 views

Define preamble to a default

I have \begin{arab}[utf] ... some text \end{arab} throughout entire document. Is there any way to get rid of this reoccurring \begin \end command so to have my document look like this: ...
6
votes
2answers
98 views

How to produce white space for all text lines of an environment?

How can I produce whitespace before each line of an environment. If I have the following command in the preamble \newenvironment{myenv} ...
10
votes
3answers
680 views

Creating a new environment for multiple choice questions

I am trying to create a new environment for multiple choice test questions. I want to make sure that every question has a number and has a constant indentation: 1. Lorem ipsum dolor sit amet. ...
5
votes
2answers
161 views

\newenvironment creating an extra page

The following code produces: \documentclass[11pt,twoside,openany]{book} \usepackage{amsmath,amssymb} \usepackage{lipsum} \usepackage{multicol} ...
10
votes
1answer
1k views

What is the purpose of putting \newenvironment, \newcounter in a document class?

In exam.cls, I saw the following codes which I don't understand how do they function in the document class (exam): \newcounter{question} \newcounter{partno} \newcounter{subpart} ...
8
votes
2answers
115 views

Define a command so that it is only active within the document environment

I would like to configure a custom command so that it only affects the document environment. Because the command changes a number of catcodes, it has to be included after the begin{document} tag in ...
6
votes
1answer
168 views

Environment makes unnecessary page break

I have a problem with user-defined environments in LaTeX. Even though the content of an environment seems to fit, sometimes LaTeX makes an unneccessary page break after all. Here is my MWE: ...
6
votes
1answer
894 views

How to declare a new environment similar to abstract in a report?

Similar questions have been asked, but none have answered my particular problem. I am trying to declare in a report a new environment which would be similar to the abstract environment. I have looked ...
8
votes
1answer
210 views

How do I adjust the placement of descriptions I've made alongside enumerated statements within a boxed theorem environment?

Basically, what I'd like is to have an elegant command that would enable descriptions (commutativity, associativity, etc.) made alongside enumerated statements to be aligned to the far right side of ...
6
votes
1answer
230 views

A list of all the labelled sentences

I keep adding a class of sentences in different areas of my tex: \section{...} ... sentence1 ... \subsection{...} ... sentence2 ... \section{...} ... sentence3 ... I would like to make a add ...
4
votes
1answer
198 views

Defining a command to close and open environment

While preparing my lectures with beamer, I often find myself having to split a frame into two different ones. For instance, a first version of my slides contains: \begin{frame} ...
6
votes
2answers
3k views

Create a \lstnewenvironment that creates named listings

I am using the \lstnewenvironment to format a set of code listings in my document. \lstnewenvironment{code} {\lstset{language=haskell, basicstyle=\small\ttfamily, numbers=left, ...
7
votes
1answer
1k views

how to define commands within custom environment

I am working on a custom .cls for typesetting my CV. I am trying to create a custom environment to provide formatting for job/education history. I would like to specify it as follows: ...
3
votes
1answer
227 views

Modify example dropdown in memoir

In LyX, in book format memoir, the drop down has the Example format. Just wanted to know how do I change this Example format layout. Or where is the code to be changed. Edit: The example might be ...
5
votes
1answer
315 views

Suppressing remarks when not needed

I have written some remarks in some of my works that are somewhat informal and repetitive in nature (mainly for my own clarification). I was wondering if there is a way of suppressing them when I ...
1
vote
0answers
43 views

Hidden environment [duplicate]

Possible Duplicate: Suppressing remarks when not needed Is there a way that I can define a new environment in my manuscript which will only be typeset when a flag is activated? Otherwise ...
2
votes
1answer
859 views

Homework template

I've been using this homework template I found online that is pretty light. I am very new to using LaTeX, and although I find writing basic mathematical expressions easy, some of the cooler more ...
1
vote
1answer
181 views

Environments with matched parens in \begin and \end

Suppose I have this sort of expression in a document. \multicolumn{8}{l}{% \parbox{25em}{% \begin{itemize} \addtolength{\itemsep}{-1em} \item foo \item bar \end{itemize}% }} I'd like to define a ...
5
votes
2answers
358 views

Boolean based environments

I know that this question is basically identical to that of Hide custom environment content based on boolean Except I want to avoid using the environ package, which, otherwise, would be the best ...