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

2
votes
2answers
51 views

Defining an environment that leaves the surrounding environment

I'd like to define an environment like this: \newenvironment{antiitemize}{\end{itemize}}{\begin{itemize}} I call it antiitemize because I intend to use it inside an itemize environment to break out ...
1
vote
1answer
37 views

how to decrease spacing after item (using mbox)

In the following example I am facing some issues regarding enumerate: Firstly, in order to make sure the items start in separate line, I used \mbox{}\, however the items have shifted a bit more ...
2
votes
2answers
42 views

Counters for Chapter and Section environments when using tcolorbox for listings

This is a followup question of this question. With my MWE I'm getting wrong Listing numbers, wrong toc (including Chapter and Section environments from listings) and wrong bookmarks in pdf toc. Any ...
4
votes
2answers
36 views

ltablex inside environment throws \end -error

I wanted to use a tabularx (ltablex package) inside an environment, but there is an error (but it still builds okay). I'm using ltablex, because I want a longtable spanning several pages with the ...
0
votes
0answers
58 views

what is interfering with the new environment here?

Basically I wanted to modify the description list so that the first word(s) are underlined and bold If you compile this file. \documentclass{article} \usepackage{soul} ...
2
votes
1answer
56 views

Reading code from external file in tcolorbox and getting pdflatex> ! paragraph ended before \tcb@set@label was complete

I want to read code from external file in tcolorbox in new defined \texexptitled environment but could not succeeded (See MWE). Without this my MWE also throws two other errors pdflatex> ! ...
3
votes
1answer
54 views

listings using tcolorbox package without Chapter and Section environment effects

I want to get listings using tcolorbox package but without counting Chapter and Section environments. See in MWE, I used section environment withing listings which effects the counter for following ...
3
votes
1answer
116 views

Xparse macro not working when \obeylines is in effect

This is the most strange and hard-to-debug situation I have encountered in latex. When \obeylines is in effect, it seems that macros with optional argument defined by xparse will have some trouble. ...
0
votes
0answers
19 views

lilypond enviroment inside a table

While making a song book I came to a point in which I wanted to insert lilypond code inside a table (tried also a box); this was due to some placing notes around texts and similarly things. But this ...
3
votes
1answer
66 views

how to ensure items in two minipages are in same line

By including a tikz-picture in my two (tabular) minipages my items are messed up. Ideally there is a corresponding item for each (except there's an empty entry for the last item in the left table). ...
0
votes
0answers
35 views

\newenvironment does not work

I have created a new environment using this commands: \newenvironment{eqs} {\begin{subequations}\begin{align}} {\end{align}\end{subequations} } I would like to combine subequations and ...
7
votes
3answers
264 views

Macro to close all open environments, groups and argument delimiters

Initial Request I am in search for a macro that would close all curly brackets and all open environments. Ideally, I could write something of the following sort: ...
2
votes
0answers
44 views

newenvironment using pgfplotstable

I want to have a newenvironment body as an inline input argument for pgfplotstable. Is it possible to do this without using braces in the body itself? \documentclass{article} ...
8
votes
1answer
33 views

Defining a reusable string from within an environment

I write documents that rely heavily on the 'enumerate' environment. I'd like to turn any particular item from within that environment into a variable that I can use elsewhere. The idea is to ensure ...
5
votes
2answers
74 views

Memoir boxed example environment

Memoir's manual has this example of frame with title environment. I was wondering how can I add a counter to it? Say, to mimic the AMS theorem environments. Any better way of achieving this in memoir ...
0
votes
0answers
32 views

Problems with Korean characters and ArXiv

Here is the minimum working example. \documentclass[12pt]{article} \title{Sample} \author{Me} \pagenumbering{gobble} ...
2
votes
1answer
58 views

Modify Figure environment

is it possible to modify the Figure environment in order to distinguish it better from the text in a one column document? I mean, I was thinking in doing --------- Figure # ---------- [The ...
4
votes
2answers
33 views

vspace mysteriously being inserted after nested custom environment

I have created my own environment that creates a table using tabu and then puts some vertical space after it, unless my environment is being nested, in which case I want it to skip the vertical space. ...
3
votes
1answer
35 views

How to define an environment that takes a number of arguments and produces a table

What is the best way to create an environment that takes a number of arguments, like this: \finding{% Text argument #1, Text argument #2, Text argument #3, Text argument #4} and produces something ...
0
votes
1answer
17 views

CJKvert affecting all CJK in document

My document has been compiling very well (thanks in no small part to Tex SX!), but I seem to have hit a snag. I added a more complicated dedication to the beginning of my thesis (using \dedication ...
3
votes
3answers
83 views

How can I split this equation?

Does anyone know how to split this equation in two lines? \begin{equation*} \iint_S \eta = \iint_S \left[F(x(u,v), y(u,v), z(u,v)) \ \frac{\partial(x,y)}{\partial(u,v)} + G(x(u,v), y(u,v), z(u,v)) \ ...
0
votes
0answers
24 views

How do I make a new command with author/journal/year citation in footnote

\documentclass{beamer} \usepackage[backend=bibtex]{biblatex}%backend=biber, natbib=true, style=chem-acs \bibliography{oralspaper} \DeclareCiteCommand{\citejournal}%%%creating \citejournal command ...
2
votes
1answer
58 views

How can I escape the scope of an environment?

Is there any way to escape the scope of an environment, e.g. to get the \pgfplotsset command in the MWE below have an effect on the subsequent plot? (I know that \newcommand doesn't have this ...
1
vote
0answers
21 views

How to continue a framed box which is defined in floating environment [duplicate]

I have defined a floating environment. It defines a framed box using \mdframe. Here is the code I used. \documentclass{article} \usepackage{mdframed} \usepackage{lipsum} \usepackage{caption} ...
3
votes
2answers
50 views

Hide content of tabular environment [duplicate]

I would like to create a pdf file that containes only the table captions, but not the content of the table. So I tried to redefine the tabular environment in the preamble of my document (it is ...
3
votes
0answers
43 views

Define new command which insert environment [duplicate]

Am i able to do something like this: (without defining new environment) \newcommand{\code}[2] { \begin{lstlisting}[language=#1] #2 \end{lstlisting} } I don't want to write: ...
1
vote
1answer
32 views

changing font in a particular environment

For a book, I want to change the default font in the Examples environment (declared in the same way as theorem) to the usual roman (not italic) so that there are not very large areas of italic font. ...
6
votes
2answers
90 views

copy and reuse the content of an environment

is there a way to embed an text in several environments (or structures, \chapter, \section etc.) in one file and "copy"/insert the content of single environment items in other files? i've noticed the ...
3
votes
1answer
34 views

Minted In A New Environment

I'm trying to enclose Minted in a new environment as follows: \documentclass{article} \usepackage{minted} \usepackage{mdframed} \usepackage[varqu]{zi4} \definecolor{codebggray}{rgb}{0.95,0.95,0.95} ...
4
votes
1answer
82 views

Getting pages where an environment is located

I am trying to create a new environment that sticks a watermark in the background. Specifically, I have something like \usepackage{background} \newenvironment{\watermarked}{ ...
5
votes
1answer
56 views

New environment for minipage and colorbox

I would like to create a new environment that would automate the following code: \setbox0=\hbox{\begin{minipage}{5.8in} \color{black} \begin{verbatim} <Some verbatim text here> \end{verbatim} ...
2
votes
1answer
70 views

Why the renewcommand doesn't work as I expect?

I re-defined two environment \newtheorem{exmp}{Example} \newenvironment{examp}{\begin{exmp}}{\renewcommand{\proofname}{Sol.}\end{exmp}} ...
1
vote
1answer
146 views

Acrostic Environment

I tried to wrote the code of an environment for acrostics, using cenverse and boldfirst, but it doesn't work (probably because cenverse use // and boldfirst not). \newcommand\dob[1]{\textbf{#1}} ...
1
vote
0answers
31 views

Making a textpos command being transparent

I am defining my own margin notes command and I have a question about making a command "transparent". To be more clear, I have the following code : \documentclass{article} ...
7
votes
2answers
96 views

convert a \newcommand to \newenvironment

I have defined a command as follows \newsavebox{\textsix} \newcommand{\bottomr}[1]{\sbox{\textsix}{\parbox{11cm}{\begin{flushright} #1 \end{flushright}}}} which save the parameter (text) of the ...
2
votes
2answers
45 views

set section environment to be math only, amsmath's begin{gather}

I want to create a small formulary, and for that virtually every line has to be math formulas. I use the gather-environment from the package amsmath, for example: ...
2
votes
1answer
38 views

Square brackets in in the `description' of the theorem environment [duplicate]

The following code works fine \begin{theorem}[Euler] Blah \end{theorem} But whenever I try to use square brackets in the description I get an error. \begin{theorem}[The set $[0, 1]$ is compact] ...
2
votes
0answers
91 views

Checking if first portion of an environment's content is empty

Motivation: I am working on a very personalized Exercise/Answer package for my colleagues. The exercise, exsheets, etc. packages don't do what I need. To accomplish this, I create an exercises ...
2
votes
1answer
56 views

Keep float out of a environment (for example definitions)

I knew that floats float around and sometimes are placed far away from where one wants them to be. With the times I learned to work with it, and there are already many posts about it. I have a kind ...
2
votes
1answer
60 views

Can a chapter style environment be used for appendix formatting?

I have started including appendices in my thesis to collate common information for each separate \part section so as to make the script concise and to the point. I am using a KOMA-Script document ...
3
votes
2answers
29 views

having custom caption in listing

I would like to have my custom name for my listing, how can I do that. here is my code: \documentclass[12pt,a4paper]{scrreprt} \usepackage{listings} \lstloadlanguages{R} \lstset{% general command ...
2
votes
0answers
33 views

Remove bibliography headings with multibib and tocbibind

I use multibib which creates two families of citation commands: pri and sec. I would like to get rid of bibliography headings for the \bibliographypri and \bibliographysec commands while keeping the ...
4
votes
1answer
38 views

Reducing the distance in textbf environment

I want to introduce a notation for concatenating vectors in a manuscript that I represent vectors with bold characters, $\textbf{x}$. The problem is defining it like $\textbf{x}:\textbf{y}$ introduces ...
4
votes
1answer
78 views

Detect actual start of text

I have conditional which is sometimes suppressed, and if it gets typeset needs to be noted. If the conditional text begins with an environment which adds vertical space prior to the actual start of ...
3
votes
2answers
113 views

tikzpicture to create a first page with an image in background taking the whole page

I am trying to create a newsletter with Latex, but I am not expert at all. My goal is, for the moment, to create a first page (the cover), with an image in the background, and some text overprinted. ...
3
votes
1answer
44 views

\newlist vs. \newenvironment for defining an individual list style

as far as I know, there are two ways of defining an individual list style: 1) Use the enumitem package and the \newlist and \setlist commands 2) Define an individual environment like the following ...
5
votes
2answers
77 views

Collecting contents of LaTeX environment

I have the following for collecting contents of an environment and printing them later, it works but for my real task i want to use the environ package because i need to be able to have access to ...
2
votes
1answer
59 views

(Re-)Setting the currents section name from within the section

I am trying to reset the currents section from somewhere "whithin" the section, but after the \section command. Is that even possible with the way LaTeX works? I know, it is possible to use the title ...
0
votes
0answers
38 views

Help with “environment” problem

I am new to LaTeX. I want to write a report which will contain math symbols and equations. I began like this \documentclass{article} \begin{4 week report} \ body \end{4 week report} ...
6
votes
1answer
92 views

Macro, new command or new environment for code?

I am using the listings package to typeset code. I have defined a custom style using \lstdefinestyle{verbo} and then typeset code in a lstlisting environment as in the following MWE. ...