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

(Is it wrong to) Use commands to begin and end equations (?) [duplicate]

I'm helping a professor write the second edition of his book, so I'm working with a lot of "old" code and bad practices. Something I've found is that he has defined macros for beginning and ending ...
2
votes
0answers
36 views

How do I make unruled footnotes within an environment?

I have a single environment, fancyfoot, in which I would like footnotes to have no rules. \documentclass{memoir} \usepackage{lipsum} \newenvironment{fancyfoot}{ \renewcommand{\footnoterule}{} ...
2
votes
2answers
58 views

Definition of a macro with multiple arguments and usage of \csname

Why does the following code not work ? \Requirepackage{amsthm} \renewcommand\newtheorem[2]{% \NewEnviron{\csname #1\endcsname}[1]{% ##1 : \BODY } } I have seen examples of the use ...
3
votes
2answers
28 views

How can I print beginning and end values of a counter within an environment?

I'm working on a formatting system for standardized tests. Within each section of a test, there are groups of consecutive questions that I might choose to contain inside an environment. ...
1
vote
1answer
15 views

Use macro as totcount counter name

In the top level of the document environment, a macro defined (using \def) can be expanded into the name of a totcount counter. This, for some reason, does not work inside an environment definition. I ...
8
votes
3answers
847 views

Making an anti-clockwise circled arrow around a + sign in a math environment

\makeatletter \newlength\@SizeOfCirc% \newcommand{\CricArrowRight}[1]{% \setlength{\@SizeOfCirc}{\maxof{\widthof{#1}}{\heightof{#1}}}% \tikz [x=1.0ex,y=1.0ex,line width=.15ex, draw=black]% \draw ...
2
votes
1answer
37 views

NewEnviron, \BODY and lstlisting [duplicate]

I was trying to understand egreg's answer to Hide content to show later, and I noticed that there were some problems when using lstlisting or tcblisting environments inside the solution environment ...
1
vote
1answer
36 views

Legrand Orange Book template Example colorbox from black to ocre

In the Legrand Orange Book template, I would like to change the begin and end of the Example Box color from black to ocre: and Here is the code from the structure.tex file where the example ...
3
votes
2answers
56 views

Is it possible to “scan” the text within an environment?

Say I have an environment env which is used like this: \begin{env} *Text* \end{env} Is it possible to "use" *Text* in the definition of the environment (top or bottom part) - similar as a ...
1
vote
1answer
33 views

“Problem definition” environment

Is there such a thing as an environment for defining problems? See this picture for an example of what I want to achieve: Thanks!
1
vote
0answers
13 views

Is it possible to include a lstlisting code block inside an lstlisting? [duplicate]

I am trying to include a LaTeX code within an lstlisting. But the problem is that the LaTeX code includes an lstlisting, so the \end{lstlisting} within the included code is terminating the actual ...
4
votes
2answers
84 views

Compilable custom environment when in the body text becomes uncompilable when defined as a new environment

I attempted to make a table which has gray backgound cells except for the first column and the first row colored blue. The following code successfully generates the desired output (although I do not ...
10
votes
2answers
122 views

Strikeout all text, including enumerated lists

Is it possible to define an environment that strikes out all text, even in enumerated lists? I am basically trying automate what is currently being done manually in Microsoft Word. I have a body of ...
0
votes
0answers
28 views

Predefining placement of figures and tables in custom package

I am trying to define figures in a new custom package using \newenvironment{name}{begin defs}{end defs} and minipage command (code is given below). if i create a \newcommand{\name}{defs} (named as ...
3
votes
0answers
38 views

Extensions to the standard environment, what is out there?

\NewDocumentEnvironment from the xparse package allows accessing environment arguments also in the code that is supposed to go after the content. environ and newenviron allow referring to the ...
2
votes
0answers
40 views

Can the hygiene problem of environ and newenviron be eliminated completely?

The packages environ and newenviron both provide an alternative to the standard environment macros included with LaTeX. The main difference is that they make it possible to refer to the environment ...
4
votes
1answer
64 views

What are the uses of being able to refer to an environment body by a macro?

The packages environ and newenviron both provide an alternative to the standard environment macros included with LaTeX. The main difference is that they make it possible to refer to the environment ...
3
votes
0answers
42 views

wrap around task environment not working

I am trying to create an environment wrapping a task environment (from the tasks package). To build the new environment I am using the xparse package. \documentclass{article} \usepackage{xparse} ...
15
votes
1answer
245 views

LaTeX programming Inheritance with \newcommand \newenvironment \renew… etc

I'd like to create (or renew) several LaTeX commands and environments, and understand how it works. One of my new environments would be equivalent to \begin{quotation}. So, imagine my \begin{foo} ...
4
votes
1answer
80 views

Macro for creating a table

I want to have a macro that creates tables of a specific type which specialize in multiple choices questions. The required command \createtable{#1}{#2}{#3} has three arguments: The total number of ...
4
votes
1answer
75 views

Intended Paragraphs Inside Environment

I have decided to come back to beautiful LaTeX typesetting after several years. I have just decided to hone up my LaTeX skills but have found out that it will be not easy. Here is my question: I have ...
1
vote
0answers
67 views

what is the change in macro expansion when using environ and newenviron as compared to the standard environment

The packages environ and newenviron both provide an alternative to the standard environment macros included with LaTeX. The main difference is that they make it possible to refer to the environment ...
4
votes
1answer
38 views

\AtBeginEnvironment not accepting parameters in the code

etoolbox's docs say in the section on environment hooks: Parameter characters in the code argument are permissible and need not be doubled. However, this won't compile: ...
3
votes
1answer
24 views

Using apptocmd inside newenvironment

I try to produce a document containing an exam and the associated correction. I want automatic hyperlinks from the question to the associated answer and vice-versa. Using the solution given by ...
2
votes
1answer
48 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
27 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 ...
4
votes
1answer
90 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} ...
3
votes
1answer
25 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 ...
1
vote
1answer
17 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 ...
0
votes
1answer
35 views

How can i write the text show in red rectangle?

How can i write the text show in red rectangle?
4
votes
2answers
132 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
31 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 ...
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
23 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
207 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 ...
1
vote
1answer
23 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
34 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
54 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
39 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
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} ...
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 ...
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 ...
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} ...
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} ...
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 ...