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

1
vote
0answers
46 views

Wrap text around with newenvironment

I am trying to create a new environment with a background color. The issue is that I want text to be wrapped around it but I can't do it. The minimum working example is as follows ...
1
vote
2answers
24 views

Save a longtabu in a box for check and reuse

I want to measure the height of a table and insert a \newpage before it if the table is too high. My table is done with longtabu of the tabu package. Where should I start? \documentclass{article} ...
2
votes
1answer
102 views

How can I know if I am inside an equation environment if it's nested with others?

I wanted to define some partial derivative commands that would be \partial y/\partial x if it was inside an inline equation and would use \frac{\partial y}{\partial x} if inside an equation ...
0
votes
0answers
42 views

What environment is best for Copyright page in a createspace novel using scrbook class

I've tried adding page breaks within \frontmatter but it either sticks to the Titlepage formatting, or erases my Dedication page, or adds huge spacing with lineskips. Other experimenting resulted in ...
0
votes
1answer
65 views

Change font spacing and size of bibunits \putbib

In the following example I would like to force my references section to be typeset in a smaller font with single (more condensed) spacing. My commands (a spacing environment call and a font small ...
4
votes
2answers
78 views

How to create a custom environment with a listing inside it?

Well consider the following code: \documentclass[a4, oneside,openleft]{book} \usepackage{listings} \begin{document} \begin{flushright}\begin{minipage}{0.9\textwidth}\begin{lstlisting} for (i) { ...
10
votes
2answers
138 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
87 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
123 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
40 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
78 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
31 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
37 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} ...
5
votes
2answers
45 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 ...
4
votes
2answers
66 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
45 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 ...
1
vote
1answer
35 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
33 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
98 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
25 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
104 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
79 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
69 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
57 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
40 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 ...
4
votes
1answer
80 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} ...
9
votes
2answers
66 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
51 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
49 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
156 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} ...
12
votes
1answer
106 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
64 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] ...
0
votes
2answers
69 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 ...
3
votes
4answers
68 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 ...
0
votes
0answers
54 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
70 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 ...
1
vote
0answers
47 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} ...
8
votes
3answers
541 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 ...
2
votes
1answer
58 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
33 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
157 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
120 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
53 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 ...
4
votes
2answers
88 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, ...
3
votes
1answer
65 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 ...
2
votes
1answer
69 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
24 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
71 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 ...