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

4
votes
1answer
67 views

Making headings that depend upon later environments

I want to typeset a test and a marking scheme. I have the following code: \documentclass{article} \usepackage{ifthen} \usepackage{amsmath,amsfonts,amsthm,amssymb} \setcounter{secnumdepth}{0} ...
2
votes
1answer
39 views

Problem with adding exercises - “missing \item error”

I have the following MWE: \documentclass[12pt]{article} \makeatletter \usepackage[dutch]{babel} \usepackage{blindtext} %Paragraphs get numbered continuously \usepackage{chngcntr} ...
2
votes
1answer
24 views

Environment for Counting Names and Marking the count as Subscript

For typesetting a religious document explained as below This contains verses of list of names separated by commas. A counter is to be initiated and will be incremented with each name. Each name ...
1
vote
1answer
14 views

Allow page break in table in customized environment

\documentclass[12pt]{report} \usepackage{amsmath,enumerate} \usepackage[top=1cm,bottom=1.5cm,left=1cm,right=1cm]{geometry} \usepackage{booktabs} \usepackage{longtable,tabu} % allow page break ...
3
votes
1answer
23 views

Data structure: Define a command or environment only valid inside a certain type of environment

I want to script the generation of LaTeX documents, and therefore, I will need to use a data structure to organize the information. For example: Person: Name Phone Address I know in LaTeX you ...
0
votes
1answer
33 views
2
votes
1answer
261 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
125 views

How to use \newenvironment; why doesn't this code work? How do I fix it?

I've been trying to find out but my latex skills are too weak to understand what seem like similar problems. When I try this: \documentclass{memoir} \usepackage{graphicx} \usepackage{exsheets} ...
1
vote
1answer
24 views

Highlighting paragraph as own opinion

Has anyone a suggestion what one could do to mark some parts of a text as "own opinion?". I am writing a report on which basis the team will decide further steps. So I am reviewing several ...
0
votes
1answer
23 views

using the soul package with equations

I use the soul package to highlight some changes in my documents for review purposes. However I can't get it to work with equations (or other environments for that matter). Basically I create a ...
6
votes
3answers
2k views

Number mhchem reactions and create a \listofreactions

Is there a way to create an environment for reactions defined with mhchem that behaves similarly to equation in terms of numbering the reactions (including a \nonumber command)? Can I get a list of ...
0
votes
0answers
22 views

How to number chemical reaction separately from mathematical equations? [duplicate]

While writing part of my dissertation, I need to number chemical reactions separated from mathematical equations. I checked chemscheme, but it seems not what I'm looking for. I need to numbering of ...
3
votes
1answer
22 views

How to set single spacing for all quotation environments? (Bug in etoolbox?)

I found an answer to the question here: Reduce the space between a quotation and a title. But for some reason the result is highly dependent on the code formatting and hence error prone as shown by ...
2
votes
1answer
21 views

Put some environment on left column and some others on right in article with twocolumn option

I use the article class with the twocolumn option. I would like to put definition environments on the left column and example environments on the right column. For example : ...
8
votes
2answers
204 views

How to automatically repeat all the theorems?

What I'm trying to do sounds quite simple: \begin{thm} Theorem 1 text. \end{thm} ... \begin{thm} Theorem 2 text. \end{thm} ... \RepeaAllThms This should display the theorems as it usually does, but ...
5
votes
2answers
151 views

New environment, orphan line

I created three environments for my document: a booklet for a treasure hunt with scrreprt. I created 3 environments (the document is in french): enigma: ...
1
vote
1answer
21 views

text format in the appendix in a thesis

I am using Easy Thesis template from sharelatex. I need some help to put the text below as it is in the appendix section in a thesis. I may prefer the font as it is (ascii). REMARK ATOM 1 ...
1
vote
1answer
31 views

Table/figure in custom environment

having a custom defined environment, how would it be possible to have figure/table under the defined environment? \newenvironment{example}[1]{% \begin{exa}[#1] }{% \end{exa} } and ...
0
votes
3answers
49 views

creating theorem-like environments within 'notes' (see example)

I would like to create the following style to write mathematics: In fact the above I created myself but some numbers and spacing I had to set manually (and I would like this to be automatic of ...
3
votes
1answer
38 views

Redefining proof environment

How can I change the \begin{proof} environment so that the word Proof which is displayed in my document isn't italic? I tried changing \proofname, but that only changes the displayed text, not the ...
2
votes
1answer
46 views

Referencing custom environment

I am using \begin{figure} \includegraphics{} \caption{Caption} \label{fig:fig_name} \end{figure} and \begin{table} \begin{tabular} .... \end{tabular} \caption{Caption} \label{tab:table_name} ...
3
votes
1answer
20 views

How to use case 1, case 2 in a proof (IEEE confs)

I want to show: proof: Case 1: ..... Case 2: ..... in a proof. The following is my rough codes: \documentclass[12pt]{article} \usepackage{amsmath} \begin{document} \begin{proof} ...
6
votes
1answer
50 views

Can an environment replace text within it during compilation?

Esperanto uses an alphabet that is largely ASCII, but also includes the letters ĉ, ĝ, ĥ, ĵ, ŝ, and ŭ. At the same time, some ASCII letters are not used. When you're limited to just ASCII there's a ...
1
vote
1answer
25 views

argument in newenvironment

I am trying to write a newenvironment that would be a wrapper for code layout, using minted. So far, I tried that: \documentclass[a4paper,12pt]{article} \usepackage[utf8]{inputenc} ...
4
votes
1answer
96 views

Use newcommand in newenvironment

I want create an environment with newenvironment that does the following: it evaluates the height of the environment and then prints it as many times (textheight/height) as will fit upon one page. ...
3
votes
1answer
189 views

How to change the behavior of user-defined environments using overlays?

first I have to give a link to a related question+answer. I am trying to create a beamer presentation and defined an environment. The environment has an optional parameter and I want that beamer sets ...
2
votes
1answer
41 views

Defining a synonym for an environment name

I'm currently writing some assignments where I need to embed code fragments. I already found the listings package for that, which works fine. My "problem" is, that I want to ...
6
votes
1answer
91 views

How to track a page change within an environment?

I'm trying to define an environment that can automatically detect when the material within it moves to a new page, reprint one of its arguments at the top of the new page, and change how it closes as ...
1
vote
1answer
30 views

Number theorems with chapter number

I use declaretheoremstyle to define a theorem environment, and print a list of theorems in the end of my document: \documentclass[12pt]{book} \usepackage[english]{babel} ...
0
votes
2answers
23 views

Terminate environments within environment in class function

I'm writing a class for a document, that inherits from article, and I encountered a problem with this: the document should be all in two columns, except the abstract. For the two columns, I use the ...
5
votes
1answer
165 views

Adjust vertical spacing for any combination of text, equations and custom environments

Edit I completely rewrote the question thanks to @pluton's comment. I have a couples of documents which have to fit on two pages. Some of them are short, so nothing needs to be done. But for some ...
0
votes
1answer
24 views

use of “chemmacros” package give errors when define a newcommand

I am using chemmacros package to write chemical symbols in my thesis. (I am using Easy Thesis template with book class). I added these packages (as below) at the top of thesis.cls file ...
3
votes
1answer
32 views

Remove repeated “Theorem (” in the list of theorems

I use declaretheoremstyle to define a theorem environment, and print a list of theorems in the end of my document: \documentclass{article} \usepackage[english]{babel} ...
3
votes
3answers
106 views

How to easily write conditional pages? [closed]

Is there any easy way to make latex write only some of the pages? My current idea is to make a function using the ifthen-package in the following way: \newcommand{\WhatDoYouWantToWrite}[1]{ ...
1
vote
0answers
75 views

Tilde symbol inside an environment

I have set a new matcode environment in order to have some matlab code in my .tex file, using the matlab-prettifier package (combined with the listings package). However, I have a problem with the ...
4
votes
1answer
24 views

Pass options in verbatim environment inside another environment

I want to define a new environment (here testenv), which is going to include text in verbatim mode. So, I have the code: \documentclass{article} \usepackage[english,greek]{babel} ...
5
votes
1answer
49 views

Uppercase whole \newenvironment

I am trying to uppercase a whole new environment without success with the code below : \newenvironment{upc}{ \MakeUppercase\bgroup } { \egroup } Here is an example : \begin{upc} 23 ...
11
votes
3answers
27k views

Footnote in tabular environment

It seems as if footnotes would have only a problem with the table environment but in my minimal example non of those answers Footnotes in Tabulars? Footnote in table seem to work for the tabular ...
3
votes
0answers
18 views

Cannot wrap align and align* [duplicate]

I am used to using \newenvironment to wrap an environment: \newenvironment{wrappedequation} {Look out for the equation! \begin{equation}} {\end{equation} Phew, it's over.} This ...
5
votes
1answer
59 views

Conflict between NewDocumentEnvironment and enumerate

I have the following document: \documentclass{article} \usepackage{enumerate} \usepackage{xparse} \newcounter{probctr} \NewDocumentEnvironment{prob}{o} {% \par \addvspace{.15in}% ...
20
votes
5answers
3k views

How to prevent paragraph breaks after theorem environments?

By default, the list environments (such as itemize) have the nice property that if you add a blank line after it, it starts a new paragraph, and if you don't, the paragraph continues. So The ...
9
votes
1answer
509 views

How to create a framed proof attached to a theorem?

I am trying to create a customized "proof" environment attached to a theorem. It looks like this: So there is first the theorem, and then a gray bar starts on the inner margin. It ends, when the ...
5
votes
2answers
75 views

Display enviroment differently for one use vs. two

My issue can be boiled down to this: \documentclass[10pt,oneside]{article} \usepackage{enumitem} \newenvironment{mygroup}{ \vspace{.15in} \textbf{\large MyGroup Heading} }{ } ...
2
votes
1answer
63 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 ...
4
votes
2answers
72 views

Compile error with redefined bmatrix and align environment

I just spent a couple of hours finding the reason for compiling errors in the last example in here: \documentclass[a4paper,draft=true, headsepline=on, twoside , 11pt, ]{scrbook} ...
2
votes
1answer
44 views

PGFplots within Environ format mistake

I try to write an environment for a simple barplot with pgfplots to reduce the needed markup. For that I use the environ package. For some reason tikz complains about a format mistake at the ...
3
votes
1answer
82 views

Which Latex environments are supported in Markdown and pandoc?

Does anyone know which Latex environments that are supported in pandoc when converting Markdown to html? I have tested equation, align, alignat which seams to work, so is there e.g. a family/kind of ...
2
votes
1answer
54 views

How can I use TiKZ to design comments in the margin of an environment which allows a pagebreak?

To distinguish different classes of environments, I use the environment shaded from the package framed. Then, I would like to design a corresponding environment using TiKZ where a line with a ...
11
votes
3answers
340 views

End \verbatim command

The verbatim environment is used to display LaTeX commands instead of having them executed. To display a single command in-line, the \verb|| command can be used. To display a whole block, we can use ...
3
votes
1answer
30 views

edit an enviroment to add to a new extra parameter

I'm trying to define a new \newenviroment but I'm having some problems. I need an enviroment that uses a counter and uses an extra parameter to write some text. I'm working with this enviroment: ...