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

5
votes
2answers
128 views

Comment-like environments and spacing

I often need to "turn off" environments. One way I do this is below in my minimal working example: \documentclass{article} \newenvironment{nothing}{\setbox0\vbox\bgroup} {\egroup} \begin{document} ...
3
votes
1answer
44 views

Footnote environment (memoir, article or amsart)

Is there a footnote environment? Few cases are known% \begin{footnote} The first experiments date back to 1912, when\ldots A second paragraph. \end{footnote} Context I have a customized ...
0
votes
0answers
32 views

highlighting of \begin{} and \end{} in TeXworks

I previously worked in TexShop, where I could for example click on '\begin{enumerate}' and the corresponding '\end{enumerate}' would be highlighted in the same colour. The same went for math mode, ...
1
vote
1answer
38 views

Replacing figure with figure* globally in Pandoc-created documents

I use Pandoc to create TeX files as chapter templates that are then fed back into Pandoc to create the final PDF. This sets some limitations, since some of the ways Pandoc writes TeX is hard-coded. ...
2
votes
1answer
30 views

New environment with parameter for caption [duplicate]

This is my first attempt to define my own environment. I fail with the number of parameters. LateX complains Illegal parameter number in definition of endperformance. This should be a standard ...
0
votes
1answer
76 views

\leftbar color specification

I'm trying to use the \leftbar feature, but I would like the document to support two different bar colors. This issue gets the color set, but only a single global color. I would like some \leftbar ...
10
votes
2answers
244 views

list of all used commands in compiled *.tex-documents

Is it possible to get a list of all the commands used in the compiled documents? I mean, if I use in my various .tex-documents commands such as \emph, \section, \cite, \begin, \documentclass, ...
2
votes
1answer
33 views

Determining whether a line is inside an itemize or enumerate environment

I would like to be able to tell whether a line is inside \begin{itemize} ... \end{itemize} or \begin{enumerate} ... \end{enumerate}. My need for this stems from incrementing a counter for the ...
2
votes
1answer
24 views

tabulary fails inside another environment

The tabulary package works fine in the setup below when I write out the table header explicitly. But when I wrap the exact same commands inside a custom environment, TeX halts at the \par, with this ...
5
votes
4answers
81 views

Change Content Font in tabular Environments

I am trying to change the font in the content of all of the tables in a document from a serif font to a sans-serif font. Specifically, I need something that can be applied to tabular and tabular* ...
0
votes
0answers
31 views

Is it possible to revert a line break after an environment?

Most environments seem to automatically break a line after them. This of course makes sense but I am having a case where I would like start writing in the same line where the environment (minted) ...
3
votes
2answers
40 views

Environment definition error

I am attempting to create my own wrapper for a tikz image but the output is not as expected. Here is the code \documentclass{article} \usepackage{tikz,lipsum, wrapfig} \newenvironment{wraptikz}[4]{ ...
0
votes
0answers
25 views

NewDocumentEnvironment causes extra row [duplicate]

When I use NewDocumentEnvironment of xparse and place a table to be inside this environment, I get an extra row at the end. Same code does not cause extra row in standard newenvironment. Is there a ...
1
vote
0answers
22 views

vim-latex: Environment mapping with arguments

Is it possible to use <F5> to enclose in an environment with arguments? For instance, if I type enumerate and then <F5>, I get the following \begin{enumerate} \item <cursor> ...
0
votes
1answer
44 views

How can I create a problem environment where I specify the problem number?

The ams package's \newtheorem{prob} doesn't work here (without resetting the counter every time I want to skip a problem}. It would be nice if I could use something like \begin{prob}{2-5} Some ...
6
votes
2answers
367 views

How to rename or “copy” a latex environment

I want to rename or "copy" the enumerate environment twice in order to have two different named enumerate environments. E.g. \begin{questions} \item lorem ipsum \item lorem ipsum ...
2
votes
0answers
32 views

Wrapper around `picture` environment causes page break [duplicate]

A picture environment at exactly the size of the text area can fit snugly on one page. However when I replace the environment with a wrapper environment with exactly the same definition, it takes two ...
6
votes
1answer
201 views

Why do these three changes fix this equation-numbering error?

When I use \equation...\endequation instead of \begin{equation}...\end{equation}, all equations have the same number (I know this isn't best practice for environments; I'm trying to understand the ...
11
votes
2answers
250 views

Extract source code on the fly to a file?

I'm trying to create a programming text to use for my students. My goal is to have an environment (say, "code", for instance), so, if I type the following in my .tex file: \begin{code}{Sample script} ...
2
votes
2answers
51 views

How to “align” the LyX aligned math environment

I frequently use the aligned math environment in LyX to typeset my equations. However, if I want to save space on the page and set two equations simultaneously in the same aligned math environment, ...
2
votes
1answer
31 views

Switching between wrapfigure and figure environments

I'm trying to realise switching between wrapfigure and figure environments, using boolean control. But for some reason wrapfigure does not do what it should do - be wrapped, instead it is placed in ...
2
votes
1answer
30 views

\ref to existing \label do not works, but index and url yes

This is my code and my results: \begin{figure}[h!] \label{fig:ppe_xyz} \begin{lstlisting} §$ppe_x$§ = ppe(§$A_x$§, s, order, overlap, H); §$ppe_y$§ = ppe(§$A_y$§, s, order, overlap, H); ...
4
votes
2answers
61 views

Reset counter at beginning of proof

My goal is to get a new claim environment which automatically numbers. This is fine - I can make a counter, define a claim environment and claimproof environment which number automatically, and this ...
2
votes
2answers
37 views

Changing Abstract name does not work

Here is my MWE: \documentclass[11pt]{article} \usepackage{fontspec,xgreek,polyglossia} \defaultfontfeatures{Mapping=tex-text} \setmainfont[Mapping=tex-text]{Liberation Serif} ...
3
votes
2answers
83 views

Including figures in custom environments.

In my preamble I have the following custom environment that is counted. \newtheorem{exmp}{Example}[section] When I call this in the text I always write the following piece of code, \begin{exmp} ...
2
votes
2answers
74 views

How to expand ExSheets question environment to show user-defined blank space for solution?

This is my minimal not-working example: \documentclass[a4paper,10pt]{book} \usepackage{mdframed} \usepackage{exsheets} \newenvironment{exerciseWithSpace}[1]{\begin{question}}{\end{question} ...
4
votes
1answer
54 views

\command without {} ending at the end of the line?

In a work, I have to write a lot of dialogue. This is my MWE: \documentclass{article} \newenvironment{dialogue}{% \noindent% \newcommand\one[1]{\textit{##1}\newline}% ...
1
vote
2answers
35 views

I want to set first paragraph of text environment to no indentation

I am using evironments to typeset some paragraphs of text with different fonts. I want the first paragraph after \begin{environment} to have no indentation. My code is ...
3
votes
1answer
63 views

How to define a new environment of two text blocks with number?

Hi, I want to define a new environment like the figure above. It has two text blocks with different background color. Block 1 has a short numbered title, such as 'Note' or 'Definition'. Block 2 has ...
4
votes
1answer
76 views

How to wrap a `\newcommand*` into a multi-paragraph environment?

As stated elsewhere, it is usually quite recommended to use the starred \newcommand* instead of \newcommand since this helps finding missing }s by disallowing paragraphs in its argument. Every now and ...
3
votes
2answers
192 views

How can define an acknowledgement section in two languages

I am writing my LaTex document and I would like crate an acknowledgementsection in two languages: first written in my mother tongue (Italian) and then in English as the rest of the document. I'm ...
3
votes
2answers
138 views

ConTeXt: Change emphasis font when used within blockquote environment

Background Looking to change the font for emphasized text within a specific type of macro block (environment). Only emphasized text should change; any text within the environment that is not ...
2
votes
0answers
22 views

How to get align environment in the same line as text [duplicate]

I would like to have an align environment which is not automatically written in a new line. For example in the following code, the formulas should appear in the same line as the itemize-dot or the ...
2
votes
2answers
90 views

Beamer - Use custom environment on TOC frames

I defined a environment slide based on frame to get rules beneath the headline and above the footer and get the section in the frametitle. \newenvironment{slide}[1] {\begin{frame}[environment=slide] ...
4
votes
2answers
152 views

Two abstracts in two languages in Elsevier class

I have a problem with putting two abstracts under the title of my article in elsevier class. I am using this code: \documentclass[preprint,10pt,3p]{elsarticle} %% ...
1
vote
1answer
42 views

Automatic table of contents entry from environment [closed]

I have created an environment to be used in creating examples in my text. The class is one specified by the publisher Wiley, basically a book. The environment currently takes the name of the example ...
0
votes
0answers
24 views

Code for generating assignments with questions, sub questions and sub-subquestions

I wish to generate a question paper for an assignment, to be given to the students. Apart from the usual notes about the assignment, I wish to have question numbering, along with sub-questions and ...
2
votes
2answers
56 views

\indent doesn't work as expected in custom nested environments

I have a custom environment that I use as follows: \documentclass[12pt,draft]{memoir} \usepackage[dvipsnames,usenames]{color} \definecolor{shadecolor}{gray}{0.85} \newenvironment{Myenv} ...
1
vote
1answer
29 views

Newenvironment, multicol and space problem

Why jumping a line cause a problem here ? \documentclass{article} \usepackage{multicol,xparse} \NewDocumentEnvironment{DeuxCols} { D<>{30pt} O{.5pt} mm }{% ...
6
votes
2answers
290 views

Square brackets [ ] as first text inside environment

I had a case where I wanted do start a text with a square bracket inside an environment. It was interpreted as an optional argument. My workaround was to insert a {} to separate that. Is that the way ...
2
votes
0answers
56 views

Spoilers in Web-Accessible Pdf Documents?

A highly regarded professor of mine is currently writing a graduate mathematics textbook in which he has given the book a theme of ``do it yourself'' mathematics. He has asked me to review the book ...
1
vote
1answer
24 views

Redefine an environment with options

To write a report I am using the package wrapfigure which generates figures on a side and the text flows around it. It is not news that it is very difficult to handle the spacing and positioning of ...
5
votes
3answers
146 views

newenvironment and restatable

I'm trying to create a new enviroment using restatable, but it doesn't work. What am I doing wrong? \documentclass{article} \usepackage{amsmath} \usepackage{thmtools,thm-restate} ...
3
votes
1answer
91 views

Theorem style: All letter uppercase

What do I have to do, the create a theorem environment, where the theorem name has a different style than the standard one? I want the name to be all capital letters. Obviously \newtheorem*{new ...
0
votes
1answer
31 views

linespacing local font environment [duplicate]

I have a multi-paragraph section of tiny-font within a larger document of normal-size text. The last paragraph within this section seems to get double spacing: I can fix the problem by putting a ...
6
votes
2answers
90 views

How can I change the behavior of single letters in an environment?

I'm working with a Ktunaxa, a First Nations language that uses the symbols ȼ and ⱡ (and the uppercase equivalents Ȼ and Ⱡ, but not c or l. How can I create an enivronment that would change all c and ...
3
votes
1answer
76 views

Defining an environment which includes a bibliography

Consider an environment which is intended to house a variety of content related to an author. Content may include name, affiliation, a paragraph which is a short biography, as well as, a series of ...
3
votes
1answer
67 views

Producing expandable environments with only optional arguments with LaTeX3 syntax

I am trying to create a new document environment to complete the assembly of a table (simplified for MWE) but I am having a problem combining an expandable environment with an optional only argument. ...
1
vote
0answers
41 views

Replace a nested LaTeX command with multiple arguments [closed]

I'd like to replace the LaTeX command \teilseiten{left col width}{left col text}{right col text} by an nested environment. The problem is, that the second and third argument of \teilseiten contains ...
4
votes
1answer
47 views

Need two environments in table

I want to set up a table with the column headings centered, but the data right justified, without using \multicolumn for every single cell in the heading, rather I want to use a locally global ...