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

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
14 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
29 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
23 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
32 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
27 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
71 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
29 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
32 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? ...
3
votes
2answers
25 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
208 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
31 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
30 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
24 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
45 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} ...
1
vote
1answer
23 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
38 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
18 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
250 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
123 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
131 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
50 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
89 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
90 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
58 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
19 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
72 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
41 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
47 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
36 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
43 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
87 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
51 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
40 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 ...
5
votes
1answer
80 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
35 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
44 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 ...
3
votes
3answers
79 views

Remove par indent from environment

The real problem here is that I can't figure out how to modify an existing environment. The concrete thing I want to achieve follows below. I'm pretty happy with what the framed package gives me with ...
4
votes
1answer
50 views

How to use newenvironment inside a table?

How to define a formatting to use for (individual) rows of a table? Example: (For each row) the first column is always bold, and the second column has an italic "title" and some text and possibly ...
3
votes
1answer
71 views

My “definition” environment is in italic

I obtained a TeX "pre-built" file in order to write for my college, but it so happens that every time I call a definition environment (which is defined in the file), it is always in italic. I am not ...
2
votes
1answer
32 views

newenvironment: error with \begin{align} and \end{align}

In the example below, an error is caused by \begin{align} and \end{align} but I do not see why: \documentclass{book} \usepackage{amsmath} ...
7
votes
1answer
134 views

Automatic creation of lstlistings in AMC questions

Context I'm trying to get an automatic exam where I can generate random numbers (using pgfmathrandominteger) in the AMC package to create different questions using code (listings) and inputing these ...
3
votes
1answer
35 views

Q&A environment with separation

I am writing a question and answer problem book. I would like the questions and their answers to be proximal in the source, but, upon compilation, for the questions to all clump together in one ...
3
votes
1answer
46 views

Making an environment with the same text color as the background

I am looking to type up some solutions to math problems. However, I do not want someone who just looks at the document to be able to see the solution; I want the students to be able to see the ...
1
vote
0answers
68 views

Nested mdframed environment problems

I have a problem concerning a mdframed into an other mdframed. If the content of the second mdframed is too important, the result is horrible: it's separated by one page and the content of the second ...
1
vote
0answers
22 views

define environment with Verbatim and options [closed]

I'm working on an edition, and I need to create some environments using verbatim. I use the fancyvrb package and when I write : \documentclass[9pt]{report} \usepackage{xltxtra, fontspec, xunicode, ...
2
votes
1answer
41 views

Textual replacement macros to wrap environment

I want to create simple textual replacement macros for an environment: \def \myEnvStart {\begin{someEnvironment}[enormous list of arguments]} \def \myEnvEnd {\end{someEnvironment}} This doesn't ...
4
votes
1answer
69 views

How to control conditional statements within new commands and environments

I'm writing a pretty complicated class to typeset a book based on memoir. One of my commands draws a caption on the preceding verso page, draws content on the following recto and verso pages, and ...