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

10
votes
2answers
133 views

How to implement common layouts instead of misusing tabular environments?

Note: My hope is that this can become a general resource for "use a list instead" comments. If you have suggestions for improvement, please let me know. I often see comments such as This ...
1
vote
1answer
75 views

Using mathspec \setmathfont with \newenvironment

I would like to change back and forth between two fonts. But I would like these two fonts to affect both normal text, as well as the digits and letters in maths mode. Something like this should work ...
8
votes
2answers
112 views

New environment for boxed equations

I would like to define new environments to highlight certain equations in some way. For example, I would like a highlighted equation to appear in red text or with a box around it. I have the red text ...
1
vote
1answer
36 views

Strip environment command in hyperref PDF meta data

When adding PDF meta data using hyperref you can also use certain LaTeX commands which are magically stripped away during the conversion into a PDF string. But this doesn't seem to work with ...
4
votes
2answers
69 views

How to define labels within a tcolorbox?

Inspired by this great answer, I'm trying to typeset my definitions using tcolorbox. My document contains hundreds of definitions which follow the pattern: \begin{definition} % ... ...
1
vote
1answer
26 views

longtabu from within newenvironment

I'm trying to use a longtabu environment as a replacement for a tabularx environment that I was using. When I try to compile this example, I get the error: ! LaTeX Error: There's no line here to ...
3
votes
1answer
33 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
75 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
43 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
56 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 ...
4
votes
2answers
59 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
39 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
65 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
33 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
28 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
95 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
23 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
1answer
77 views

Use newcommand in newenvironment

I want create an environment with newenvironment which does the follow: it evalutes its height and print it many times (textheight/height) to fit one page. My first step: \documentclass{article} ...
4
votes
3answers
98 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
68 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
57 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
52 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
36 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
48 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
46 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
154 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
63 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
101 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
57 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
164 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
64 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
51 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
65 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
110 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
42 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} ...
1
vote
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
528 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
94 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
51 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
29 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
28 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
128 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
106 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
41 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
54 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
63 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
87 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
67 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
211 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 ...