# Tag Info

5

here is a solution \documentclass{book} \usepackage{lipsum} \makeatletter \let\old@outputpage\@outputpage \def\@outputpage{\old@outputpage\shipout\vbox{}} \@twosidefalse \@mparswitchfalse \makeatother \begin{document} \lipsum[1-70] \makeatletter \let\@outputpage\old@outputpage \@twosidetrue \@mparswitchtrue \makeatother \lipsum[1-70] \end{document}

4

latex headings include code to prevent a page break until a couple of lines after a heading, so it best to define this as an unnumbered heading: \documentclass[a5paper]{book} \usepackage{geometry} \usepackage{lipsum} \makeatletter \newcommand{\character}{% \@startsection {section}{1}{\z@}% {-3.5ex \@plus -1ex \@minus ...

3

Here is a quick demo of linking R and LaTeX using the 'knitr' package. This has been run on Windows 8.1, with MikTeX 2.9, and TeXmaker 4.4.1 as the IDE. The following code is saved as knit02.Rnw (and this is case sensitive). With the package 'knitr' installed in R 3.1.3 you run the command: knit("knit02.Rnw"). This will generate the file 'knit02.tex' ...

3

Your style uses a supertabular, which seems to break a bit to early. You could try the style "long" instead. You could additionally enlarge the page with \enlargethispage{2\baselineskip} before \printglossaries.

2

You do not say why Ulrike Fischer's suggestion does not solve your problem in either your original document or the MWE. Switching to long solves the problem for the MWE when I test. So I'm guessing that you do not like the different positioning of the tabular. But this does not mean the problem isn't solved. It just means that solving it has created a new ...

2

If you really need to do this, you want \addpenalty rather than \penalty just as you used \addvspace rather than \vspace. \documentclass{article} \usepackage{titlesec} \usepackage{etoolbox} \newcommand\thmbegin{\par\addvspace{.5em plus .2em minus .1em}% \addpenalty{-1000}} \newtheorem{thm}{Theorem} \AtBeginEnvironment{thm}{\thmbegin} \interlinepenalty=1000 ...

2

This uses the titlesec package to build on David's suggestion and converts the use of \newenvironment to \newcommand since you want a command rather than an environment judging by the syntax you wish to use. \documentclass[12pt]{report} \usepackage{titlesec} \titleformat{\section}[block]{\centering\bfseries\sffamily\large}{\thesection}{0pt}{}{} ...

2

Just as with your specification for \section, you can move all the printing commands into the final argument. This then allows you to color them with \textcolor. In your example you then get on page two, rather a page break between the section commands. \documentclass{article} \usepackage{fontspec} \usepackage[explicit]{titlesec} \usepackage{xcolor} ...

1

The best way to cope with formatting of section titles is to use a macro with one argument in the last argument to \titleformat. Color specifications should only go in this auxiliary macro. Here is an example. \documentclass{article} \usepackage{fontspec} \usepackage{titlesec} \usepackage{xcolor} \usepackage{lipsum} % Title/Heading Formatting % SECTION ...

1

Add \vfil before the center environment in your command: \documentclass[a5paper]{book} \usepackage{geometry} \usepackage{lipsum} \newcommand{\character}[1]{% \vfil \begin{center} \textsc{#1} \end{center} } \begin{document} \character{Alice} \lipsum[2] \character{Bob} \lipsum[2] \character{Charles} \lipsum[2] \character{David} \lipsum[2] ...

1

Here is version that uses @touhami's hook, but provides more automation: \documentclass{report} \usepackage{lipsum} \makeatletter \newif\if@appendix \g@addto@macro\appendix{\@appendixtrue} \let\ltx@outputpage\@outputpage \def\@outputpage{% \if@appendix \@twosidetrue\@mparswitchtrue \ltx@outputpage \else \@twosidefalse\@mparswitchfalse ...

1

Despite the penalties @davidcarlisle mentions, I find I often get troublesome lone headings and dangly bits in complex documents, particularly where subheadings follow higher level headings without intervening text. One way is to use needspace, defining how much space is required on the page before a heading of a particular level can be set. Perhaps along ...

1

You can do this just with commands from memoir. If you are using a standard class nextpage offers some additional convenience commands, such as \cleartoevenpage[], which work similarly to those defined by memoir. Here, \cleartoevenpage[] is used in a redefinition of memoir's \clearforchapter: \documentclass{memoir} \usepackage{kantlipsum} ...

1

May be that what the OP is looking for is simply a version of, say, the center environment which prohibits page breaks above and below itself; this is easy to accomplish. For example, the following MWE defines an environment named centernopagebreaks that locally redefines the appropriate parameters and then invokes the center environment. Note: While ...

1

[expunged original answer] Ok. Your new MWE shows another level of difficulty and a promise of future complications. What you need is a full-fledged two column baseline grid. I think your best bets are grid, gridset and ConTeXt.

1

You can encapsulate the minted environment into a breakable tcolorbox environment. This allows to use some options from the tcolorbox package to influence the breaking. The minimal effect of the following code is that at least one line will be broken to the next page, if any. Since that may be not pleasing enough, I encluded an option enlargepage ...

Only top voted, non community-wiki answers of a minimum length are eligible