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

3
votes
1answer
40 views

Printing Caption of an environment in text automatically

Consider the following situation Suppose that I have several environments, each with a caption. To be clear, suppose that I have the following environments: \newtheorem{theorem}{Theorem} ...
2
votes
0answers
85 views

Defining a screenplay dialog environment for breaking across pages

Edit: consider this a followup to the answer here http://tex.stackexchange.com/a/63847/64528 I'm trying to create a LaTeX/XeTeX template for screenwriting, specifically to output from an Emacs major ...
5
votes
2answers
48 views

Adding optional arguments to environment

I'm trying to understand and modify this code: \newtheorem*{nonamethm}{\nonamethmname} \newcommand{\nonamethmname}{} \newenvironment{genthm}[1] {\renewcommand{\nonamethmname}{#1}\nonamethm} ...
3
votes
3answers
58 views

Creating a new list Environment, how to change the length of \items

The code for the environment is bellow, For the longer lines in \list item how do I change the length of the \items so that it lines up with the date? Basically I want a kind of "margin" that is on ...
5
votes
2answers
76 views

Extra space after self-defined environment [duplicate]

I defined a new environment eq to simplify the equation, \newenvironment{eq}{\begin{equation}}{\end{equation} It works, but it seems that there is a extra space at the end of the environment, which ...
2
votes
1answer
56 views

Remove all proof environments

I have a document containing some proofs and want to create a version only containing the theorems (and corollaries and lemmas and examples and …), but no proofs at all. Is there an easy, automatic ...
9
votes
2answers
68 views

Transform \sepfootnotecontent into an environment

I am currently cleaning the code of a 1000-page book that contain hundreds of very long footnotes so I decided to move them into separate files using the sepfootnotes package. It’s easy to use: ...
1
vote
1answer
43 views

Custom spacing in aligned environment

How can I add an arbitrary horizontal spacing in an aligned environment? \hspace{} and \qquad don't work. \usepackage[utf8]{inputenc} %\usepackage[latin1]{inputenc} %Zeichencodierung ...
1
vote
1answer
37 views

global align parameters across items

I've read questions asking about align across multiple environments, but still am stumped about how I might address this situation. The following code: \section*{Solutions to Practice Problems} ...
5
votes
1answer
104 views

Lazy Evaluation in Forest Package?

I'm using the forest package to draw logic circuits, and I'm trying to customize the style. I want the inputs to be aligned, so I write this macro: \newcommand{\inp}[1]{[#1,tier=in]} But when the ...
2
votes
1answer
36 views

Using Forest Package in Newenvironment

I'm trying to use the forest package to draw circuits, so I want to define a "circuit" environment that is a wrapper around the forest environment. But defining a newenvironment runs into problems. ...
4
votes
3answers
113 views

create environment that resizes content

I want to create an environment that puts its content within a minipage as wide as the current page. The environment would work as follows: \begin{FitToWidth} HELLO \end{FitToWidth} and produce a ...
2
votes
1answer
141 views

Can I use phantom to hide a LaTeX environment (itemize)? [duplicate]

Is there a way I can use \phantom to hide the contents of an environment, such as itemize? This does not execute: \phantom{\begin{itemize} \item Hi! \end{itemize}} I'm ...
2
votes
1answer
82 views

How to make an item bolder in description environment

Does anyone know how to make an item bolder in description environment : i tried to add \textbf{ } like this \item [\textbf{{\textarabic{سورة الإخلاص }}}] I have the following segement of code, ...
0
votes
0answers
75 views

Defining a new environment for chapter

I would like to define a new environment for chapter. to looks like this or much better (good-looking) without using \chapter*{1\ \textarabic{سورة الإخلاص }} and ...
4
votes
1answer
50 views

Passing xticklabels to tikzpicture via an environment

I have some diagrams that need to be repeated numerous times in a document with slight variations, so I thought I would make an environment that generates the diagrams and pass the variations as ...
1
vote
1answer
57 views

How can I create a command or environment that starts and stops verbatim?

I am writing a simple LaTeX guide, aimed at editors of a student paper. The paper is for students of mathematics and physics at my university, and so we use LaTeX. Anyways, I want to include lots of ...
3
votes
1answer
57 views

Using lstenvironment in another environment

The following simple latex code doesn't seem to work for me and there seems to be no reason why: \documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage{listings} ...
6
votes
2answers
165 views

Is it possible to comment out an already defined environment?

I have defined the following environment for producing problem statements: \newcounter{psctr} \newcounter{probctr}[psctr] \NewDocumentEnvironment{prob}{o}{% \addtocounter{probctr}{1} \vspace{.15in} ...
3
votes
4answers
75 views

creating a newenvironment with cite

This is my first question here. I would like to create a new environment, call it "citar", which makes those things : basic "quote" features, + : open and close french quotes, get the text in ...
12
votes
1answer
113 views

Add another optional argument for an environment

I have defined an Example environment that I use as follows to produce a numbered example and send the example title to an example index: \begin{Example}[one]{Cooking eggs} To cook an egg, ... ...
0
votes
0answers
75 views

Alias normalbaselineskip to \\ in a tabularx environment

I'm still on my way to my key:value table, and this time, I'm trying to alias [\normalbaselineskip] to \\. I still want to use the standard \\. What I want is to consider \\ as [\normalbaselineskip] ...
3
votes
1answer
180 views

frame in NewDocumentEnvironment

With beamer frames, this does not work. \newenvironment{itemframe}[1]{ \begin{frame}{#1} \begin{itemize} }{ \end{itemize} \end{frame} } Adding fragile, environment=itemframe as an ...
0
votes
2answers
73 views

Change \textheight in function of width

Good day. I want define an environment that change the text height in function of the width \documentclass[a4paper]{book} \usepackage{lipsum} \begin{document} \the\textwidth---\the\textheight ...
0
votes
0answers
58 views

Automatically show verbatim content of a custom environment

I've defined an environment with \newenvironment, which I am mainly using for tikz diagrams. I have it set to dynamically change the margins, vertically and horizontally center the diagrams, and put ...
3
votes
2answers
79 views

Typesetting novel dialogue where one speaker has multiple paragraphs

I'm typesetting a novel wherein many characters have 2+ paragraphs of uninterrupted dialogue. Example: “Lorem ipsum dolor sit amet…tik. “Nullam orci dolor, porttitor a…julo? “Nulla nibh ...
4
votes
1answer
113 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 ...
1
vote
0answers
56 views

Floating Figure inside Environment

I have a problem while trying to use wrapfigure or floatftl in a typical Definition environment. More concretely, I try something like this: \begin{floatingfigure}[r]{5cm} ...
2
votes
2answers
2k views

Enumeration of equations in the double dollar math mode

How introduce enumeration of equations in the double dollar math mode (i.e. $$...$$)? Or even better, is it possible to make $$...$$ as a particular math environment, e.g. equation or align?
8
votes
3answers
587 views

What is the best way to do math inside LaTeX macros?

I'm interested in writing a little personal package (or sharing it if it's actually useful) to speed up typesetting Trigonometry. I'd like commands like ...
1
vote
1answer
115 views

Reset a renewcommand

I have found a Resumé template in Latex. I would like to change the following part of the template but my knowledge of Latex is not that extended. % Every \item can be followed by one or more ...
2
votes
1answer
72 views

Passing a string as argument in new environment

I'm actually trying to pass a string as an argument in a new environment, but it seems that it only takes the first letter of my string. Here's my code, where #1 is usually a path (for example ...
3
votes
1answer
42 views

New theorem with svmono

I have problems with the definition of the new environments which should be the same as the theorem evironment but unnumbered. If I write: \documentclass[envcountsame,envcountchap,oribibl]{svmono} ...
4
votes
1answer
30 views

Package `Versions' Warning: Redefining environment

I am using the versions.sty package and would like to process some text twice (or more times) in a different version configuration, but within the same document. So I use \excludeversion and ...
3
votes
2answers
193 views

How to mimic Turing Machine description in Sipser textbook

Introduction to the Theory of Computation by Sipser is one of the standard textbooks on theory of computation. To describe a Turing machine (TM) in high level, this book uses a variant of enumeration ...
5
votes
1answer
150 views

Insert something “Before the end of document”

I insert the name and licence with the command \nameofcompany at the end of my document like this: \nameofcompany \end{document} Now, I want to generalize it to some documents, for that I found ...
2
votes
1answer
84 views

How to define customize frames in beamer with newenvironment

I would like to change text distribution within each frame in my presentation beamer, I tried to use \newenvironment but every time I get an error: File ended while scanning use of ...
2
votes
1answer
64 views

Duplicate and modify section hierarchy

In a large thesis style document being prepared, there are certain parts (latex hierarchy \part{}) that are being treated as insertions of previously prepared work. This may include articles or ...
3
votes
1answer
76 views

Hide New Environment Numbering

The object of my question is learning how to remove the numbering that lies adjacent to a new environment after its been called while being able to reference the counter number later using \ref. I've ...
4
votes
2answers
91 views

Is it posssible to embed list items `\item` in `NewEnviron` environments?

Question Is it possible to keep the \item commands in the body and wrap the itemize list environment with \NewEnviron from the environ package? I am also trying to wrap the list inside a TikZ node, ...
10
votes
2answers
2k views

How to define a new environment with a fancy box (tikz) around sample source-code (listings)?

This is what I want to do: \documentclass{beamer} \begin{document} \begin{frame}[fragile]{Frame 1} Some \structure{Python} code here: % I want to define a new "pythoncode" environment, so ...
2
votes
1answer
83 views

Creating a Problem Environment

I'm trying to learn how to make new environments, namely I want to make a "problem environment" for examples of problems, and the algorithms that solve them. Optimally I would like it to use a ...
4
votes
1answer
269 views

Using a package only for certain tables

I am using the tabularx environment since it the X component of the columns is very useful and necessary for the tables I want to produce. However, a single one of my tables is longer that a page, and ...
4
votes
1answer
26 views

How do I define an excludecomment environment in a for loop?

I'm using the forloop and comment packages to define environments prob1 through prob5 that exclude portions of my document. Here's a MWE: \documentclass[12pt]{article} \usepackage{comment} ...
0
votes
1answer
78 views

Is there a LaTeX package that contains an environment for excursions and digressions?

Is there a convenient LaTeX package that can be included in the preamble and allows to write more or less extended excursions/digressions by using commands like: \begin{excursion} extended ...
3
votes
1answer
135 views

Suggestions for nested proofs

I would like to write down my lecture notes. The proofs of the theorems in this lecture are usually really big. It usually looks like this: Theorem 1: Here comes the statement of the Theorem ...
2
votes
1answer
72 views

Suppress paragraph indentation after tcblisting environment?

I am writing a document containing lost of snippets of code, and I've defined an environment using tcblisting from the tcolorbox package to do this. The environments work fine. What I want to do ...
0
votes
0answers
23 views

custom lstlisting environment [duplicate]

I'm using the listing package for displaying source code in my document. I want to use the minipage environment to avoid page breaks within the listing, but I don't want to write, at every listing, ...
6
votes
1answer
151 views

Is there a bracket missing in teubner.sty? [closed]

When TeXifying files where I use teubner.sty, LaTeX complains Runaway argument? {\setcounter {verso}{##1}\def \writ@verso {\count 255=\value {verso}\divide \ETC . ! File ended while scanning use of ...
5
votes
3answers
146 views

Custom environment with minipage and align*

I would like to have an environment that puts two equations side by side. The following works but Is there a way to make this a dedicated newenvironment? \documentclass[10pt]{article} ...