{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
0answers
94 views

Rewriting a command using xparse for common code

I'm trying to write the documentation for script which I am working on using the packageltxdoc and docstrip. I have defined several commands using the package xparse and I would like to define a new ...
2
votes
1answer
28 views

Normalizing nested environments for cleaner design (LyX)

LyX supports nested environments (e.g., begin{itemize}...\item...) intuitively with the Tab key. I'd like to get this to work for questions in a layout with the Exam class. Exam nests questions with ...
4
votes
1answer
45 views

how to deactivate eqnarray environment in AUCTeX

It is mentioned in several places that the environment eqnarray should be avoided, e.g., this Avoid eqnarray! article. That said, when I am using AUCTeX in emacs, if I type C-c C-e eq TAB, I would ...
1
vote
1answer
34 views

acronym environment does not work

I am not that new to LaTeX but still very green... I am trying to use the Package acronym and struggle right at the beginning. When working with \acrodef everything works as expected but my acronym ...
1
vote
3answers
128 views

Combine minted and tcolorbox for code from file (inputminted?)

Thanks to Thomas F. Sturm and Gonzalo Medina I have a nice looking environment for code listings with appropriate ref functionalities. However, I just cannot figure out a way to make the defined ...
7
votes
1answer
120 views

Define an environment that automatically produces some of a table

Is there a way to define an environment which will automatically produce the first row and first column of a table, leaving you to fill in the rest of the entries as usual? I'll show you what I mean. ...
1
vote
1answer
36 views

Indent and mark paragraphs

I need an environment that indents one or more paragraphs and draws a gray line at the normal indentation level that matches the paragraph in height. This is what I came up with: \documentclass{...
15
votes
5answers
17k views

Defining my own proof environment?

How would I define a proof environment that is basically used with \begin{proof} some proof here \end{proof} and it would be equivalent to: \paragraph{Proof:} some proof here \hfill \box ?
3
votes
1answer
28 views

Compile error when using if in my environment

I have a custom environment with some parameters. The goal is to basically layout some parameters of the environment. My simplified document is this: \documentclass[11pt, a4paper]{article} \...
1
vote
0answers
20 views

tcolorbox breakable in multicol environment

I would like to have my tcolorboxes with breakable inside my multicols environment. But they do not break. Also: \documentclass[a4paper, twocolumn]{article} Would not work for me, because for some ...
1
vote
0answers
44 views

Can I find out if I am in an environment?

Is there a way to know if I am in an (specific) environment or not? This MWE should clearify my question? \documentclass{scrartcl} \usepackage{xltxtra} \usepackage{polyglossia} \setdefaultlanguage[...
19
votes
1answer
277 views

Where can I find the definitions of TeX environments?

As can be seen by my comments here, here and here, I'm currently trying to find out how to see the definitions of environments, but I felt that a new question would be responded to quicker. I want to ...
8
votes
2answers
71 views

Superflous vertical spacing after tagging environment

I would like to use the tagging package to tag parts of a document, which not only contain text, but also other environments like enumerate. If I use the taggedblock-environment for this, this creates ...
4
votes
3answers
121 views

Different counter for equations inside environment

Let's say I have a tcolorbox environment called note. Is there a way for equations that appear inside this environment to automatically assume a different counter from those outside? With ...
0
votes
1answer
38 views

Footnotes in multipage environments

I'm in conflict with how mdframed handles footnotes inside environments that span multiple pages. Consider this MWE \documentclass{article} \usepackage{lipsum} \usepackage[framemethod=tikz]{...
1
vote
1answer
33 views

If Not Switching When In Environment

I have the following environment to create an invoice. It works perfectly except that the rows do not switch between light and dark gray (they stay light) so I assume that \iflight is staying true. If ...
1
vote
0answers
45 views

Using enumerate within theorem environment [duplicate]

I defined myself a \newtheoremstyle a \newtheorem + \newenvironment as in the following %Theoremstyle with \newline \newtheoremstyle{break} {\topsep}{\topsep}% {\normalfont}{}% {\bfseries}{}% {\...
2
votes
2answers
58 views

Use \newtheoremstyle to define a custom example environment

I am trying to define a custom example environment for my thesis, but with my limited knowledge of LaTeX I am not able to figure this out from the amsthm documentation. Here is a minimum working ...
0
votes
1answer
30 views

“widetext” not recognized in TeXstudio

I use "revtex4-1" document class in TeXstudio. But I find that the environment "widetext" is labeled "command not recognized" even after I check the box before the term "revtex4-1.cwl" in the "...
2
votes
0answers
27 views

Accumulate contents of an environment

I'd like to extract and duplicate the contents of several rather arbitrary environments and repeat them at the end of my document. The extract package doesn't work for me because the environment ...
2
votes
0answers
23 views

Align environment without newline [duplicate]

Is it possible to use the align environment while suppressing the auto \newline? I have a problem with the following command: \begin{lemma} \begin{align*} a+b &= c \\\ &=d \...
1
vote
2answers
26 views

Using fancyvrb to create a new verbatim environment in Isabelle

Following answer http://tex.stackexchange.com/a/114672/27523 I used fancyvrb to define a new verbatim environment -- I will use it to specify some font later, now I want to make it work at all. I ...
8
votes
1answer
194 views

Have a command acting on the environment body

I need to turn this \begin{FOO} my little pony \end{FOO} into this \bar{my little pony} I have tried this: \newenvironment{FOO}{\bar}{} But this seems to only make \bar apply on the first ...
1
vote
0answers
14 views

LyX - Environments in XeTeX using Hebrew

Lately I've decided to try and use XeTeX instead of LaTeX when writing documents in LyX in Hebrew, as it was suggested to be more friendly towards different languages. More specifically, I can now use ...
0
votes
0answers
29 views

Change this simple environment

I am a new latex user and I have never used the eviroment structure of latex How can update this enviroment code: \setlength{\tabcolsep}{0pt} \newenvironment{entrylist}{% \begin{tabular*}{\textwidth}...
36
votes
3answers
45k views

Example environment?

I was wondering if there is any formal environment for specifying 'examples' through out the text. If not, which environments do you recommend?
1
vote
1answer
36 views

Combining environment with if - statement leads to errors

I have the following MWE: \documentclass{article} \RequirePackage[utf8]{inputenc} \usepackage{xcolor} \usepackage{lettrine} \usepackage{blindtext} \usepackage{gtrcrd} \newcounter{Cnt} \setcounter{Cnt}...
0
votes
0answers
22 views

A collection of title, authors, affiliations and abstract

How to incorporate a collection of what is described in the main question above, e.g. in a book document class?
-1
votes
2answers
52 views

What is a good way to use lemma?

So, I normally work in a problem proof format. Here's what I do \newenvironment{problem}{1}[Problem] {\begin{trivlist} \item[\hskip \labelsep {\itshape #1.}]}{\end{trivlist}} And then, \begin{...
1
vote
1answer
41 views

Lettrine in a custom environment

I want to use the lettrine-package in my custom class in order to modify the first letter in a section. The usual way of doing it is \lettrine{T}{est} of my text The problem for me is that I do not ...
2
votes
3answers
62 views

Filling in colors in frame macros

I am hoping the answer to this question is a simple, so apologies for my ignorance. Based on posts here, I was finally able to make the frame appear the exact way I wanted it to. I made the following ...
6
votes
1answer
31 views

Interaction of \BeforeBeginEnvironment and \NewEnviron

Consider the following MWE. \documentclass{article} \usepackage{etoolbox} \usepackage{environ} \usepackage{tcolorbox} \usepackage{amsthm} \BeforeBeginEnvironment{proof}{\tcblower} \NewEnviron{...
2
votes
1answer
33 views

New environment with dedicated index and reference

I'm using chemfig to create some structural formulas, but I need to create a new environment, like equation, that have a dedicated index and reference counter. I'm searching about this, but I'm having ...
6
votes
1answer
123 views

Is the document an example of an environment?

Is the document in which you write your code an example of an environment? It seems like it might be, because it requires \begin and \end statements, but I have never seen a source which defines ...
1
vote
0answers
48 views

Environment for example with pstricks

How can do with pstricks the environment that appears in the image ?
4
votes
2answers
377 views

How can I write like this example and boxs in latex

How can I write like this example and boxs in latex thanks very much
1
vote
1answer
29 views

For programming a command: emit \newline iff we are within a paragraph

Short version: I am defining an environment: \newenvironment{myenv}{\begin{trivlist}\item}{HERE something\end{trivlist}} Now at the point marked with "HERE", I need a "conditional newline" doing ...
1
vote
1answer
30 views

simple formatting issue, 2 interfering environments

I am using the Frankensteins dialogue environment as well as the mdframed environment in order to highlight interesting parts of the dialogue. I would like that these two environments don't interfere ...
1
vote
1answer
35 views

Disabling automatic dissimilarity coding in texshade

The package texshade provides an environment to typeset nucleotide and aminoacid alignments. This otherwise great package has a default setting, which I would like to turn off: By default, texshade ...
2
votes
1answer
36 views

Use \(end)comment instead of \begin/\end{comment}

In my document, the comment environment works fine, but \comment and \endcomment stop processing of what comes next in the document: \documentclass{article} \usepackage{verbatim} \begin{document} X \...
0
votes
0answers
11 views

Using arguments in \newenviroment together with \caption [duplicate]

I created \newenviroment for "professional tables": \newenvironment{tabpo}[1]{% \begin{table}[!ht] \centering \begin{tabular}{lllllll} \toprule } {% \bottomrule \end{tabular} \caption{Arg:...
2
votes
1answer
33 views

How to align the left hand skill type?

Within the following piece of code I wish to align the skill type with the top of the text written on the right hand side. Otherwise the text becomes difficult to separate. This is from a template CV ...
5
votes
1answer
72 views

How to “shallow” \renewenvironment of \itemize?

I want to patch exactly the outer level of \itemize, whereas the following MWE (expectedly) patches all of them: \documentclass{article} \begin{document} \setlength{\fboxsep}{0pt} \let\saveditemize=...
0
votes
0answers
37 views

How to make post processing changes?

I'm not a Latex expert so I might be using the wrong terminology. I would like to create a package that make some post processing calculation and write the result to the document. More specifically, I ...
0
votes
0answers
18 views

Change the behaviour of emph per environment

Is there redefine the way emph behaves in the definition environment? Right now, since definition is in italics, emph just makes the text non-italic which is not enough to make it stand out. Is there ...
2
votes
2answers
57 views

Compatibility issue with \renewenvironment{figure} and [H] placement

This is related to Shift all floats on page horizontally. While trying to redefine the standard figure environment I've run into compatibility issues with the [H] placement specifier from the float ...
4
votes
2answers
56 views

reformat section headings to include text

I'm sure that there's a easy answer, but I've reached the point of frustration trying different things with the \renew command. I want to reformat all section headings to include the text "Question" ...
2
votes
2answers
70 views

Defining alternative environment for code listing for tex4ht without code duplication

I am using tcolorbox with listings for code formating, which works well in pdf, but this package does not work with tex4ht (it produces invalid output). I am having hard time figuring the latex magic ...
3
votes
2answers
81 views

help in finding error using \newenvironment

I am learning \newenvironment and I need help in finding where my error is in making \newenvironment. I get a Latex error and I do not see what I am doing wrong. I am trying to reduce code ...
1
vote
1answer
38 views

Small wrapper for easylist using \item like syntax and a new environment

I'm trying to create a new environment for using the package easylist so that some users that are not used to LaTeX can easily make use of it. Right now the environment and its custom commands are ...