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)

6
votes
2answers
91 views

Redefining an environment or a command with an indefinite numbers of items

According to LaTeX's basic commands if I want to create a list of items I have to use the following concept code: \begin{itemize} \item first \item second \item third \end{itemize} To keep my ...
7
votes
1answer
534 views

Adding something automatically to every paragraph in an environment

I'd like to know if it's possible to have something added automatically to any paragraph in a given environment. I use LaTeX mostly for doing fill-in-the-blank worksheets at the school where I work. ...
5
votes
1answer
230 views

Changing the font for a custom environment

I can't figure out how to embed a command like \textbf or something in a newly created environment, I have: \newenvironment{definition} {\begin{quote}} {\end{quote}} I want to customize my ...
4
votes
1answer
567 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} ...
3
votes
2answers
148 views

Is it possible to know and use the number of items of one list?

The following code gives one way to use circled numbers in one list. For the moment this solution uses one parameter given by the user which is the "width" of the total number of items of the list. % ...
4
votes
2answers
269 views

Good way to show a UNIX path, including a variable component?

I'm writing a document for some data analysis code that I produced, and I need to state where the resulting data is stored. The data is written to a directory with a particular name (reducedData) ...
7
votes
2answers
187 views

Is gather* equivalent to displaymath?

Is gather* with one line of math equivalent to displaymath?
7
votes
3answers
718 views

Changing the catcode of _ in one command?

In the following code, I would like _ to be a simple letter. How can I achieve this ? % Source : http://forum.mathematex.net/latex-f6/forcer-le-retour-a-la-ligne-dans-texttt-t13246.html#p127511 ...
1
vote
1answer
406 views

How to create a new counter for an a new environment that is in sync with subsections

I want to create an example environment with a counter which will be in sync with my subsections. So I'll have: subsection 3.2 lemma 3.2 example 3.2 example 3.3 lemma 3.3 subsection ...
66
votes
3answers
29k views

What's the difference between the environments quote and quotation?

On meta, I've found the disscussion {quotation} and {quote}, but it doesn't answer my question. When should I use the environment quote? When quotation?
4
votes
1answer
126 views

How can I call “child” environments inside one “master” environment?

In the following code, I have two wonderfull environments given by Gonzalo Medina. % Sources % 1) ...
8
votes
3answers
225 views

How to use named variables with one environment

Just after there is one code which has been proposed to me in this site. Instead of using \begin{MyFrame}[1.5cm][2pt][1.3cm][blue][2][8ex], I would like to use something more friendly like ...
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
98 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
357 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
465 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
302 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
964 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
529 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
870 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
295 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
725 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
6k 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
2k 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
2k 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
402 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
321 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
496 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
251 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
417 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
241 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
316 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
391 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
385 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
9k 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
164 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 ...