{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
117 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: ...
8
votes
3answers
257 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 ...
3
votes
1answer
79 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
162 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
261 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. ...
2
votes
2answers
626 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] ...
3
votes
0answers
283 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} ...
6
votes
2answers
91 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} ...
6
votes
4answers
823 views

What is the shortcut for triggering environments in LyX 2.0.4 without having to use the mouse?

I have LyX 2.0.4 installed on Mac OS X Mountain Lion. In earlier versions, there was a shortcut to trigger environment without touching the mouse - allowing a more efficient write flow. I wonder if ...
5
votes
2answers
130 views

\newenvironment creating an extra page

The following code produces: \documentclass[11pt,twoside,openany]{book} \usepackage{amsmath,amssymb} \usepackage{lipsum} \usepackage{multicol} ...
4
votes
1answer
245 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} ...
10
votes
3answers
524 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. ...
7
votes
2answers
274 views

How can I define a custom listing environment?

I am trying to define an enviroment for a specific programming language, F#. Here's my code: \definecolor{bluekeywords}{rgb}{0.13,0.13,1} \definecolor{greencomments}{rgb}{0,0.5,0} ...
8
votes
2answers
97 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 ...
10
votes
1answer
735 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
601 views

Using an environ environment with \newenvironment

I want to use an environment defined with NewEnviron from environ in another environment definition: \documentclass{article} \usepackage{environ} \NewEnviron{inner}[1]{% \textbf{#1:} \BODY } ...
6
votes
1answer
439 views

Create environment within my own latex class?

How can I automate multiple choice question type in my own class in LaTeX?
6
votes
1answer
137 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: ...
5
votes
1answer
348 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
3answers
657 views

How to make an environment star Exercise?

I want to create an environment star Exercise, but I can not. Please help me. \documentclass{book} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsmath} ...
8
votes
1answer
165 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
180 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 ...
7
votes
1answer
150 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 ...
5
votes
1answer
521 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: ...
1
vote
0answers
40 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 ...
3
votes
1answer
164 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 ...
2
votes
1answer
548 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 ...
4
votes
1answer
169 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} ...
1
vote
1answer
140 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
244 views

Using align within savebox?

I have a custom environment called 'quiz' which puts its input into a savebox and then uses it later depending on a package option. The code works fine, unless I use an align* environment in which ...
1
vote
1answer
55 views

Show code similar to documentation of packages

I saw that several documentation packages use the environment to show macrocode long codes with page break, the example implementation of the package geometry. How do I do this? I wanted to show a ...
5
votes
1answer
72 views

inner-column labeled matrix

I am slowly becoming more efficient with math environments and macros in TeX, but occasionally come across something where I'm not really sure what the best solution would be. I wanted to hear from ...
1
vote
1answer
69 views

A flag to switch between simple and full mode [duplicate]

Possible Duplicate: How to write hidden notes in a LaTeX file? Conditional typesetting / build Is it possible to add a flag (variable) in my .tex file, so that I can switch among two ...
14
votes
2answers
362 views

Is it possible to make an image gallery with tikz images?

I create many images with TikZ and I would like to make an image gallery. It should look like this: The gallery should put the image in front of a (gray) background resize the image to a maximum ...
5
votes
2answers
403 views

How can I change the whitespace above and below center?

Is it possible to control the space above and below center, e.g. the way it can be controlled above and below math display? In other words, is there an equivalent to, say, ...
3
votes
1answer
97 views

A command/environment for “spot the error” type of multiple choice tests

I wonder if there is already a package that makes me create a spot the error kind of test like the one below: This must preferably be in an enumerate environment. I tried a tikz approach but I ...
4
votes
3answers
117 views

Own environment with own label

I want to have an environment for strategies. So far I used the package ntheorem to define such an environment. I use it like this: \begin{strategy}[bla] bla bla \end{strategy} And get: ...
10
votes
1answer
161 views

Inserting document compiled from LaTex code inside a .tex file

Is there a way to insert a document within a document? The inserted code is fully .tex compliant and could be compiled as a document on its own. I envision an article document, where inside the ...
5
votes
2answers
274 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 ...
4
votes
1answer
110 views

An environment with custom justification

I would like to create an environment called "question" with one argument (being the question number) with a certain alignment/justification. How might I define one so that it comes out like how it ...
2
votes
1answer
319 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 ...
2
votes
0answers
23 views

How can I create a wrapper environment for a complicated usage of tabularx? [duplicate]

Possible Duplicate: tabularx inside a \newenvironment I know (at least basically) how to create my own environments using \newenvironment, but I recently encountered a problem trying to ...
3
votes
1answer
181 views

passing text to alltt embeded in command (extra newline needed)

I wanted to close alltt inside a command (to add some ornaments around the text), but the spaces that were used for putting the monospaced text into columns was not preserved. I found the solution ...
7
votes
3answers
166 views

How to change color in an environment?

I have an environment defined as follows: \usepackage{framed} \usepackage{listings} \usepackage{color} \usepackage{tikz} \usetikzlibrary{shapes.arrows} \usetikzlibrary{backgrounds} ...
5
votes
1answer
95 views

Preferred way of creating problem and solution environments

I know we can create problem-solution pairs using the exercise package but I am looking for something that is much simpler and similar to theorem and proof environments. I have solved this problem in ...
11
votes
2answers
2k views

Difference between \begin{theorem}…\end{theorem} and {\theorem …}

I see that both attempts to display a theorem in the following code generates similar output. \documentclass{article} \usepackage{amsthm} \newtheorem{theorem}{Theorem} \begin{document} ...
3
votes
1answer
145 views

Defining macros based on environment

Right now, I have two macros, \intersects and \union, that simply point back to \cap and \cup respectively. Unfortunately, to have nice typesetting in display-like environments, I need to use \bigcap ...
8
votes
1answer
2k views

Usage of \hskip \labelsep while creating an environment with trivlist

I am trying to learn how to create a theorem like environment from http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/Theorems.html To keep the code below simple, I am not really defining a new ...
5
votes
1answer
221 views

Savebox with \bgroup/\egroup doesn't work in beamer (for environment)

This works: \documentclass{article} \newsavebox{\mybox} \begin{document} \savebox{\mybox}\bgroup This is a test.\egroup\usebox{\mybox} \end{document} But this fails (Missing } inserted. at the ...
2
votes
1answer
145 views

Strange chapter influence on quotation environment

The code below give a strange result when I comment out the \begingroup end \endgroup: the quotation environment has different vertical space to the text before ("Some text"). What is it that chapter ...