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

2
votes
1answer
47 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} ...
4
votes
1answer
23 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
56 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
98 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. ...
2
votes
1answer
43 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 ...
1
vote
1answer
34 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
168 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
25 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
34 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
108 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
84 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
26 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
51 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 ...
12
votes
3answers
28k 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
63 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
516 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
64 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
78 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
99 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
57 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
363 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
35 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: ...
0
votes
1answer
39 views

Unwanted Vertical Space before figures in IEEE Tran Latex document

I am trying to insert .eps figures in my IEEE tran latex document. My figures are shifted down from the original position. Although the figure captions are in their desired positions. I have used word ...
1
vote
0answers
14 views

Symbol at the end of an environment [duplicate]

I'm putting a diamond symbol at the of a remark by use of \usepackage{amsthm} ... \newenvironment{rem}{\begin{remark}}{\hfill$\diamond$\end{remark}} However when the rem environment is ...
4
votes
2answers
183 views

Need a Macro for Tables - independent of row and column size

I have created the following macro for Table: \newcommand{\createtable}[7]{ \begin{table}[htbp] \begin{tabular}{|p{8cm}||p{8cm}|} \hline \begin{center}\textbf{\cellcolor{Orchid!25}{#1}}\end{center} ...
3
votes
2answers
82 views

Environment which sends text conditionally to an appendix?

I am writing a paper and would like an environment that has the following property. If some flag is set to "true" in the preamble, all text wrapped in that environment is sent to the appendix. If the ...
3
votes
1answer
17 views

modification to comment environment

I'm using the comment package, in my preamble I have \specialcomment{notes}{\begingroup \color{Blue}}{\endgroup} so that when I want to comment my text I write \begin{notes}...\end{notes} to get a ...
4
votes
2answers
254 views

Checking in LaTeX for a specific character?

I have a LaTeX problem that I cannot solve by myself. I have a repeating arrangement of characters which I want to format automatically in LaTeX. 1H-NMR (400 MHz; DMSO-d6): \textdelta 12.41 (s, ...
2
votes
2answers
35 views

How can I reduce the space around alltt environment blocks?

How can I reduce the space around all alltt environment blocks? \documentclass{article} \usepackage{alltt} \begin{document} Test1 \begin{alltt} some code \end{alltt} Test2 \end{document} This ...
2
votes
1answer
83 views

How can I get a count of the optional arguments with xparse?

Question Is it possible to get and store a count of the optional arguments actually passed to an xparse declare argument/environment? Purpose Regardless of the number of arguments provided ...
2
votes
1answer
86 views

LaTeX command or environment to selectively print one out of several given options

I'm currently wasting my time by trying to create a proof-of-concept class to show that writing our university's curricula with LaTeX instead of MS Word would have some benefits. Since these curricula ...
1
vote
1answer
30 views

Can I make an environment which treats the first paragraph differently to the rest?

I am trying to make a new environment which creates a hanging indent on the first paragraph only but leaves the other paragraphs indented: My code for the above image is: \begin{hang} ...
3
votes
1answer
48 views

Multiline Chain of Implications

I'm new in this forum. Is it possible to create the chain of implications as shown in the image attached, in latex ? Thanks in advance. Tatin
0
votes
3answers
35 views

Problem with lstlisting enviroment

I'm writing \documentclass{beamer} \usepackage{listings} \begin{frame} \begin{lstlisting}[language=bash] #!/bin/bash echo "Hello,world!" \end{lstlisting} \end{frame} But the output ...
5
votes
1answer
140 views

how to define a label in a new environment?

I would like to define a new environment for writing exercices. Moreover, I would like to use \ref and \nameref (with hyperref package) to build a table of exercise numbers and names. I wrote the ...
6
votes
1answer
103 views

Tasks in custom Environment

I need to wrap a tasks environment inside a custom \NewEnviron. Apparently, tasks chokes on code besides its \task or \item due to the way it handles its own environment body, presumably causing it to ...
4
votes
1answer
35 views

How to set a newenvironment to skip words by flag?

I want to create a environment to include some words, but hide it when a flag is set up. However, I cannot put \begin{comment} \end{comment} into \newenvironment for some reason. How should I do this? ...
0
votes
1answer
47 views

Customizing enumerate list with item label as parameter of new environment

I want to define a new environment which would allow me to have a like-enumerate list, i.e. have the \items numbered like in an enumerate environment and change the item name by the one given as ...
4
votes
4answers
208 views

How can I typeset an environment and its literal equivalent in an environment?

This is a follow-up to the question: How can I typeset a command and its literal equivalent in an environment? It would obviously be useful to handle environments too. I imagine something like the ...
4
votes
2answers
42 views

Paragraph indentation after lstlisting environments

I tried to indent first paragraph after a customized lstlisting environment \documentclass{article} \usepackage{listings,lipsum} \lstnewenvironment{mycode}{}{\par} \begin{document} \lipsum[1] ...
9
votes
2answers
225 views

How can I make a command available inside another command's argument?

When I define an environment with \newenvironment, I can use newcommand inside the "before" part, to make commands available to the code inside the environment. Is this possible with simple commands? ...
7
votes
5answers
690 views

How can I limit the scope of a \renewcommand instruction to “table” environments?

I want to use \renewcommand{\arraystretch}{1.2} to adjust the space between the lines in my table. Since I have used matrices all over my paper (and this command also affect the matrices) I want to ...
3
votes
1answer
31 views

Custom environment with horizontal indentation

I am trying to create a simple environment that consists two parts: bold text followed by a rightarrow (multiple) lines of text with indentation, below the bold text What I have so far: ...
1
vote
1answer
33 views

Environment that eats up (ignores) text inside it [duplicate]

I want to replicate the environment comment from the comment package: \begin{comment} Hidden stuff. \end{comment} which prints just nothing, instead of using % to comment things out. I can do it ...