{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
46 views

Q&A environment with separation

I am writing a question and answer problem book. I would like the questions and their answers to be proximal in the source, but, upon compilation, for the questions to all clump together in one ...
3
votes
1answer
52 views

Making an environment with the same text color as the background

I am looking to type up some solutions to math problems. However, I do not want someone who just looks at the document to be able to see the solution; I want the students to be able to see the ...
3
votes
1answer
116 views

Duplicate an environment

How can I duplicate an environment? I want to create an environment which is almost exactly equal to another environment. I just want to change the heading. Right now I use ...
1
vote
0answers
73 views

Nested mdframed environment problems

I have a problem concerning a mdframed into an other mdframed. If the content of the second mdframed is too important, the result is horrible: it's separated by one page and the content of the second ...
1
vote
0answers
59 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
0answers
22 views

define environment with Verbatim and options [closed]

I'm working on an edition, and I need to create some environments using verbatim. I use the fancyvrb package and when I write : \documentclass[9pt]{report} \usepackage{xltxtra, fontspec, xunicode, ...
6
votes
2answers
629 views

Framed answer environment

I am trying to write a simple environment for the solutions of assessments I give. The code below defines such an environment: \newenvironment{answerenv}[1][Answer]{% Sets the default "Answer" but ...
1
vote
2answers
31 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
47 views

Textual replacement macros to wrap environment

I want to create simple textual replacement macros for an environment: \def \myEnvStart {\begin{someEnvironment}[enormous list of arguments]} \def \myEnvEnd {\end{someEnvironment}} This doesn't ...
4
votes
1answer
88 views

How to control conditional statements within new commands and environments

I'm writing a pretty complicated class to typeset a book based on memoir. One of my commands draws a caption on the preceding verso page, draws content on the following recto and verso pages, and ...
2
votes
1answer
109 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
59 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
91 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 ...
10
votes
2answers
141 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
205 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
164 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
51 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
136 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
41 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
43 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
88 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
49 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
83 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
69 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
46 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
38 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
108 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
38 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
117 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
159 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
84 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
79 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
53 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
59 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
59 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
77 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
81 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
184 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
61 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
86 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 ...
5
votes
1answer
120 views

Keep float out of a environment (for example definitions) [duplicate]

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
59 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} ...
3
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
597 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
121 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 ...