{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
1answer
44 views

How to make the section and theorems with different colour

How to write the section and examples in different colour, such as the title with blue colour \documentclass[20pt,a4paper]{extarticle} \usepackage[a4paper,margin=6mm]{geometry} \usepackage{amsmath} ...
19
votes
5answers
576 views

Typesetting hashtags with natural syntax

I'm using an online conversation in my document and I've made an environment to use for it. The thing is, there are many #hashtags in each post (that I'd like to color appropriately). To make it ...
2
votes
1answer
46 views

\newenvironment behaviour with \begin{landscape}

I would like to use landscape mode for a \newenvironment{lessonPlanner} in which I have a table. but I get an error when I embed \begin{landscape} and \end{landscape} in the begin and end statments of ...
3
votes
1answer
50 views

\usepackage for \newenvironment

I am trying to create a package called lessonPlanner in which I declare some new environments via \newenvironment So I have something like ... mwe.tex \usepackage{lessonPlanner} \begin{document} ...
4
votes
1answer
49 views

Compilation fails in beamer class with newenvironment defining nested blocks

I'm failing to understand why this code compiles : \documentclass{beamer} \newenvironment{yyy}{\begin{frame} \begin{block}{youpi} }{\end{block} \end{frame}} \begin{document} { \begin{frame} ...
1
vote
0answers
39 views

Trouble creating custom algorithm environment with separate counter

I am trying to create a custom algorithm environment for CUDA kernel code that runs on the GPU, but have little experience with custom LaTeX. It should have a separate counter, be referenced as Kernel ...
3
votes
1answer
66 views

Use the counter value as an argument

Do you know a simple way to use the current counter value to call the argument in a macro? In myPackage I have this Note: I have the for loop defined as % ...
4
votes
2answers
153 views

“The LaTeX Companion” example environment

I'm a new LaTeX learner. Is there anybody who knows "Example environment" in "The LaTeX Companion" book? Thanks in advance.
0
votes
0answers
13 views

forcing certain figure environments to be on top of page globally? [duplicate]

There are certain environments, such as the figure environment and environments that I defined myself that I want to force to appear (by default) on the top of a page, in a global way (instead of ...
0
votes
0answers
9 views

renewing \citeauthor while using natbib to remotely access .bib.file

My institute provides its own bibliography style .bst-file. Since the latest bibtex versions don't support \bibliographystyle anymore, I changed to natbib. The provided .bst-file is not a author-year ...
2
votes
1answer
29 views

New float environment in tufte-book with alternate caption placement for full width figures

I am trying to define a new environment for photographic plates in a tufte-book.cls book. The environment should: Work just as the existing figure / table environments do for non-starred uses, and ...
4
votes
2answers
118 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 ...
0
votes
0answers
17 views

Renewenvironment with optional parameter [duplicate]

I want to renew an environment with an optional parameter. The way I do this is: \documentclass[10pt,a4paper]{article} \newenvironment{myEnvironment}[1][]{#1}{} % save old environment \let ...
7
votes
2answers
94 views

Defining new split environment with reduced spacing

this is my first stackexchange question so apologies for any bad etiquette. I'm writing a document in double spacing. I don't wants the gaps between the lines of a multi-line equation to be that ...
0
votes
1answer
41 views

Showing/Hiding verbatim environment based on boolean condition

I would like to show and hide a verbatim or spverbatim environment based on a boolean condition (sth. like \showenv). I tried the solutions proposed at Hide custom environment content based on ...
3
votes
1answer
39 views

New environment based on two existing environments (mdframed, spverbatim)

I would like to define an environment that puts verbatim text using the spverbatim package into a frame defined by the mdframed package. Here's my (naive) approach: \documentclass{scrreprt} ...
2
votes
0answers
25 views

Use of environ package with knitr

I'm working on a knitr document and trying to place knitr output inside of a new environment defined using the environ package. The example below illustrates the problem. With a traditional LaTeX ...
6
votes
1answer
64 views

Dynamically calculated Row height in Tables

I am trying to dynamically allocate the height of rows in a table based upon a number, specifically the number of minutes that are devoted to a specific activity in a class lesson. The table ...
4
votes
2answers
46 views

How to keep an environment with the last line of the previous environment?

I quite often include attributed quotes in my documents, using something like: \begin{quote} Now I am become Death, the destroyer of worlds. Also, I like bananas! I like bananas so much ...
3
votes
2answers
49 views

How to avoid a spurious space when combining frame, centering and another environment?

I want to create a special environment in beamer, which combines several environments, one of which is center. However, when using my newly created environment, I get an additional space in comparison ...
0
votes
0answers
41 views

LTXtable does not work in an environment

I'm trying to write an environment that gathers the content of an LTXtable writes it to an file (with predefined header/footer) and then txpesets this table. Gathering the content is no Problem and I ...
0
votes
1answer
63 views

Chapter No. in Theorem style

I'm using \documentclass{book}. I'm also using the code below to create a theorem style, however, it only puts the title on top. I want to modify the code so that I get => Theorem ch. no. theorem no. ...
2
votes
2answers
57 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
41 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
70 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
38 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
59 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
72 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
64 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
123 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. ...
1
vote
0answers
21 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
83 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
38 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 ...
8
votes
3answers
308 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
35 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
84 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
36 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
62 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
35 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
39 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
21 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
86 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
27 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
60 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
52 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
36 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
95 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 ...