{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
2answers
193 views

New environment, orphan line

I created three environments for my document: a booklet for a treasure hunt with scrreprt. I created 3 environments (the document is in french): enigma: ...
5
votes
2answers
75 views

Display enviroment differently for one use vs. two

My issue can be boiled down to this: \documentclass[10pt,oneside]{article} \usepackage{enumitem} \newenvironment{mygroup}{ \vspace{.15in} \textbf{\large MyGroup Heading} }{ } ...
4
votes
2answers
78 views

Compile error with redefined bmatrix and align environment

I just spent a couple of hours finding the reason for compiling errors in the last example in here: \documentclass[a4paper,draft=true, headsepline=on, twoside , 11pt, ]{scrbook} ...
2
votes
1answer
44 views

PGFplots within Environ format mistake

I try to write an environment for a simple barplot with pgfplots to reduce the needed markup. For that I use the environ package. For some reason tikz complains about a format mistake at the ...
3
votes
1answer
97 views

Which Latex environments are supported in Markdown and pandoc?

Does anyone know which Latex environments that are supported in pandoc when converting Markdown to html? I have tested equation, align, alignat which seams to work, so is there e.g. a family/kind of ...
11
votes
3answers
357 views

End \verbatim command

The verbatim environment is used to display LaTeX commands instead of having them executed. To display a single command in-line, the \verb|| command can be used. To display a whole block, we can use ...
2
votes
1answer
57 views

How can I use TiKZ to design comments in the margin of an environment which allows a pagebreak?

To distinguish different classes of environments, I use the environment shaded from the package framed. Then, I would like to design a corresponding environment using TiKZ where a line with a ...
3
votes
3answers
107 views

How to easily write conditional pages? [closed]

Is there any easy way to make latex write only some of the pages? My current idea is to make a function using the ifthen-package in the following way: \newcommand{\WhatDoYouWantToWrite}[1]{ ...
3
votes
1answer
35 views

edit an enviroment to add to a new extra parameter

I'm trying to define a new \newenviroment but I'm having some problems. I need an enviroment that uses a counter and uses an extra parameter to write some text. I'm working with this enviroment: ...
0
votes
1answer
38 views

Unwanted Vertical Space before figures in IEEE Tran Latex document

I am trying to insert .eps figures in my IEEE tran latex document. My figures are shifted down from the original position. Although the figure captions are in their desired positions. I have used word ...
0
votes
1answer
25 views

use of “chemmacros” package give errors when define a newcommand

I am using chemmacros package to write chemical symbols in my thesis. (I am using Easy Thesis template with book class). I added these packages (as below) at the top of thesis.cls file ...
1
vote
0answers
14 views

Symbol at the end of an environment [duplicate]

I'm putting a diamond symbol at the of a remark by use of \usepackage{amsthm} ... \newenvironment{rem}{\begin{remark}}{\hfill$\diamond$\end{remark}} However when the rem environment is ...
3
votes
1answer
17 views

modification to comment environment

I'm using the comment package, in my preamble I have \specialcomment{notes}{\begingroup \color{Blue}}{\endgroup} so that when I want to comment my text I write \begin{notes}...\end{notes} to get a ...
2
votes
2answers
35 views

How can I reduce the space around alltt environment blocks?

How can I reduce the space around all alltt environment blocks? \documentclass{article} \usepackage{alltt} \begin{document} Test1 \begin{alltt} some code \end{alltt} Test2 \end{document} This ...
1
vote
1answer
30 views

Can I make an environment which treats the first paragraph differently to the rest?

I am trying to make a new environment which creates a hanging indent on the first paragraph only but leaves the other paragraphs indented: My code for the above image is: \begin{hang} ...
3
votes
1answer
47 views

Multiline Chain of Implications

I'm new in this forum. Is it possible to create the chain of implications as shown in the image attached, in latex ? Thanks in advance. Tatin
0
votes
3answers
35 views

Problem with lstlisting enviroment

I'm writing \documentclass{beamer} \usepackage{listings} \begin{frame} \begin{lstlisting}[language=bash] #!/bin/bash echo "Hello,world!" \end{lstlisting} \end{frame} But the output ...
2
votes
1answer
83 views

How can I get a count of the optional arguments with xparse?

Question Is it possible to get and store a count of the optional arguments actually passed to an xparse declare argument/environment? Purpose Regardless of the number of arguments provided ...
0
votes
1answer
47 views

Customizing enumerate list with item label as parameter of new environment

I want to define a new environment which would allow me to have a like-enumerate list, i.e. have the \items numbered like in an enumerate environment and change the item name by the one given as ...
4
votes
1answer
35 views

How to set a newenvironment to skip words by flag?

I want to create a environment to include some words, but hide it when a flag is set up. However, I cannot put \begin{comment} \end{comment} into \newenvironment for some reason. How should I do this? ...
4
votes
2answers
42 views

Paragraph indentation after lstlisting environments

I tried to indent first paragraph after a customized lstlisting environment \documentclass{article} \usepackage{listings,lipsum} \lstnewenvironment{mycode}{}{\par} \begin{document} \lipsum[1] ...
9
votes
2answers
224 views

How can I make a command available inside another command's argument?

When I define an environment with \newenvironment, I can use newcommand inside the "before" part, to make commands available to the code inside the environment. Is this possible with simple commands? ...
1
vote
1answer
33 views

Environment that eats up (ignores) text inside it [duplicate]

I want to replicate the environment comment from the comment package: \begin{comment} Hidden stuff. \end{comment} which prints just nothing, instead of using % to comment things out. I can do it ...
3
votes
1answer
31 views

Custom environment with horizontal indentation

I am trying to create a simple environment that consists two parts: bold text followed by a rightarrow (multiple) lines of text with indentation, below the bold text What I have so far: ...
3
votes
1answer
35 views

newcommand based on what environment is active

I want to have command to insert different heading style based on what environment is currently active. I found that the environment should be accessible via macro \@currenvir, but for me, the "else" ...
2
votes
1answer
64 views

pgfplots fillbetween doesn't work with newenvironment

Here is a minimal nonworking example: % preamble \documentclass[class=minimal,border=0pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.12} ...
2
votes
1answer
35 views

autoref on newtheorem

I want to be able to print the names of my own theorems with autoref. E.g. on \begin{lemma} \label{lemma_foo} Some lemma \end{lemma} \autoref{lemma_foo} I want something like "Lemma 3.2" being ...
2
votes
2answers
48 views

Keeping underscores in parameters even inside NewEnviron environments

I followed this answer to define a command such that underscores in its parameter can be kept. However, this does not work if the command is called inside an environment that has been defined with ...
0
votes
0answers
33 views

Longtable integration Stata

As far as I am aware, the available commands that produce LaTeX-formatted tables of stored estimates using Stata, will only produce tables using either the table or tabular environments. Do any other ...
4
votes
4answers
208 views

How can I typeset an environment and its literal equivalent in an environment?

This is a follow-up to the question: How can I typeset a command and its literal equivalent in an environment? It would obviously be useful to handle environments too. I imagine something like the ...
10
votes
3answers
275 views

How can I typeset a command and its literal equivalent in an environment?

UPDATE: I've opened a follow-up question: How can I typeset an environment and its literal equivalent in an environment? I would like to pass a command and arguments to an environment. The output ...
5
votes
2answers
128 views

What is the difference between align and equation environment when I only want to display one line of equation?

I am typesetting a physics document, and sometimes I need to type equations of several lines while in most cases I only need to type one-line formula. So is it OK if I always use align environment ...
4
votes
2answers
178 views

Need a Macro for Tables - independent of row and column size

I have created the following macro for Table: \newcommand{\createtable}[7]{ \begin{table}[htbp] \begin{tabular}{|p{8cm}||p{8cm}|} \hline \begin{center}\textbf{\cellcolor{Orchid!25}{#1}}\end{center} ...
4
votes
1answer
76 views

Redefine Beamer Frame Environment

I would like to redefine Beamer's frame environment to provide different templates as part of a theme. However, I'm having some trouble accessing Beamer's variable from inside that code. ...
7
votes
1answer
130 views

Why \begin{flushleft}…\end{flushleft} doesn't behave as \flushleft…\endflushleft?

The following MWE points out that \begin{flushleft}...\end{flushleft} doesn't behave as its macros counterpart: \flushleft...\endflushleft: flushleft environment's effect stops after ...
1
vote
1answer
113 views

New example environment, with symbol at the end

Is there a standard formatted environment specifically used for examples? I'm writing a document on linear algebra, with the usual definition-theorem-proposition-example structure. Right now when I ...
2
votes
1answer
99 views

Change background color for text block

I want to change the style for \quote areas in my entire document. These three lines is what I came up with. Font and margins changes take effect but not the bg color. Only the first char's bg color ...
2
votes
1answer
23 views

All Environments Share Numbering (According to Subsection)

The numbering scheme I'm looking for causes every environment to share one common numbering counter, according to subsection. For example, in my notes the numbering would look something like this: 1 ...
2
votes
1answer
86 views

LaTeX command or environment to selectively print one out of several given options

I'm currently wasting my time by trying to create a proof-of-concept class to show that writing our university's curricula with LaTeX instead of MS Word would have some benefits. Since these curricula ...
2
votes
2answers
45 views

Increase table row height but not separation from surrounding text

I would like to construct a table environment that accepts an argument that controls the vertical space between rows but does not influence the vertical separation of the table from the surrounding ...
2
votes
2answers
67 views

Need help to set up a physics question/answer/think environment

I am writing a physics study guide for my students. For working out examples, I created a new environment that can contain up to three parts: the question, the answer, and something to think about ...
1
vote
0answers
44 views

How to align item labels according to the longest one automatically?

Time for revenge! I've been fighting with this problem of aligning items according to the longest label automatically for some time now (see first two examples below). The left side of the longest ...
1
vote
1answer
54 views

equation* environment or \[ \]? [duplicate]

So, I'm writing a mathematics paper, and let's say I have the following: \begin{equation*} 2+2=4 \end{equation*} Is this the proper way to do an unnumbered equation, or is it preferred to do the ...
8
votes
1answer
93 views

Suspending environments and resuming by another environment

Is it possible to interrupt a LaTeX environment, say OuterEnv, by another environment, say InnerEnv, the later closing the first in the environment startup code, doing 'whatever' and then resuming the ...
3
votes
1answer
74 views

Remove unwanted vertical space before and after environment in footnote

I am trying to make my own environment for (left-)indented blocks inside hanging footnotes, in which the normal quote environment doesn't work, it's left indent being the same as that of the indent of ...
1
vote
0answers
49 views

How can I create a new table environment wrapper for pgfplotstable?

A similar question has been asked here: - newenvironment using pgfplotstable At first glance, I thought it was the same question, because the question is not clearly stated. That person is asking for ...
6
votes
1answer
102 views

Tasks in custom Environment

I need to wrap a tasks environment inside a custom \NewEnviron. Apparently, tasks chokes on code besides its \task or \item due to the way it handles its own environment body, presumably causing it to ...
0
votes
0answers
34 views

Why can the 7-line TeX file not be compiled? [duplicate]

\documentclass{article} \usepackage{graphicx} \newenvironment{Figure}[1]{\begin{figure}}{\caption{#1}\end{figure}} \begin{document} \begin{Figure}{This is a caption.} \end{Figure} \end{document} ...
0
votes
1answer
40 views

Why does the simplest \newenvironment not work as expected? [duplicate]

\documentclass{article} \usepackage{listings} \newenvironment{hello}{\begin{lstlisting}[language=sh]}{\end{lstlisting}} \begin{document} \begin{hello} ls \end{hello} \end{document} The code ...
1
vote
0answers
54 views

Ending a tikzpicture environment in conditional causes “Missing } inserted”

I want to create a number of tikzpictures. I have a number of items I want to draw. Each tikzpicture takes up a whole page and may contain up to 4 items. (It is not good enough to to have each item in ...