{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
95 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 ...
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 ...
7
votes
1answer
121 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. ...
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 ...
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{...
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
21 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
278 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 ...
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 ...
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 ...
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 ...
1
vote
0answers
15 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}...
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
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}...
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 ?
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
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
37 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 \...
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 ...
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:...
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
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
73 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 ...
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}{}% {\...
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 ...
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 "...
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 ...
0
votes
1answer
29 views

Changing the top margin of the proof environment

In my opinion the proof environment has too big of a top margin. I'd like to have it visually closer to the proposition or theorem it refers to. I have verified that adding \vspace{-3ex} before a ...
1
vote
1answer
32 views

longtable and filecontents inside a newenvironment

I'm trying to create a new environment for longtable enclosed by a filecontents environment. But I'm stuck and don't know exactly how to solve my problem. \documentclass[a4paper,parskip]{scrartcl} \...
3
votes
1answer
56 views

“Something's wrong--perhaps a missing \item” error in \newenvironment using a \vtop box

In attempting an answer to "How to label a list / make a line before list stick with the list?" I answered using a \vtop box to contain the entire list including the label. I then, trying to improve ...
3
votes
1answer
35 views

Error: "Something's wrong--perhaps a missing \item.'' using multicol in a \newenvironment, can it be fixed?

The below works, but produces an error message Something's wrong--perhaps a missing \item. Does anybody know why it throws an error, and how to correct my code? \documentclass{article} \usepackage{...
7
votes
3answers
267 views

Environment to replace \vbox{\hbox{…}\hbox{…}\hbox{…}\hbox{…}…}

I am using LaTeX (LuaLaTeX,actually) and lately I found myself doing this a lot: \vbox{% \hbox{\strut foo}% \hbox{\strut bar}% \hbox{\strut baz}% } I use it inside tabular environments, ...
3
votes
1answer
27 views

Using/Forcing upright text within theorem environment

I would like to write an equation within a theorem that involves an integrand and the upright symbol $ \textrm{d} $ which I have abbreviated in my preamble with \newcommand{\dmath}{\textrm{d}} (...
1
vote
1answer
27 views

Create custom tabular environment

In the process of creating a beamer template from a PowerPoint template, I am trying to create a tabular environment with colored rows, lines between the rows and specific header and footer styles. ...
0
votes
0answers
16 views

Prevent gather* from creating new line [duplicate]

I've been trying to use the gather* environment for non-aligned centered equations within enumerate but I would like to prevent the new line that gather* inserts at the beginning of each item. Is ...
4
votes
1answer
42 views

How to edit proof environment or minipage

Im actually working at my faculty as assistant teacher, and I like to write in latex everything we do in classes, so I use the following format: \fcolorbox{white}{light-gray}{\begin{minipage}{18cm} ...
3
votes
2answers
26 views

Partial center in environment

I'm writing a lab manual with step by step directions. Some directions include screenshots. To keep the screenshot with the line of direction, I use samepage. I am exploring an environment I can use ...