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

6
votes
2answers
78 views

copy and reuse the content of an environment

is there a way to embed an text in several environments (or structures, \chapter, \section etc.) in one file and "copy"/insert the content of single environment items in other files? i've noticed the ...
3
votes
1answer
31 views

Minted In A New Environment

I'm trying to enclose Minted in a new environment as follows: \documentclass{article} \usepackage{minted} \usepackage{mdframed} \usepackage[varqu]{zi4} \definecolor{codebggray}{rgb}{0.95,0.95,0.95} ...
4
votes
1answer
76 views

Getting pages where an environment is located

I am trying to create a new environment that sticks a watermark in the background. Specifically, I have something like \usepackage{background} \newenvironment{\watermarked}{ ...
5
votes
1answer
47 views

New environment for minipage and colorbox

I would like to create a new environment that would automate the following code: \setbox0=\hbox{\begin{minipage}{5.8in} \color{black} \begin{verbatim} <Some verbatim text here> \end{verbatim} ...
2
votes
1answer
65 views

Why the renewcommand doesn't work as I expect?

I re-defined two environment \newtheorem{exmp}{Example} \newenvironment{examp}{\begin{exmp}}{\renewcommand{\proofname}{Sol.}\end{exmp}} ...
1
vote
1answer
137 views

Acrostic Environment

I tried to wrote the code of an environment for acrostics, using cenverse and boldfirst, but it doesn't work (probably because cenverse use // and boldfirst not). \newcommand\dob[1]{\textbf{#1}} ...
1
vote
0answers
18 views

Making a textpos command being transparent

I am defining my own margin notes command and I have a question about making a command "transparent". To be more clear, I have the following code : \documentclass{article} ...
7
votes
2answers
96 views

convert a \newcommand to \newenvironment

I have defined a command as follows \newsavebox{\textsix} \newcommand{\bottomr}[1]{\sbox{\textsix}{\parbox{11cm}{\begin{flushright} #1 \end{flushright}}}} which save the parameter (text) of the ...
2
votes
2answers
44 views

set section environment to be math only, amsmath's begin{gather}

I want to create a small formulary, and for that virtually every line has to be math formulas. I use the gather-environment from the package amsmath, for example: ...
2
votes
1answer
35 views

Square brackets in in the `description' of the theorem environment [duplicate]

The following code works fine \begin{theorem}[Euler] Blah \end{theorem} But whenever I try to use square brackets in the description I get an error. \begin{theorem}[The set $[0, 1]$ is compact] ...
2
votes
0answers
87 views

Checking if first portion of an environment's content is empty

Motivation: I am working on a very personalized Exercise/Answer package for my colleagues. The exercise, exsheets, etc. packages don't do what I need. To accomplish this, I create an exercises ...
2
votes
1answer
50 views

Keep float out of a environment (for example definitions)

I knew that floats float around and sometimes are placed far away from where one wants them to be. With the times I learned to work with it, and there are already many posts about it. I have a kind ...
2
votes
1answer
50 views

Can a chapter style environment be used for appendix formatting?

I have started including appendices in my thesis to collate common information for each separate \part section so as to make the script concise and to the point. I am using a KOMA-Script document ...
3
votes
2answers
25 views

having custom caption in listing

I would like to have my custom name for my listing, how can I do that. here is my code: \documentclass[12pt,a4paper]{scrreprt} \usepackage{listings} \lstloadlanguages{R} \lstset{% general command ...
2
votes
0answers
21 views

Remove bibliography headings with multibib and tocbibind

I use multibib which creates two families of citation commands: pri and sec. I would like to get rid of bibliography headings for the \bibliographypri and \bibliographysec commands while keeping the ...
4
votes
1answer
37 views

Reducing the distance in textbf environment

I want to introduce a notation for concatenating vectors in a manuscript that I represent vectors with bold characters, $\textbf{x}$. The problem is defining it like $\textbf{x}:\textbf{y}$ introduces ...
4
votes
1answer
69 views

Detect actual start of text

I have conditional which is sometimes suppressed, and if it gets typeset needs to be noted. If the conditional text begins with an environment which adds vertical space prior to the actual start of ...
3
votes
2answers
108 views

tikzpicture to create a first page with an image in background taking the whole page

I am trying to create a newsletter with Latex, but I am not expert at all. My goal is, for the moment, to create a first page (the cover), with an image in the background, and some text overprinted. ...
3
votes
1answer
41 views

\newlist vs. \newenvironment for defining an individual list style

as far as I know, there are two ways of defining an individual list style: 1) Use the enumitem package and the \newlist and \setlist commands 2) Define an individual environment like the following ...
5
votes
2answers
77 views

Collecting contents of LaTeX environment

I have the following for collecting contents of an environment and printing them later, it works but for my real task i want to use the environ package because i need to be able to have access to ...
2
votes
1answer
59 views

(Re-)Setting the currents section name from within the section

I am trying to reset the currents section from somewhere "whithin" the section, but after the \section command. Is that even possible with the way LaTeX works? I know, it is possible to use the title ...
0
votes
0answers
38 views

Help with “environment” problem

I am new to LaTeX. I want to write a report which will contain math symbols and equations. I began like this \documentclass{article} \begin{4 week report} \ body \end{4 week report} ...
6
votes
1answer
83 views

Macro, new command or new environment for code?

I am using the listings package to typeset code. I have defined a custom style using \lstdefinestyle{verbo} and then typeset code in a lstlisting environment as in the following MWE. ...
5
votes
2answers
220 views

(La)TeX equivalent of MS Word's “Don't add space between paragraphs of the same style”

I'm using a quote environment to add some references at the beginning of sections with two custom commands. If I have more than one reference, the \list nature of the environment automatically adds ...
0
votes
0answers
14 views

image into framewithtitle environment (memoir class)

I need to add image or figure into boxes for my phd document, so i try using the framewithtitle environment defined in page 276 of memoir class documentation. % !TEX encoding = UTF-8 Unicode % -*- ...
5
votes
1answer
41 views

Have something like figure but with its own counter and listof

Given the following MWE: \documentclass[english]{scrartcl} \usepackage{syntax} \begin{document} \begin{figure} \begin{grammar} <example> ::= \[[ \lit{def} <identifier> \lit{=} ...
4
votes
1answer
53 views

Redefine verbatim environment

I have a text with source code, which I would like to display. I am using pandoc, so I have to use either verbatim or listings enviroment. Unfortunately, I can't use listings package (due to ...
0
votes
1answer
31 views

Automatic parsing/extraction of single-argument commands from input (for use in new environment)?

I'm not sure whether this is in principle possible, so let me try to explain; consider this MWE: \documentclass{article} \usepackage[showframe]{geometry} \usepackage{tikz} \usetikzlibrary{calc} ...
1
vote
1answer
70 views

How to make my sty file work only inside a environment?

Say for example, i have a bibpattern.sty which consists of some latex commands (like \COMMENT). I want this bibpattern.sty to work only inside \begin{thebibliography} ... \end{bibliography}. The same ...
3
votes
2answers
37 views

How to align the new environment

I have to define the new environment, similar to the proof environment. I learned on our site how to define it, but I do not know how to customize it. In particular, I design a book by using gsm ...
4
votes
2answers
83 views

Setting vertical margins on top and below align* environment

I'm using the amsmath align* environment to format multi line formulas. Unfortunately, the environment adds a lot of margin before and below the formula. I found only one solution to get rid of this ...
5
votes
2answers
118 views

“itemize” or “enumerate” IN section headings

Is it possible to use lists WITHIN section headings, subsection headings, etc.? I wanted to do so like \documentclass[11pt]{scrartcl} \usepackage{enumerate} %... \begin{document} \section{My three ...
6
votes
2answers
41 views

Environ's body doesn't allow for making an \item

As part of a document process/workflow, it's easier to work with environments. However, in some cases the environment contents needs specific formatting. As such, it's convenient to use the environ ...
4
votes
1answer
38 views

Creating token blocks to hold environment contents and printing from them later

I have the following, works well for one toks block i.e \savedenvtoks but i want to create more toks blocks and i want the \savedenv to take a parameter indicating whichs toks block to add to, and i ...
1
vote
1answer
70 views

How to make an environment same as itembox environment in ascmac package by using mdframed package

I want to make the output same as what I can make from the code shown below. But for some reasons (e.g. some frames extend to multiple pages etc.), I do not want to use ascmac package but mdframed ...
12
votes
1answer
208 views

“Tape” environment in LaTeX

I have never defined an entirely new environment in a LaTeX document - I have only ever modified existing environments to suit my purposes. Now, however, I suddenly have a use for an obscure ...
9
votes
2answers
98 views

Collecting contents of environment and store them for later retrieval

I want to store contents of an environment and add them to a macro or command I could easily retrieve them, but I do not want to use the collect package. Are there any alternatives? ...
2
votes
2answers
56 views

How to write macros that behave like \item in an enviroment?

I am attempting to add an environment to a project that would take the following form: \begin{example} \source some text goes here to be used as an example. \target some more text goes here as a ...
1
vote
1answer
24 views

How to create an environment with its embedded commands?

I would like to create an environment with its commands which can be used like: \begin{myenv} \command1 text paragraph 1 \command2 text paragraph 2 \end{myenv} which translates to: ...
6
votes
1answer
85 views

How to place a figure in page margin beside a mdframe?

In my text I would like to use some icons in the page margin to label element types, e.g., an example or a theorem. The following picture illustrates this: My text is double-sided, so I would like ...
2
votes
1answer
29 views

How to define a custom environment caption for table of contents?

I want to define a custom environment example. This is not a problem at all, the only thing I humble upon is the caption (short title below the element) and its listing in the table of contents or ...
1
vote
1answer
56 views

Theorem style - define indentation

I have a real issue with defining my theorem style. I need indentation after the theorem, but cannot achive it. I google for hours and didn't find a solution. Hope you can help me. By the way, I'm ...
5
votes
0answers
50 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 ...
0
votes
1answer
110 views

Change words in a Tikz picture every page

I'd like to create a template, as below. But I'd like to make it so that I can have multiple pages of the same layout and be able to easily replace "Header 1" and "Header 2" with different words each ...
4
votes
2answers
88 views

changing font style/size for proof, adding a square after example

Is is possible to change font size/(or style) for a proof? I was also thinking to add a small hollow square at the end of every example to separate the text a little. Something similar that works like ...
3
votes
1answer
34 views

New environment type without automatic numbering

I'm trying do define a new environment using tabu as a building block. The reason to use tabu is that it will break nicely across pages for long tables. I would like to have some help on doing the ...
0
votes
1answer
52 views

Renew appendix command to remove blank pages

I'm using Steve R. Gunn's Thesis Class. My issue is that Latex insists on inserting a blank page after the first of my 4 appendices, yet at no other point in the document. I believe this is caused by ...
2
votes
1answer
23 views

Passing arguments to mdwlist environments

I'm trying to make a description list more compact. I figured the easiest way to do this would be to use mdwlist's description* environment. This reduces the spacing between list items. I'd also ...
4
votes
1answer
50 views

mdframed package conflicting with \bgroup, \egroup

I'm using XeLaTeX because of language problem. The following code has no problem: \documentclass{article} %\usepackage{mdframed} \newenvironment{mynote}{\footnote\bgroup}{\egroup} \begin{document} ...
6
votes
2answers
76 views

Include only specific environments

I wish to typeset a document and only include occurrences of one specific environment for the output. One thing I tried was using the comment package and putting \begin{comment}just after ...