4
votes
2answers
43 views

How to keep an environment with the last line of the previous environment?

I quite often include attributed quotes in my documents, using something like: \begin{quote} Now I am become Death, the destroyer of worlds. Also, I like bananas! I like bananas so much ...
5
votes
0answers
52 views

How to track a page change within an environment?

I'm trying to define an environment that can automatically detect when the material within it moves to a new page, reprint one of its arguments at the top of the new page, and change how it closes as ...
5
votes
1answer
78 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 ...
3
votes
1answer
66 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
3answers
132 views

Proper vertical spacing and pagebreaks in custom environment

I would like to design a simple environment which displays examples. This is what I got so far: \documentclass{article} \usepackage{xcolor} \usepackage{parskip} \usepackage{lipsum} \makeatletter ...
4
votes
0answers
106 views

Using a package only for certain tables

I am using the tabularx environment since it the X component of the columns is very useful and necessary for the tables I want to produce. However, a single one of my tables is longer that a page, and ...
5
votes
1answer
96 views

Group statements, avoid pagebreak

I make an FAQ document, for this I redefined environments like \newenvironment{question} % no indenting, bold and new paragraph {\setlength\parindent{0pt}\bfseries} {\par} \newenvironment{answer} % ...
9
votes
1answer
181 views

Bad page break with \newenvironment, \refstepcounter and hyperref

I tried to define some environment but came across bad page breaks sometimes. The minimal working example is as follows: \documentclass[b5paper]{article} \usepackage{hyperref} % page break is correct ...
2
votes
1answer
123 views

Peculiar pagebreak problem with nested environments

I have been trying to make custom theorem environments because the classical newtheorem command does not suit my needs. I have been stuck with a pagebreak problem which I explain below. Here is the ...
6
votes
2answers
106 views

How can I prevent breaks in a custom environment?

I have a custom example environment: \newcounter{examplecounter} \renewcommand{\theexamplecounter}{\arabic{examplecounter}} \newenvironment{Beispiel}[1][]{% \goodbreak% ...
0
votes
0answers
32 views

How can I keep an environment all on one page? [duplicate]

In other words, how can I forbid pagination between \myenv and \endmyenv? I thought at first to make the whole thing a box; if I'm not mistaken---this would prevent TeX from breaking it up---but I ...
3
votes
1answer
89 views

Prevent environments from breaking in two pages

I am making my own environments for a mathematical document (environments such as Theorem, Definition, Lemma... which often consists of a title corresponding to the environment and possible things at ...
2
votes
0answers
83 views

Custom environment splitting between pages [closed]

I created a custom environment for theorems using mdframed package: \newtheorem{theorem}{Theorem} \newtheorem{twierdz}[theorem]{Twierdzenie} \newenvironment{twierdzenie} ...
16
votes
2answers
860 views

A special example environment

How can I define an environment named "example" so that: can be broken over pages has a horizontal line above "Example \chap.\no" (e.g. Example 4.10), and vertical line that is spread to the whole ...
1
vote
0answers
46 views

How to hold all lines in a defined environment? [duplicate]

\def\Grammercaption{\textbf{Grammer}} \def\grammer{\bgroup\ignorespaces\Grammercaption\fontsize{10}{13pt}\selectfont} \def\grammer{\egroup} I want all lines of text within this environment stick ...
6
votes
1answer
147 views

Environment makes unnecessary page break

I have a problem with user-defined environments in LaTeX. Even though the content of an environment seems to fit, sometimes LaTeX makes an unneccessary page break after all. Here is my MWE: ...
1
vote
1answer
57 views

Show code similar to documentation of packages

I saw that several documentation packages use the environment to show macrocode long codes with page break, the example implementation of the package geometry. How do I do this? I wanted to show a ...
5
votes
1answer
269 views

How to prevent pagebreak for a custom environment?

I use the following custom environment emailHeader and macros to format an email header (credits belong to egreg). \definecolor{emailHeaderBackground}{RGB}{225,225,225} ...
4
votes
1answer
571 views

Onecolumn till end of page in twocolumn mode

I know about using the widetext environment for setting text in onecolumn mode and the multicols package for effortless switching between one- and twocolumn mode, but I think this is not too great if ...
2
votes
1answer
327 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 ...
3
votes
1answer
176 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
285 views

Insert text before end of page, and at the begining of the next page

I'm putting a template together and I have created a custom command which I'm going to use to set specific margins on the text passed to its argument and a few more formatting things, like this: ...
5
votes
2answers
995 views

Environment with first paragraph in bold and no pagebreaks

I would like to setup a new environment which typesets the first paragraph in boldface, the following paragraphs in normal text, and with (possibly) no pagebreaks between the first paragraph and the ...
1
vote
1answer
392 views

minipage breaking, or some other route to layout

I'm trying to make a resume with a 2 column layout, where I'll have something like [SECTION NAME] * space * [DETAILS] For example: Work experience[spaaaaaaaaaaaaaace]Some location, 2 years, etc ...
4
votes
1answer
850 views

Quote environment with long reference at the end right – without widows

I need a quote-environment to end with source-references in a new line, flush right. Simply using \begin{quote} QUOTED TEXT \begin{flushright} SOURCE \end{flushright} \end{quote} ...
1
vote
1answer
696 views

Framebox and minipage causes white space and is not float

I have a \framebox (I don't insist on using this command) and a minipage that causes whitespace, because the drawn box is not allowing any text before or after and it itself does not break over pages. ...