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

3
votes
2answers
79 views

How to mimic Turing Machine description in Sipser textbook

Introduction to the Theory of Computation by Sipser is one of the standard textbooks on theory of computation. To describe a Turing machine (TM) in high level, this book uses a variant of enumeration ...
5
votes
1answer
80 views

Insert something “Before the end of document”

I insert the name and licence with the command \nameofcompany at the end of my document like this: \nameofcompany \end{document} Now, I want to generalize it to some documents, for that I found ...
2
votes
1answer
19 views

How to define customize frames in beamer with newenvironment

I would like to change text distribution within each frame in my presentation beamer, I tried to use \newenvironment but every time I get an error: File ended while scanning use of ...
4
votes
2answers
74 views

Is it posssible to embed list items `\item` in `NewEnviron` environments?

Question Is it possible to keep the \item commands in the body and wrap the itemize list environment with \NewEnviron from the environ package? I am also trying to wrap the list inside a TikZ node, ...
3
votes
1answer
45 views

Hide New Environment Numbering

The object of my question is learning how to remove the numbering that lies adjacent to a new environment after its been called while being able to reference the counter number later using \ref. I've ...
2
votes
1answer
51 views

Creating a Problem Environment

I'm trying to learn how to make new environments, namely I want to make a "problem environment" for examples of problems, and the algorithms that solve them. Optimally I would like it to use a ...
4
votes
1answer
18 views

How do I define an excludecomment environment in a for loop?

I'm using the forloop and comment packages to define environments prob1 through prob5 that exclude portions of my document. Here's a MWE: \documentclass[12pt]{article} \usepackage{comment} ...
0
votes
1answer
61 views

Is there a LaTeX package that contains an environment for excursions and digressions?

Is there a convenient LaTeX package that can be included in the preamble and allows to write more or less extended excursions/digressions by using commands like: \begin{excursion} extended ...
1
vote
1answer
37 views

Suppress paragraph indentation after tcblisting environment?

I am writing a document containing lost of snippets of code, and I've defined an environment using tcblisting from the tcolorbox package to do this. The environments work fine. What I want to do ...
2
votes
1answer
58 views

Suggestions for nested proofs

I would like to write down my lecture notes. The proofs of the theorems in this lecture are usually really big. It usually looks like this: Theorem 1: Here comes the statement of the Theorem ...
0
votes
0answers
17 views

custom lstlisting environment [duplicate]

I'm using the listing package for displaying source code in my document. I want to use the minipage environment to avoid page breaks within the listing, but I don't want to write, at every listing, ...
6
votes
1answer
129 views

Is there a bracket missing in teubner.sty? [closed]

When TeXifying files where I use teubner.sty, LaTeX complains Runaway argument? {\setcounter {verso}{##1}\def \writ@verso {\count 255=\value {verso}\divide \ETC . ! File ended while scanning use of ...
1
vote
1answer
45 views

Abridging \begin{} … \end{}

Is it possible to abbreviate the cumbersome commands \begin{}...\end{} once and for all? I mean, except for \begin{document} ... \end{document}, I would like to have the environments such as ...
5
votes
3answers
96 views

Custom environment with minipage and align*

I would like to have an environment that puts two equations side by side. The following works but Is there a way to make this a dedicated newenvironment? \documentclass[10pt]{article} ...
2
votes
1answer
37 views

environment within environment within command

So.... I'm trying to create (what I assume) is to be a simple command that tries to do some nice formatting. Here is what I have. \usepackage{enumitem} \newenvironment{question}{\bf}{\normalfont} ...
0
votes
0answers
9 views

TEXwork - how to set “handle” by defaultly instead of magnifying glass?

I'd like to change the settings of the pdf viewer so that it starts with "handle" instead of magnifying glass. How can I do it?
0
votes
1answer
22 views

How do I make claim environment bold?

I have defined my claim environment in the following way: \newcounter{claimcounter} \newenvironment{claim}{\stepcounter{claimcounter}{Claim \theclaimcounter:}}{} It looks like this: Claim 1 ...
2
votes
1answer
29 views

Have paragraphs with spacing between them inside “flushleft”

In my LaTeX document, I'd like to have two paragraphs which are separated by some smaller vertical spacing. When I use the following code, this works just as intended, automatically: ...
2
votes
1answer
32 views

New environment definition problem with tcblisting

I have the following code for a new environment definition: \newenvironment{VList} { \makeatletter \begin{tcblisting} \bgroup enhanced,oversize,lower separated=false, ...
2
votes
1answer
80 views

Multiple Altconditions within LaTeX Document

The question refers to this solution and trying to modify the code to support multiple altconditions in my document. The problem is to allow two sets of alternative conditions within the same ...
2
votes
0answers
26 views

Use dollar sign in verbatim environment within auctex

I am using something similar to the following, \documentclass{article} \usepackage{listings} \lstnewenvironment{shellsession}[1][] {\lstset{language=bash basicstyle=\small\ttfamily, ...
3
votes
2answers
55 views

Paragraph Indent Together With Hanging Paragraphs :: Combining Commands

I think this is more an issue of my not understand Tex's syntax than anything else. I want to format my paragraphs as shown below. There seems to be a way of combining the three commands I'm using ...
0
votes
1answer
58 views

Reset a renewcommand

I have found a Resumé template in Latex. I would like to change the following part of the template but my knowledge of Latex is not that extended. % Every \item can be followed by one or more ...
1
vote
1answer
34 views

Multiple bibliographies in one document showing different fields

I'm using biblatex (backend biber) to generate the bibliography in my PDF. In particular, I have two bibliographies, one regular numeric and one with a dedicated bib environment. Now I would like to ...
23
votes
4answers
916 views

Most useful/important (La)TeX commands/environments

A friend of mine asked me why I use LaTeX instead of Word/OpenOffice etc. (no, this is not going to be a question like 'Word vs. LaTeX') I showed him some of the showcases here on TeX.SX, some of my ...
5
votes
1answer
56 views

Generate automatically a list of definitions (user-defined theorem environment) in appendix

In the following code, I define a theorem environment definition and write a figure and a definition: \documentclass[12pt]{book} \usepackage[francais, english]{babel} \usepackage{amsthm} ...
5
votes
1answer
31 views

Package array error: Illegal pream-token (\ifthenelse)

This table environment mymulticolumn has three arguments, the first of which sets an optional \arraystretch, the second of which sets the "apparent" number of columns (either 2 or 3), and the last of ...
1
vote
1answer
41 views

Mysterious horizontal space in newenvironment

The following code defines an environment that offsets text vertically (5pt above and below) and horizontally (2em from the left). When compared to a simple \hspace{2em}, however, you can see that the ...
2
votes
1answer
38 views

Duplicate and modify section hierarchy

In a large thesis style document being prepared, there are certain parts (latex hierarchy \part{}) that are being treated as insertions of previously prepared work. This may include articles or ...
3
votes
2answers
69 views

“Runaway argument?” error with \NewEnviron

I have two files. Basically, the main file just loads the environ package and inputs the secondary file. The secondary file creates an environment that basically does nothing, and creates one instance ...
2
votes
2answers
82 views

using \def for my own \newenvironment

I am trying to write a command that shortens for a command for writing proof. At the moment, I used to use \newenvironment{proof}% {\textbf{Proof:}}% {\begin{flushright} $\blacksquare$ ...
1
vote
3answers
82 views

Environment suggestion appreciated

I'm trying to achieve construction like this: however I've been pretty unsuccesfull achieving that so far. I think I tried all the wrong environments for that - added that as math function lead ...
3
votes
2answers
57 views

Changed Macro definition reverts to original

I have two commands \testone and \testtwo. \testtwo appears only if there was a relevant \testone before and takes the same arguments. Hence I want \testone to store its arguments in \@repeat@me where ...
3
votes
1answer
28 views

Use Variable as optional input in enumerate

Can anyone tell me how to fix the following problem: The following code produces the error Package enumitem Error: topsep=0em,partopsep=0em undefined \documentclass[11pt]{amsart} ...
2
votes
2answers
45 views

Custom environment for second-level items not vertically aligning properly

While writing a document with lots of enumerate environments, I wanted to add a little subset, 1. So the item is here — and the inset is here Which I did pretty easily. However, when I ...
4
votes
3answers
56 views

Make use of makebox in custom environment

I am working on a custom environment, that might get larger as \textwidth (so \centering won't work), but should nevertheless be centered. I'm currently manually wrapping it with \makebox but would ...
3
votes
1answer
54 views

Additional horizontal space when the last line of an environment is full

I have created an environment env which just adds a \medskip and some text (say "Blablabla") after the text inside \begin{env} ... \end{env}. The problem is that if the last line is full, then I get ...
0
votes
0answers
13 views

Modify proof environment: new line before qed square [duplicate]

I would like to put the QED square at the end of proof on its own line. How can i do that? The qed square should be right aligned and below the last line of the proof.
1
vote
1answer
67 views

framed environment with fixed image in marginpar

I would like to get the exact output below in the LaTeX. But unable to fix it and how to set image in the marginpar for each example environment. My MWE is: \documentclass{book} ...
2
votes
1answer
55 views

error with @ifnextchar and paralist after texlive 2014 update

I've been using a save/restore TeXnique with let/def to redefine the \@enumerate@ command from the paralist package so that the enumerate environment can accept a second optional parameter (a name of ...
2
votes
1answer
63 views

Put one part of sentence outside $ math environment

I want the 'assume' written in normal style. So not within the math environment so it becomes italic. This is my code \documentclass{article} \usepackage{amsmath} \begin{document} ...
1
vote
1answer
51 views

Redefine obeyspaces to newline

I want to typeset code snippets from different programming languages. I couldn't get listings to do what I want (one complete height of an empty line takes up too much space for my liking) and neither ...
18
votes
2answers
882 views

Kleinberg-Tardos style of book writing

I recently read a book Algorithm Design by Jon Kleinberg and Eva Tardos, which is written in a very unique style. This book doesn't have any typical LaTeX environments such as theorem, lemma, and ...
2
votes
1answer
45 views

Beamer: splitting environment across \newenvironment

I would like to define a new environment in Beamer that creates a frame containing only an itemize (and maybe some other stuff once I this basic case to work). The following ...
1
vote
1answer
22 views

Adding a new crossref type for a user-defined environment

In short, I'm trying to define an environment comment which has its own crossref type and counter. I want to be able to refer to these comment environments later. Looks like cleveref does what I ...
0
votes
0answers
26 views

Show Answer Key with letter alternatives at the end of document

I have a document in which between some explanation texts I insert some numbered questions (it's a book, actually). Here's the basic of the code I have now: \documentclass[10pt,a4paper,oneside]{book} ...
0
votes
0answers
37 views

justifying and scriptsize for all beamer slides

Following the answer here, I'm looking for a way to justify and set the scriptsize font for all beamer slides inside frame environment, I tried: \setbeamertemplate{frame}{/scriptsize/justifying} ...
7
votes
1answer
184 views

Fancy example environment

How do create a colourful example environment like the one here?
5
votes
1answer
318 views

A command to end any environment?

Wouldn't it be nice if we have a command to end an environment in a generic way? Example: \begin{itemize} \item Apple \item Banana \endenv % replaces / is an alternative to, \end{itemize} ...
9
votes
3answers
236 views

How To Make a Special Position Environment in LaTeX?

So I must admit I am way out of my depth and have no idea what I'm doing. I apologize in advance for a long and complicated question. I'm trying to build this output: Which I have successfully ...