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

4
votes
3answers
968 views

Add a phrase to an existing algorithmic command/environment

I would like to add a new command to an existing environment. The \renewenvironment command does not help a lot since I need to copy and paste the entire environment definition. For an example I ...
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 ...
6
votes
2answers
828 views

Equation environment definition

Where is the full definition of the equation environment? I cannot find it in the .cls files. Is this in latex.ltx? Or something?
7
votes
1answer
503 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. ...
3
votes
2answers
144 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
255 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
3answers
687 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
384 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 ...
4
votes
1answer
123 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 ...
4
votes
1answer
2k views

How to highlight paragraph (linebreak preserving) as well as itemize, tabular etc.?

I want to highlight changes which are introduced by myself in the pdf document. So far the soul package is very neat but it does throw errors when I want to highlight not only paragraphs but also some ...
5
votes
1answer
94 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] ...
9
votes
3answers
418 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
2answers
135 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} ...
20
votes
2answers
7k 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
285 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: ...
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 ...
1
vote
1answer
892 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 ...
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 ...
8
votes
1answer
487 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 ...
0
votes
2answers
309 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: ...
4
votes
1answer
826 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
1answer
695 views

Framebox and minipage causes white space and is not float

I have a \framebox (I don't insist on using this command) and a minipage that causes whitespace, because the drawn box is not allowing any text before or after and it itself does not break over pages. ...
1
vote
1answer
411 views

Listings: new environments with arguments

I have this basic question. How can use arguments with listings? I tried this and it doesn't work: \lstnewenvironment{cor}[2][] {\linerange{#1-#2},\lstset{language=[Sharp]C,,basicstyle=\scriptsize, ...
2
votes
2answers
286 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 ...
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 ...
5
votes
4answers
684 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}% }{% ...
5
votes
1answer
614 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 ...
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 ...
5
votes
2answers
994 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 ...
6
votes
2answers
700 views

Insert a paragraph into a list that uses the whole text width

I want to insert a paragraph or possibly even a box with a background color into a list that uses the whole \textwidth. Something like this: 1st item a subitem 1 b subitem 2 2nd item a ...
1
vote
1answer
391 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 ...
2
votes
2answers
293 views

Custom list of environments (per section)

I'd like to have a list of my custom environments at the start of each section. I read this post, but wasn't able to get the titletoc to help me. The given response worked for floats, but I couldn't ...
4
votes
2answers
2k views

Beamer: Emphasize a part of a slide

I am using Beamer to create presentations. I know that it is possible to use environments like Theorem, Definition and so on: \begin{Teorem} Great theorem \end{Theorem} It appears in the box of ...
23
votes
2answers
3k views

Label and caption without float

I’d like to have an environment that works much like a float, except that it doesn’t float. That is, in fact, I’d like to be able to define an environment that has a label and a caption. I ...
9
votes
3answers
247 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 ...
2
votes
1answer
407 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 ...
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
482 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 ...
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} ...
4
votes
3answers
238 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 ...
8
votes
3answers
371 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) ...
7
votes
2answers
582 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} ...
1
vote
1answer
298 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
374 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} ...
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] ...
5
votes
1answer
4k views

Removing extra vertical space in \maketitle with titling package

Consider the following two LaTeX source files: First, manually producing a title using a new environment (eww): \documentclass[a4paper,10pt]{article} \parindent0cm% ...