{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
146 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} ...
1
vote
1answer
49 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 ...
2
votes
1answer
42 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} ...
30
votes
4answers
2k 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 ...
8
votes
1answer
11k views

Can I disable italics in the body text of a theorem without amsthm/ntheorem?

I'm submitting a paper and am required to use a provided document class which defines its own theorem environments, so I can't use packages like amsthm or ntheorem. The class doesn't define a ...
0
votes
0answers
10 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?
16
votes
2answers
699 views

How to turn off an environment (e.g. tikzpicture) for faster draft compiling

I'm currently writing my thesis and have been looking for ways to speed up compile time. I can shave off a lot of time by using draft mode so that images aren't processed, but I have several TikZ ...
0
votes
1answer
29 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
34 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
63 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
98 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 ...
3
votes
2answers
128 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 ...
2
votes
0answers
105 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, ...
1
vote
1answer
68 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 ...
13
votes
5answers
1k views

Use column-separator & (ampersand) inside \newenvironment

I'd like to define a grammar environment which basically wraps a tabular environment. Inside the grammar environment I'd like to use an environment called production to insert rows. Example: ...
5
votes
1answer
90 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
146 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
74 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 ...
3
votes
2answers
148 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 ...
12
votes
4answers
8k views

How do I generate a check-list?

Similar to the itemize or description environments I would like to have a check-list environment, with neat boxes on the right side, that I may check or uncheck. I guess I'm not the first having this ...
2
votes
2answers
93 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
106 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
65 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
53 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
54 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
83 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 ...
6
votes
4answers
285 views

Quote Environment à la Strunk’s ‘The Elements of Style’

How can I have a an environment similar to Strunk's The Elements of Style:
2
votes
2answers
159 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} ...
2
votes
1answer
72 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} ...
22
votes
3answers
9k views

Quote environment with reference at the end right

I want to define a quote environment such that after the quote on the right occurs the author with page number. My solution is yet the redefinition of the quote environment \usepackage{amsthm} % ...
3
votes
1answer
56 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 ...
18
votes
2answers
940 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 ...
1
vote
1answer
183 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} ...
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.
2
votes
1answer
81 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 ...
1
vote
1answer
83 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 ...
10
votes
2answers
621 views

Environment to allow line breaks at “,” in math mode

I find the question and accepted answer to Allowing line break at , in inline math mode? very useful, BUT I would like to make an environment (e.g. "allowbreaks") out of it. The problem is that I'm ...
2
votes
1answer
54 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
42 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
67 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
73 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} ...
1
vote
1answer
233 views

How to make an environment same as itembox environment in ascmac package by using mdframed package

I want to make the output same as what I can make from the code shown below. But for some reasons (e.g. some frames extend to multiple pages etc.), I do not want to use ascmac package but mdframed ...
6
votes
3answers
250 views

How to make more than two fancy gradient stripes in tcolorbox?

I use the following fancy tcolorbox definition: \newtcolorbox{mybox}{colframe=black!80,colback=black!10,sharpish corners, skin=bicolor,interior style={left color=black!5,right ...
7
votes
1answer
277 views

Fancy example environment

How do create a colourful example environment like the one here?
6
votes
1answer
385 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
253 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 ...
9
votes
4answers
1k views

How to use a \write command inside a \newenvironment ?

I'd like to make a new environment which would store its content in a file, so that I can read that file at another part of the document. More specifically, I want to have an environment {proof} such ...
2
votes
0answers
36 views

Two columns in alltt environment

How do I make two columns in an alltt environment?? \begin{alltt} \hlkwd{options}\hlstd{(}\hlkwc{BingMapsKey} \hlstd{=} \hlstr{"clave de acceso de Bing"}\hlstd{)} \hlcom{## código para Bing} ...
1
vote
1answer
2k views

TeXstudio: How to add custom highlighting for custom environment?

Until there is a cwl file for the paralist package, I would like to just include the compactenum environment into the custom highlighting list in the TeXstudio Options. I tried adding compactenum in ...
4
votes
0answers
88 views

How to make a text environment [duplicate]

How can make an environment in which I can write my text and in output, I see it indented with a coloured vertical line? I want the code be like the following: \begin{textbox}[orange][1cm] % [colour ...