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

0
votes
1answer
136 views

Change words in a Tikz picture every page

I'd like to create a template, as below. But I'd like to make it so that I can have multiple pages of the same layout and be able to easily replace "Header 1" and "Header 2" with different words each ...
4
votes
2answers
152 views

changing font style/size for proof, adding a square after example

Is is possible to change font size/(or style) for a proof? I was also thinking to add a small hollow square at the end of every example to separate the text a little. Something similar that works like ...
3
votes
1answer
44 views

New environment type without automatic numbering

I'm trying do define a new environment using tabu as a building block. The reason to use tabu is that it will break nicely across pages for long tables. I would like to have some help on doing the ...
0
votes
1answer
152 views

Renew appendix command to remove blank pages

I'm using Steve R. Gunn's Thesis Class. My issue is that Latex insists on inserting a blank page after the first of my 4 appendices, yet at no other point in the document. I believe this is caused by ...
2
votes
1answer
42 views

Passing arguments to mdwlist environments

I'm trying to make a description list more compact. I figured the easiest way to do this would be to use mdwlist's description* environment. This reduces the spacing between list items. I'd also ...
4
votes
1answer
58 views

mdframed package conflicting with \bgroup, \egroup

I'm using XeLaTeX because of language problem. The following code has no problem: \documentclass{article} %\usepackage{mdframed} \newenvironment{mynote}{\footnote\bgroup}{\egroup} \begin{document} ...
6
votes
2answers
110 views

Include only specific environments

I wish to typeset a document and only include occurrences of one specific environment for the output. One thing I tried was using the comment package and putting \begin{comment}just after ...
4
votes
2answers
73 views

Trouble defining new environment with embedded gather

I looked at the solution to How do I embed a gather environment within a custom environment? But things are still not working for me: MWE: \documentclass[border=6pt]{standalone} ...
3
votes
2answers
136 views

Create a “case”-environment

I'd like to create an environment for enumerating different cases. Something that would look like \itemize but instead of printing a "-" symbol at the begining of each item, prints (for the first ...
3
votes
1answer
32 views

How to make some visible effect on the output file of a document “invisible” or non-effective while fulfilling its “invisible” function?

Are there any commands/packages/environments that can make some code that has a visible effect in the output file as if it were not written but fulfilling its internal function? For example, ...
3
votes
4answers
177 views

How to print the value of the last \refstepcounter in the first page in the memoir class?

I made an environment named sol, that has a \refstepcounter command. I want to print on the first page of my document how many sol environments I have made in my document. ...
0
votes
1answer
40 views

Redefine a value during runtime inside another macro

I would like to redefine a value during runtime. More precisely, I'm creating my own environment and in the preamble I would like to change a value and set it back afterward. ...
5
votes
1answer
64 views

Syntax to setup environment using environ package with multiple arguments

I can't get the syntax right. I am trying to use this answer below to help me. how to use conditional to define different \begin and \end environment at compile time I am trying to setup an ...
7
votes
1answer
95 views

What's the smartest way to typeset a poem which includes prose?

I have a script to query a database containing poems and typeset them in LaTeX within a verse environment. Some poems contain section which are in prose. These prose lines are clearly tagged in the ...
2
votes
1answer
81 views

Suppress poem line numeration only in selected environments

I would like to drop the poem line numeration for only one poem, thus forcing it to behave differently from the general setting defined for the verse environment of my document. Please consider the ...
3
votes
1answer
85 views

Usage of minted inside newenvironment in minted 2.0a³

As a followup question to Lstinline macro inside another environment, I kind of want to do the same thing for minted as well, but I'm held back by the following: I used the code from Using minted to ...
3
votes
1answer
86 views

tikz and new environment

I would like to creat a new environment in order to draw the following matrix : \begin{tikzpicture}[baseline,every right delimiter/.style={xshift=-8pt},every left delimiter/.style={xshift=8pt}] ...
3
votes
1answer
68 views

Problem with an environment definition

I know it is an easy and quite specific request but I've been on it all day and I cannot really understand what's wrong! \documentclass[12pt,a4paper]{report} \usepackage[T1]{fontenc} ...
4
votes
2answers
99 views

Change to libertine font except in certain parts?

I am producing my LaTeX document using pdflatex. If I want to switch my entire document to a libertine font I use : \documentclass[11pt,a4paper]{book} \usepackage[utf8]{inputenc} ...
9
votes
1answer
172 views

Ignore spaces and \par's after an environment

In defining an environment, I could use \ignorespacesafterend to ignore all spaces after the environment. But how could I also ignore all \pars and empty lines after the environment? In other word, ...
2
votes
1answer
50 views

Indenting text and still allowing sections, pagebreaks and floats

I have a document where there are some sections with and some without subsections. When there are subsections, I want them (and all their content) to be indented. I have found several approaches to ...
1
vote
1answer
41 views

Retrieve a table with a Macro

I would like to retrieve a table with a Command which is using an new environment including a table. So basically something like: \begin{measurtab}{Test 2110} \value{0.0}{0.0} \end{measuretab} ...
2
votes
1answer
61 views

Usage of minted inside a new environment, inside IfFileExists

I want to conditionally load minted and define an environment, but after using IfFileExists I'm running into an error: FancyVerb Error: Extraneous input `resetoptions \setkeys ...
6
votes
0answers
48 views

How can I make a custom environment that wraps listings?

Thanks to this answer, I know it is possible to float and wrap text around a listing. I would like to setup an environment for mini-code snippets that always floats and wraps the same way. I can ...
5
votes
2answers
74 views

Newenvironment wrapper around widetable

I'm trying to create a custom environment figs based on widetable, using \newenvironment. \documentclass{article} \usepackage{widetable} ...
2
votes
1answer
52 views

Passing commands as environment-arguments

I'm trying to realize two versions of an environment numberedlist: if no argument is passed to it, it should begin the environment enumerate and pass default values as its argument, if one argument ...
1
vote
1answer
166 views

How to display the text in a new environment italic?

I created a new environment: \usepackage[dvipsnames]{xcolor} \usepackage{mdframed} \newenvironment{test} {\begin{mdframed}[backgroundcolor=gray, linewidth=1pt]} {\end{mdframed}} I'd like to ...
3
votes
1answer
114 views

Can I use a TeX primitive in a “before” and “after” macro? (and how?)

The Question Can I use a TeX primitive in a "before" and "after" macro? (and how?) There are two questions that I found useful and related to my question, which sent me in the right direction: how ...
6
votes
2answers
163 views

What to do with both “underfull \hbox” and “overfull \hbox” in the same line?

I've recently read through my \jobname.log files to spot errors in typography. I came across this: Overfull \hbox (6.8925pt too wide) in paragraph at lines 650--651 [][]\T1/cmtt/m/n/10 ...
1
vote
1answer
133 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
50 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
55 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
5
votes
2answers
100 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
92 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
178 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
116 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
466 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
60 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
123 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
52 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
298 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
74 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
83 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
44 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
218 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
381 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
301 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
73 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
165 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
60 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, ...