{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.
3
votes
1answer
1k views
Can I disable italics in the body text of a theorem without amsthm/ntheorem?
I'm submitting a paper and am required to use a provided document class which defines its own theorem environments, so I can't use packages like amsthm or ntheorem. The class doesn't define a ...
10
votes
3answers
200 views
How do you put a character in the margin (using an environment)
I'm using framed to create a little callout box for tips and other information in a book. So for it's going well however I cannot get the icon (using ding) to sit in the margin.
It currently looks ...
9
votes
3answers
1k views
How do I generate a check-list?
Similar to the itemize or description environments I would like to have a check-list environment, with neat boxes on the right side, that I may check or uncheck. I guess I'm not the first having this ...
4
votes
1answer
380 views
Specification in `theorem` environment also bold
I'm using the following packages/options in my article:
\documentclass[b4paper,12pt]{article}
\usepackage[english]{babel}
\usepackage{amssymb}
\usepackage{amsmath}
...
4
votes
3answers
322 views
Command enclosing content of custom environment
I want to create an environment that wraps the content in a command so that I can write this:
\begin{mybox}
content
\end{mybox}
and get this:
\psshadowbox{content}
When doing it as a custom ...
9
votes
1answer
133 views
How does LaTeX implement environments?
Do you know how LaTeX implements environments? To be more precise, what does
\newenvironment{<env-name>}[<n-args>][<default>]{<begin-code>}{<end-code>}
in terms of TeX ...
5
votes
2answers
343 views
Custom environments with multicolumn header
I tried to create an environment that creates a tabular frame around the content of the environment.
For instance:
\begin{tabular}{|l|l|}
\hline
\multicolumn{2}{|c|}{Team sheet} \\
\hline
...
4
votes
1answer
181 views
Numbering sequent proofs like equations
I am trying to reproduce some very old articles for use in an anthology. Some of these articles present certain rules of inference as proofs in sequent calculus, but number them along with equations, ...
4
votes
2answers
220 views
Is there an “identity” (or “no-op”) environment that simply uses its contents unaltered?
In the functional programming paradigm, it is common to have functions accept other functions as parameters. This paradigm can be followed in LaTeX, too: A macro can accept parameters which themselves ...
2
votes
2answers
306 views
Making more easy the itemized of item with tabulation system
Actually, isn’t not really a question. (Since my examinations get close, I don't really have the time to search for a solution to my problems.)
Rather than using the common \item, I'd like to use ...
4
votes
1answer
781 views
lstinputlisting does not include file within lstnewenvironment?
I want to use lstinputlisting to include a file with code within an lstlisting block, which is defined through a new environment. However, the lstinputlisting command itself, not the code, is ...
2
votes
1answer
276 views
Tabular: set a line between each row in \newenvironment
I have created a particular table with 3 columns using \newenvironment.
Now I want to put a line between each row and from the 2th to the 3th column.
I know it is possible to add \cmidrule{2-3} at the ...
15
votes
1answer
344 views
How to define a starred version of an environment in LaTeX
I am interested in defining a new environment in LaTeX that has a starred version. How is this done?
5
votes
3answers
126 views
String parsing macro fails within custom cite command of biblatex?
I am trying to use the same string parsing macro as in String parsing macro fails within a minipage environment?; but this time in context of biblatex - and I'm having similar problems, I guess.
...
4
votes
1answer
233 views
String parsing macro fails within a minipage environment? [closed]
I am trying to work with a string parsing macro, found in the answer of TeX capacity exceeded while parsing a date string - TeX - LaTeX.
Basically, I have strings num01, num02... num09 - from these, ...
3
votes
1answer
179 views
Difference in behaviour between tabular and flushleft environments
In response to my earlier question the following working code has been provided:
\documentclass{article}
\usepackage{showframe}
\begin{document}
\hfill
\begin{tabular}{l@{}}
some text\\
some other ...
8
votes
1answer
497 views
Change only the ending with renewenvironment
I have a theorem environment I've made called "ex" (using the theoremstyle "definition"), which I use for examples in a book document class. I like that I can number the examples, but I want a proof ...
6
votes
1answer
158 views
Custom environment move to end of chapter
I have written a custom example environment for formatting mathematical worked examples. These are currently included in the sections they are related to, however are sometimes looking a bit ...
24
votes
1answer
174 views
Why is there no \provideenvironment?
LaTeX2e provides a \providecommand but there is no \provideenvironment which defines an environment only if it (or a macro with the same name) was not defined before. Is there a specific reason why it ...
8
votes
2answers
154 views
Ignore first parskip inside a save box
I have the following definition (MWE below) of a lrbox. If I use the normal setting parskip=off the interaction \mdf@restoreparams works as expected. Inside the lrbox I can use parskip and parindent. ...
8
votes
2answers
292 views
Write a LaTeX macro to differentiate the text
I'm writing a report, and, for editorial purposes, I would like to use different fonts for each part of the report. I think I need to write a macro for it, but I don't know how to have this effect:
...
6
votes
1answer
259 views
How to use figure inside a exercise environment?
Trying to use figure inside an Exercise environment (exercise.sty) gives me "LaTeX Error: Not in outer par mode."
Example:
\documentclass{article}
\usepackage[]{exercise}
\begin{document}
...
1
vote
1answer
115 views
Define preamble to a default
I have
\begin{arab}[utf]
... some text
\end{arab}
throughout entire document.
Is there any way to get rid of this reoccurring \begin \end command so to have my document look like this:
...
0
votes
1answer
159 views
textpos error with newenvironment{aside} and xelatex
I'm using xelatex with texlive 2011 vanilla on the latest ubuntu precise pangolin.
I fork and try to use the great cv template from https://github.com/afriggeri/cv
This template uses TikZ for the ...
2
votes
1answer
281 views
Prevent caption to appear on separate page
I'm using a custom listing environment which does not float taken from
Code spanning over two pages with minted, inside listing with caption.
The caption is done with the caption package.
The ...
4
votes
1answer
611 views
Q&A Template in LaTeX
I am preparing a Q&A document. I created the image below in MS Word. I was wondering if there is a way this can be accomplished in LaTeX. I want to keep formatting consistent through out the ...
4
votes
1answer
166 views
Text environment with vertical header and border
I have no experience with creating latex environments, so I hope that someone would be so kind helping me trying to create a new text environment with a border and a vertical header to the right of ...
2
votes
1answer
174 views
<F5> in vim-latex doesn't expand environment
I'm new to vim-latex and have been reading some tutorials. I've noticed that the behaviour of the F5 on my machine is rather different from what the tutorials tell me.
I'm supposed to expect F5 to ...
3
votes
2answers
131 views
Sharing parameters between a command and an environment
(This question is related to Using \total of totcount package in section title)
I'd like to keep track of the papers I review, and I have written a code (MWE shown below). The code keeps the count of ...
9
votes
3answers
243 views
Environment that obeys spaces
I need to build one environment that obeys spaces, but not new lines, and also change tabulation into four spaces.
I can't use verbatim because I would also like to use macros in my environment.
3
votes
1answer
129 views
Define an align environment that always aligns to the first equal sign
I noticed that 98% of the times I use align or aligned I place the & just before the first = of each line. Is there a way to define a new environment that automatically aligns equations to the ...
4
votes
2answers
233 views
Problems When Escaping from Listings
I would like to use LaTeX to document my C++ code, since I am able to typeset mathematics easily, as well as create diagrams using TikZ. I made a minimal LaTeX template for testing, but I have already ...
0
votes
1answer
96 views
Is there a package with standard theorem environments and math functions
I would like a package that defines nice things by default like:
Theorem environments like definition, property, example etc.
Standard includes like subfloats, the amsmath family
Reference functions ...
3
votes
2answers
151 views
How to use an environment defined by the versions-package inside another environment
When I use the versions package to conditionally exclude content like this:
\documentclass{article}
\usepackage{color}% just as example
\usepackage[tracing]{versions}
\excludeversion{vers}% opposite ...
7
votes
2answers
342 views
How to put environment text inside node?
Consider a simple environment in the documentclass as
\newenvironment{abstract}{
\node (tbl) {
};
}
The content of
\begin{abstract}
Content
\end{abstract}
will goes ...
8
votes
3answers
258 views
Verbatim in environ’s \BODY
I’d like to print a TeX install guide for different OS, but the most text is the same for all OS. So I build the following
\documentclass{article}
\usepackage{environ}
\newcommand{\mlw}[3]{}
...
3
votes
1answer
143 views
afterpage + list = missing \item
I'm trying to use the afterpage package to automatically insert text at the top of each page (please see my other question Section reminders at the top of each page?) but I'm having trouble.
...
2
votes
1answer
1k views
Avoiding “\Url Error ->\url used in a moving argument.” in a custom environment
I have a document I'm trying to render using two classes -- my university's dissertation .cls, and tufte-latex (my uni's styleguide is ugly, and I want to make a pretty-print version for my own ...
5
votes
3answers
455 views
How to extract parts of (La)TeX document?
I want to run queries against LaTeX documents like these:
get list of all equations, even if one declares \def\be{\begin{equation}} and uses it;
get list of all arguments of some command (e. g. ...
6
votes
3answers
344 views
New paragraph style for newbie
This question may have already been asked, but with all of my searching, I couldn’t find it.
I am new to LaTeX and after a few rough starts, I am finding my way. I am using this tool to create ...
3
votes
1answer
164 views
Getting errors when using the grammar environment before \chapter{} and \begin{description}
I hope you can help me.
I am using an empty grammar environment, included in the syntax package, within a file called appendix_c.tex, whose contents are as follows:
\chapter{Modified version of the ...
9
votes
2answers
155 views
Not display the content of one environment when its content contains one special macro
I need to build one environment for proofs in my lessons.
\begin{proof}
...
\end{proof}
This environment could have one content containing one macro named \lines like in the following example. ...
5
votes
1answer
246 views
Plain enumeration of theorems definitions etc
In my TeX document Theorems, Definitions, Lemmas are enumerated in the following way:
Definition 1.1
Lemma 1.1
Theorem 1.1
Definition 1.2
Lemma 1.2
Theorem 1.2
But I would like to have
...
4
votes
0answers
239 views
Synctex and Environments [closed]
Synctex makes it possible to jump between your LaTeX code and the compiled PDF, which is absolutely great, if you have larger documents. However it is my impression that when you use environments, ...
1
vote
2answers
118 views
How to modify side margins in front pages (declared in subenvironment)?
I'm about to submit my thesis and I just noticed the first pages have different sidemargins to the rest of the text :(. They are supposed to be 2.5cm and they apper of ~ 1in.
I tracked the problem ...
3
votes
1answer
219 views
Setup a newenviroment for figure with includegraphics and caption
Here is my MWE, I want to 'refactor' the code so that I do not need to write so much when I import source code into my document:
\documentclass[12pt,a4paper]{article}
\usepackage[demo]{graphicx}
...
6
votes
3answers
2k views
lrbox in \newenvironment
I cannot make lrbox work if put within a \newenvironment. I'll explain with an example. If I write:
\documentclass{article}
\newsavebox{\mybox}
\begin{lrbox}{\mybox}
...
1
vote
0answers
222 views
lyx change environment level with keyboard [closed]
Much in the way that the tab key iterates over section levels:
Part -> Chapter -> Section -> Subsection -> Subsubsection -> Paragraph -> Subparagraph
I would like to do the same ...
9
votes
2answers
72 views
Can I redefine an environment to generate an error?
I know how to use \renewenvironment to redefine an environment, but instead of changing formatting, I'd like to have any use of the environment generate an error (log and abort). Is there a way to do ...
12
votes
3answers
441 views
Defining commands that are scoped to a particular environment
Is it possible to define commands in a separate namespace so that they only work within a particular environment?
For example, can I create a package named foo that defines a foo environment and a ...