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

6
votes
1answer
71 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
49 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
50 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
43 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
69 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
59 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 ...
2
votes
2answers
80 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 ...
1
vote
1answer
44 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 ...
4
votes
2answers
44 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
62 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
84 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
125 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. ...
4
votes
1answer
70 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 ...
1
vote
0answers
23 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
91 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
42 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 ...
2
votes
1answer
67 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 ...
6
votes
1answer
142 views

Understanding differences between newtheorem and newenvironment

The difficulty that I am having is that I make a newtheorem: \newtheorem{definition}[theorem]{Definition} It however seems to act nearly the same as with newenvironment: ...
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
43 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
97 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 ...
4
votes
2answers
37 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. ...
0
votes
0answers
37 views

Problems with Korean characters and ArXiv

Here is the minimum working example. \documentclass[12pt]{article} \title{Sample} \author{Me} \pagenumbering{gobble} ...
3
votes
1answer
40 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
27 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
88 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
31 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
54 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
45 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
100 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 ...
10
votes
3answers
344 views

Defining a list environment with multiple optional arguments

I'm trying to define a list environment with multiple optional arguments and with a default values for those arguments. For example, creating a new environment with a name newenv, which accepts two ...
4
votes
1answer
85 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
94 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} ...
3
votes
1answer
53 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} ...
2
votes
0answers
95 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
75 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}} ...
4
votes
2answers
1k views

Lyx 2.0 Formatted references to theorem/lemma/claim environments

In Lyx 2.0, I'm trying to use a formatted reference to a claim, but I cannot get the "formatted" part, i.e. I can't get it to typeset "claim" as well as the claim number. I'm using modules "Theorems ...
1
vote
1answer
205 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}} ...
0
votes
1answer
52 views

Automatic parsing/extraction of single-argument commands from input (for use in new environment)?

I'm not sure whether this is in principle possible, so let me try to explain; consider this MWE: \documentclass{article} \usepackage[showframe]{geometry} \usepackage{tikz} \usetikzlibrary{calc} ...
10
votes
3answers
3k views

Defining a command for amsmath's align environment

I'd like to define a shorthand command for \begin{align*} and \end{align*}. When I write \newcommand{\ba}{\begin{align*}} it works fine. But when I write \newcommand{\ea}{\end{align*}} ...
1
vote
0answers
39 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
106 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
49 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
44 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
1answer
126 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 ...
0
votes
1answer
134 views

Change words in a Tikz picture every page

I'd like to create a template, as below. But I'd like to make it so that I can have multiple pages of the same layout and be able to easily replace "Header 1" and "Header 2" with different words each ...
3
votes
2answers
35 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 ...