Tagged Questions

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

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 ...
5
votes
1answer
96 views

Environment for different kinds of lists

I would like to have one environment so as to display numbered list or bullet/plus list. Here is a pseudo code. \begin{myList}[1)] \item Text... \item Text... \begin{myList}[bullet] ...
17
votes
2answers
353 views

Why do I have to put the center environment in a group for \@afterindentfalse\@afterheading to suppress indentation?

Consider the following two macros, the only difference being that one has the environment inside a group: \documentclass{article} \makeatletter \newcommand\thisworks{% {\begin{center} $\ast$ ...
10
votes
3answers
454 views

Masking \end{lstlisting}

I am not sure if I am using the right wording in title. Basically what I need is to add the following source using the listing package. In preamble: \usepackage{listings} then and is here when I ...
2
votes
1answer
295 views

Insert text before end of page, and at the begining of the next page

I'm putting a template together and I have created a custom command which I'm going to use to set specific margins on the text passed to its argument and a few more formatting things, like this: ...
2
votes
2answers
140 views

Cross-referencing to the number of a customized environment with a counter

On the internet I found a possibility to create an example environment that is helpful for linguistic research papers, because it provides all examples with numbers: \newcounter{exa} ...
7
votes
2answers
2k views

Unable to create multiple timelines using chronology.sty

I wanted to create a document that contains multiple timelines on one page. I am using chronology.sty, which uses TikZ, to accomplish this. However, I get an error when I try to create more than one ...
3
votes
3answers
1k views

Problem with nesting environments

I have a problem with nesting environments. I have created a MWE for this. I have environment {env1} which I want to contain environments {env2} and {env3} in the following way. What's wrong with the ...
24
votes
4answers
1k views

Do all starred commands have anything in common?

\section* produces an unnumbered section, align* makes the environment unnumbered, which is comparable in a way. \newcommand* doesn't accept \par in its argument, which is different. Stefan Kottwitz ...
1
vote
1answer
948 views

Automatic indentation/framing of nested theorems/proofs

I'm a fan of python, and in the sadly common case where one creates new theorems, definitions, etc within the actual proofs of other theorems, I would like the "inner theorems" to be indented. To ...
8
votes
1answer
518 views

Annoyance in emacs LaTeX mode involved with syntax highlighting

I'm using the following command in a LaTeX file to explicitly call a style file: \bibliographystyle{$BSTINPUTS/IEEEtran} Unfortunately emacs detects this as me entering math mode, but the latex ...
4
votes
1answer
862 views

\newenvironment fails with special listings environment

I want to use the showexpl, but define a new environment with predefined settings. But all I get is an emergency stop. \documentclass{scrbook} \RequirePackage{showexpl} ...
1
vote
0answers
194 views

Externalized figures newenvironment [duplicate]

Possible Duplicate: Problem with environment expansion and the Tikz external library. I want to externalize some of the TikZ figures of my document. To do so I am using the ...
2
votes
2answers
293 views

expanding variable inside picture environment

(this version of this question is highly edited based on suggestions) I thought to quickly create a fax cover sheet last night and, quickly creating one, I ran into a problem I can't figure out so I ...
5
votes
4answers
716 views

Environment definition separates matching braces

Suppose I want to define an environment which is essentially a modification of an existing one. I tried something like that: \newenvironment{newenv}{% \formatcommand{\begin{oldenv}% }{% ...
22
votes
2answers
5k views

How to modify spacing around quotation environment?

I am almost there in my quest to reproduce the rather compact layout of the book I'm translating... one thing to go, though: I successfully used the enumitem package to modify the vertical and ...
1
vote
3answers
1k views

Vertical space before horizontal line

I have defined an exercise environment which ends with a horizontal rule. I want to have some vertical space between the end of the environment text and the rule. When I try to insert that, the ...
5
votes
2answers
1k views

Environment with first paragraph in bold and no pagebreaks

I would like to setup a new environment which typesets the first paragraph in boldface, the following paragraphs in normal text, and with (possibly) no pagebreaks between the first paragraph and the ...
3
votes
1answer
1k views

LaTeX example environment

I was inspired by the following LaTeX document: http://www.people.fas.harvard.edu/~djmorin/chap11.pdf (written by Prof. David Morin from Harvard university) I would like to produce a similar example ...
1
vote
1answer
399 views

minipage breaking, or some other route to layout

I'm trying to make a resume with a 2 column layout, where I'll have something like [SECTION NAME] * space * [DETAILS] For example: Work experience[spaaaaaaaaaaaaaace]Some location, 2 years, etc ...
8
votes
6answers
1k views

How to split an example into two parts?

I am trying to have an example (using the theorem environent in amsmath) split in two parts: Example 1 ... Some more discussion Example 1 (continued) ... What is the best way to do this ? The ...
0
votes
2answers
316 views

Environment with customizable number of table columns

I want to make macros for drawing group of questions with same answers with customizable text, number of answers and design (column widths, alignment, etc.), like this: ...
3
votes
4answers
127 views

Through enumeration

I would like to have problems be consecutively numbered throughout a book, irrespective of the chapters and sections where they appear. E.g. Chapter 1 [Text] 1. Some problem Section 1 2. Some ...
4
votes
3answers
492 views

Problem Set template - explain this preamble to me?

Can someone explain the following preamble to me? This is copied and pasted from a problem set template my T.A. made to help us typeset our homework... I'd really like to understand how it works. The ...
9
votes
3answers
250 views

Remember position of equal sign from one align environment to the next

As you know, the align-environment puts all positions marked with & (normally the equals sign) exactly beneath each other. I now want to save the position LaTeX calculates for & and use it ...
4
votes
2answers
2k views

\bgroup and \egroup?

So I've been looking to expand on the following bit of code (a hack to not screw up the margins when using oversized figures): \noindent\makebox[\textwidth]{% \begin{tabularx}{1.5\textwidth}{XX} ...
17
votes
3answers
1k views

Formatting FAQ lists in LaTeX

I want to format a list of "Question + Answer" pairs in a TeX-document. In HTML I use the <dl> command: http://www.w3.org/TR/html401/struct/lists.html, e.g.: <dl> ...
2
votes
1answer
412 views

Renew section command to wrap whole section in an environment

I am trying to write a beamer template for pandoc. For that I need to convert \section{Text 1} Some text. to \begin{frame}[fragile]{Text 1} Some text. \end{frame} Is there a way to do this ...
4
votes
3answers
240 views

Why does a defined command appear differently in the align environment?

In the LaTeX document shown below, my definition \comp does not show correctly in the align environment. Why it is this the case? ========== Begin LaTeX scripts ============= ...
5
votes
1answer
2k views

Extra intervals before and after flushright environment

I am preparing questionnaire template in LaTeX. I have the following code (simplified): \documentclass{article} \begin{document} \framebox{\parbox{4cm}{ \textbf{3. How often do you have a ...
1
vote
1answer
307 views

Defining the caption of newtheorem with a command

In the example below you can see that both environments get the same caption. How to prevent this? You will get the same result if you use an other package like amsthm, theorem or thmtools. ...
1
vote
1answer
384 views

Why does pdfLaTeX fail when I try to use `begin{lstlisting}` inside a user-defined environment?

I'm having trouble with the listings package. I can't compile the following minimal example through pdfLaTeX: \documentclass[a4paper, 11pt, twoside, openright, english]{memoir} \usepackage{listings} ...
8
votes
3answers
383 views

How can I indent all text after the label in my example environment

I have built my own example environment for a paper I am working on. I have created a counter to label the resulting blocks of text. Now I want to indent the Text after the label, like so: (1) ...
20
votes
2answers
8k views

What does the titlepage environment do and what are its benefits?

I'm speaking about the article document class only, because report and book deal with titles in a different way. Obviously, the titlepage environment triggers a new page after it, and it resets the ...
2
votes
1answer
101 views

Package with an environment-based sectioning mechanism?

Is there any package for LaTeX that performs sectioning using environments, where doing something like \begin{section}[Section Title] \begin{section}[Subsection Title] ...
0
votes
1answer
2k views

Problems with captions in the environment wrapfigure

I'm dealing with a rather weird issue. Using the enviroment \wrapfigure, I receive an error message undefined control sequence \float@caption ... oxrestore ... \normalize @fs@capt ... let alone ...
5
votes
1answer
162 views

Testing for a blank line (“paragraph”) immediately after \begin{document}

(With this question, I hope to resolve an edge case relevant for my quoting package.) Suppose I define a customized environment for displayed text. It resembles the standard LaTeX environment quote ...
8
votes
2answers
2k views

What are alternatives to block?

I use \begin{block} ... \end{block} to describe formalization of some notions, and I want to write some examples under it. I still would like to stick to the structure of a block (one part for title ...
1
vote
1answer
276 views

Hyperref with answers [ntheorem]

I read Hyperlink with answers and have tried to apply the technique to my environments that I have defined using the ntheorem package. In the MWE below the answer links correctly go to the questions, ...
7
votes
2answers
592 views

Own command to create new environment

The following code isn't very minimal but I hope you will be able to understand the code. \setcounter{errorcontextlines}{999} \documentclass{scrartcl} \usepackage{lipsum,ntheorem} ...
5
votes
1answer
403 views

How to use macros with parameters inside a \newenvironment?

I would like to define a new environment that changes the section titles via \titleformat. Obviously I have to "escape" the #1 somehow, so it is not considered to be an (undeclared) parameter to ...
18
votes
5answers
30k views

Beamer block environment without title

Is it possible to create a customised beamer block environment that only has a body and not a title? For example, I wish to typeset the following quote within a coloured block so that it stands out ...
19
votes
4answers
806 views

Is there a reason to use \begin{environment} \end{environment} rather than \environment \endenvironment?

What reason (other than perhaps being easier for my syntax highlighter to parse) is there to write \begin{center} Here is centered text \end{center} rather than: \center Here is centered text ...
4
votes
1answer
193 views

converting documentclasses into environments: is it possible?

Rewritten question. For my phd-project i need to quote screenplays. I would like to keep the screenplay layout in my thesis. I know there is the document class called screenplay. Now i am wandering ...
5
votes
3answers
879 views

Change line spacing for normal text, but not in tabular or verse

\usepackage{setspace} \doublespacing I used above two lines to change the spacing in my document. This changes the spacing of the entire document. My requirement is to change the line spacing in ...
4
votes
1answer
554 views

stack.sty and \end{environment}

I'm writing a multilevel itemize list environment to simplify the process of putting nested lists in Beamer slides, and I want it to support enumerate lists as well. The mitemize environment is ...
5
votes
1answer
633 views

How to expand several arguments in an environment?

I have an environment that I've defined as follows: \newenvironment{regularEnumerateEx}[2][0em] {begin{listSkeleton}[#1]{enumerate}{#2}} {\end{listSkeleton}} The problem is that I need to ...
5
votes
1answer
237 views

Environment definitions with arguments in \enddef

I was hoping to create a custom proof environment where along with the qed symbol it also mentions what was the claim that was proved. I thought the following would work: \newenvironment{myproof}[1]% ...
8
votes
1answer
932 views

The abstract environment changes the \linewidth for the whole document

In the article class, it seems that using the abstract environment has an effect to the rest of the document. More precisely, it seems that it redefines the \linewidth, which equals \textwidth without ...
9
votes
2answers
1k views

How to include tabularx/y in a new environment?

I am looking for a way to define a customizable environment for tables in my latex documents. This means: caption and label width of table customized column format (tabular preamble) While this ...