{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
1answer
106 views

naming argument and optional-argument for \def, \newcommand and newenvironment

I know how to create a new command or an environment. I think it will much better if I can specify name of the arguments. For example in framebox command and array environment below, we know exactly ...
1
vote
1answer
45 views

Defining a newenviroment for definition, theorem, example and so on by using a name

My trying of defining a newenviroment for LaTeX is \usepackage{mdframed} \newenvironment{mf}{\begin{mdframed}}% {\end{mdframed}} I want to define a simple command with a name next to it, for ...
1
vote
1answer
46 views

How to align two entries of a list that appears in the center of the page?

Using the Beamer Presentation template I am creating slides, my aim is to make a list environment with the bullet points aligned in the center of the page. How can I do so? Thanks
4
votes
2answers
80 views

Emacs key binding open environment

On Emacs, I used to have "C-c C-e" as a shortcut to "open an environment with begin and end". I changed my computer and reinstalled emacs: Mac OS 10.9 and Emacs 24.3, and now in LaTeX mode, "C-c C-e" ...
1
vote
1answer
51 views

longtabu newenvironment caption error [duplicate]

I want to make an environment for my tables. See the following example: \documentclass[a4paper,10pt]{scrartcl} \usepackage{longtable} \usepackage{booktabs} % \toprule, \bottomrule ...
4
votes
4answers
167 views

Running numbers for comments

I wish to have comment 1, comment 2 as running numbers, and for each reviewer I want to restart the running number, is there a good way to achieve this? Following is how the pdf currently looks, and ...
3
votes
1answer
69 views

\BeforeBeginEnvironment not doing anything?

I'm attempting to do something similar to Two column glossary, making an extant glossary style wrap into multiple columns. I've followed the suggestion in the comment to the first answer, i.e. use ...
2
votes
1answer
79 views

Case numbering within proof [duplicate]

I am currently using this in the preamble: \theoremstyle{plain}% default \newtheorem{thm}{Theorem}[section] \newtheorem{lem}[thm]{Lemma} \newtheorem{prop}[thm]{Proposition} ...
3
votes
1answer
44 views

Command \env already defined

This is a follow-up to How to ignore everything in the document environment?. The code below is intended to extract the value of a token that occurs before \begin{document}. For some reason, there ...
3
votes
3answers
89 views

Horizontal space in a new environment after \label{}

Why is the horizontal space inserted in the following mwe? \documentclass{scrartcl} \usepackage[american]{babel} \usepackage{environ} \usepackage{amsthm} % proof environment \makeatletter ...
4
votes
1answer
37 views

How to generalize a solution with \NewEnviron to \RenewEnviron (error: \env@proof@save@env undefined)

This question is a follow-up from Solution environment via true/false switch where Ian helped me to define a solution environment which can be hidden. I tried it as well for a proof environment, but ...
10
votes
2answers
283 views

Defining a new command name in the correct way

I'd like to define a short command name \gm{a,b} that would mean in LaTeX \overset{a\to b}\longrightarrow I tried on my own. The below code only works for \gm{a} (or \gm{b} if changing a into b) ...
3
votes
1answer
47 views

Copy the abstract environment for acknowledgments

I would like to create an acknowledgments environment that's simply the duplicate of the abstract environment, with two exceptions: It should print Acknowledgments as its heading, not Abstract. The ...
5
votes
2answers
67 views

Line break in a modified proof environment (with show/hide feature)

In the recent post How to define a proof environment which can be displayed/hidden? [combining two TeX solutions], Werner helped me to redefine a proof environment which can be hidden by an optional ...
1
vote
0answers
43 views

How to define a proof environment which can be displayed/hidden? [combining two TeX solutions] [duplicate]

I once asked for a solution to suppress vertical space right after the beginning of a proof environment; see the link (1) below. I use this quite heavily, it works very well. I recently asked how to ...
14
votes
2answers
209 views

Dash in Environment Name

I'm trying to make a verbatim environment called "my-environ" \documentclass{article} \usepackage{fancyvrb} \DefineVerbatimEnvironment{myenviron}{Verbatim}{numbers=left,frame=lines,label=My ...
19
votes
2answers
321 views

I want to start learning how to use \newcommand \newenvironment and \def any suggestions where to start?

I have been using LaTeX for a long time now, and I find myself often going to this website to solve my problems. This often includes copy pasting codes which include \newcommand, \newenvironment and ...
7
votes
2answers
167 views

Solution environment via true/false switch

I would like to create a solution environment that prints a solution in the case where an optional argument is set to true (the default) and hides the solution in the case that the argument is false. ...
8
votes
1answer
53 views

Collecting environment content with support for xparse arguments

I'm trying to create an environment which uses xparse style arguments but I have to be able to use the whole environment content in the environment definition, e.g. as an argument. Ideally I'd like ...
2
votes
0answers
96 views

Gantt chart is not drawn and give “! LaTeX Error: Environment gantt undefined.” [closed]

I am writing a report for FYP in Ubuntu 13.10 in TexMaker, with document class and use different files use for chapters. I write the code below in the chapter1.tex for draw a gantt chart ...
4
votes
1answer
51 views

How can I use arabic numbering for theorems?

I used the newtheorem command to create exercises in a book in the following way. \newtheorem{xca}[theorem]{Problems} So in the body I use the following command to create a set of exercises, ...
6
votes
2answers
107 views

Seemingly trivial: verbatim, newenvironment, and colorbox

I am, once again, trying to achieve what seems like a trivial goal. I want to use \newenvironment to define a verbatim environment with a background color. I need to define my own environment because ...
6
votes
1answer
79 views

Cross-reference of custom environments created with environ and TikZ package

Problem: I want to create an environment named Example, and the environment has a counter (number within chapter). I want to refer to the counter for illustration just as the table, figure and ...
1
vote
1answer
55 views

How to make an environment such as “theorem” not have italics [duplicate]

I found this: How to change the font style in theorem environment? as well as this: Italic in theorem environment Neither however seem to make sense to me as I have been using the following: ...
5
votes
1answer
75 views

Spreading newenvironment over two pages

I am using a template found online to do my CV and I am getting a hard time trying to spred the content of a newenvironment over two pages. I want the content of one of my rubrique to be over the end ...
2
votes
1answer
54 views

Can't define environment whose macro code contains dot2tex environment

I try to define a new environment whose macro code contains the dot2tex environment from the dot2texi package (look at the appended MWE). Unfortunately the compilation ends with the following error ...
6
votes
2answers
165 views

How to rewrite this command using \newenvironment?

I once defined a customized latex command, which works well. And now I would like to convert it into a latex environment using \newenvironment command. However, I failed after trying several ways. ...
3
votes
1answer
51 views

Giving a custom environment a name

I have defined a custom environment: \documentclass[11pt]{article} \usepackage[table,hyperref]{xcolor} % Better control over color \usepackage[colorlinks=true, linkcolor=DarkBlue, ...
10
votes
3answers
707 views

Found it tiring to type so many \begin and \end

Is there some way to get rid of the \begin and \end's? For example, I need to type a small matrix, but I should type \begin{matrix}...\end{matrix}. I tried to define a macro ...
5
votes
2answers
46 views

Spacing Between environment

I want to define an environment to detach text from the document. I would like to have one blank line before and after my quote. I defined the following environment: \newenvironment{myenv}{ ...
3
votes
2answers
65 views

Left bar in the margin of an environment with figures/tables

I am writing a document with theorems and proofs. Since, some reader may not be interested by the proofs I want to highlight them so they can be skipped easily. The best idea I came up with is to ...
2
votes
4answers
106 views

Switching between environments

I teach at the university and I write exams in Tex. I'd like to write an exam with a number of questions, where for each question I include either empty lines and empty figures with axes (for the ...
5
votes
1answer
52 views

how to use conditional to define different \begin and \end environment at compile time

I just need little help on the syntax for this. I am using tex4ht, and I get an error when I use empheq for the align environment. I want to build this TeX file both in pdflatex and htlatex. I ...
3
votes
1answer
38 views

How can I put an environment within a subsection?

I have this code, but the environment is put at the top of the page above the sections. \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage[italian]{babel} ...
1
vote
0answers
90 views

Kile syntax highlighting: A single dollar sign in the preamble

I'm using Kile to edit my LaTeX documents. I define my own custom environment to hightlight LaTeX code named lstLaTeX with the following code: \documentclass[a4paper]{scrartcl} ...
0
votes
0answers
99 views

Change the color of the “remark” environment in Beamer

I would like to change the color (bg and fg) of the remark environment in a Beamer document. I have setup my document using: \usetheme{AnnArbor} \usecolortheme{crane} I read in some other question ...
1
vote
1answer
49 views

Elementary question about new environment

I want to create new environment without a "closing argument". For example, \MakeLowercase{\textsc{MAKE LOWERcase textsc}} to have all text in small caps independently from upper- or lowercase ...
3
votes
1answer
292 views

Color highlighting text and environments in LyX

I am using LyX 2.0.5 with document class article and 'Theorems (AMS)' in the modules. I am wondering if it is possible to make it so that the titles of different environments will be highlighted in ...
4
votes
1answer
59 views

Shared counter (between description environments) results in “undefined control sequence” [closed]

The objective is to share the counter SharedCTR1 across the description environments. The following code works with only one description environment, but not with both. \documentclass{report} ...
1
vote
0answers
36 views

How to store the definition of an environment? Or, how to disable locally an environment?

what? I would like to "store" the definition of the environment figure into \something so that the following logics will work: % the following line is what I am looking for store(figure, \something) ...
2
votes
0answers
29 views

can I use changes package to highlight added environments, say, itemize?

I am using changes package to track modifications to a LaTeX documents, but found simply wrapping \begin{itemize}\end{itemize} with \added command doesn't work. It works fine if I wrap the contents of ...
2
votes
1answer
58 views

Make a counter “update” exercise in environment exercise

I wrote a book in about year 2010. Now I want to add (update) some exercises and count all updated Exercises. But I only can Update 2014. How can I make Update 0ne 2014, Update two 2014, ... or ...
1
vote
2answers
44 views

custom newline style in environments

I want to add something to each newline, like this: \documentclass{article} \newenvironment{mystuff}{dark magic goes here}{or here} \begin{document} \begin{mystuff} first row second row \end{mystuff} ...
0
votes
0answers
46 views

Problem with sectionning with my example

I want to number my example environments like [section]. However, example environments are numbered with chapter, not section. What should I do? This is my MWE: \newcounter{example} \makeatletter ...
3
votes
1answer
65 views

How to prevent page break in the last three lines of an environment?

I want to create an environment, thats content should not allowed a page break in the last three lines of the last paragraph. If the last three lines of the text inside the environment reach the ...
5
votes
1answer
186 views

First paragraph in environment without indent or space

I'm trying to create an environment that does not indent the very first paragraph of the text inside the environment. My latest attempt and the corresponding output are shown below. As you can see, ...
4
votes
1answer
71 views

Command to disable environments [duplicate]

I have defined an environment called answer that displays the answer of a question of a test I'm supposed to prepare. The idea is to compile a version where the answers are displays and one were they ...
8
votes
2answers
161 views

How to ignore everything in the document environment?

Yes, you did read the title correctly! I want to ignore everything that is between \begin{document} and \end{document} when I \input a file. I thought that that would be very simple, just use the ...
2
votes
1answer
64 views

How to get AucTex to prompt me for a name, when inserting an environment using Ctrl-C, Ctrl-E?

I'm using emacs auctex. I've defined an environment template, as follows. \documentclass{article} \newtheorem{definition}{Definition}[section] \begin{document} \end{document} I insert instances ...
6
votes
1answer
85 views

How to change QED sign for theorem classes

I'm writing an article which contains some quite long proofs, some of which include claims with proofs of their own. I dealt with that by adding a claim environment using \newtheorem, but there's a ...