Tag Info

New answers tagged

0

Assuming you want to allow headings part way down a page - just not at the very bottom, one solution could be the needspace package. Needspace allows you to specify how much space must be on the page before placing the next item. However, this may not catch all instances of your issue. Add \usepackage{needspace} and then do \needspace{X} before your ...


1

This version resembles the version of egreg, but it regards the (total) section number, such, that there is no pagebreak just before the first section occurs (unless manually forced) \documentclass[12pt]{article} \usepackage{etoolbox}% \usepackage{blindtext}% \usepackage{assoccnt}% \let\LaTeXStandardSection\section \newcounter{totalsection}% ...


3

Instead of \clearpage add a command that, the first time, redefines itself to be the same as \clearpage: \let\latexsection\section \renewcommand{\section}{\sectionbreak\latexsection} \newcommand{\sectionbreak}{\global\let\sectionbreak\clearpage}


2

I take over the relay from Christian Hupfer and give a tcolorbox based solution. I tried to mimicry the original macros to get an equivalent appearance. The main difference is that lemma and proof are now breakable boxes. I left out the \qed since I don't know what is used for that one. The macros take an optional parameter (any tcolorbox option). E.g., use ...


2

I don't think an automated solution would be wise, because you would run into problems with functions that span multiple pages, but here is an ad-hoc solution. You can invoke (within an "escape to LaTeX" in your listings) the two macros defined below, \forbidpgbr and \allowpgbr, to locally forbid/allow pagebreaks. Note that the change takes effect only on ...


3

Here's a way to get better breaks using the development version of minted. I will add this to the development version with a new option, but that may take a little while since I expect that some refactoring and additional refining will be necessary. Add the code below in your preamble, after you have set the highlighting style that you want. If you aren't ...


1

A Rather Prelimary Answer In order to make it work, I downloaded the latest version of minted.sty. There are some ways to make it work, but I feel that there need to be some improvements, so everybody please be my guest! Short code using environment/inputminted seems to be working fine! \documentclass{book} \usepackage[]{minted} \usepackage{xcolor} ...


1

This is a response to a comment on Jaun's answer. It's a modified version of his suggestion that works with description environments. % ========================================================== % Adapted from TeX.StackExchange.com user Juan A. Navarro's % solution for itemize as seen at % http://tex.stackexchange.com/a/4493/327 % ...


1

You can use one of the hooks provided by titling and set up some commands to define things conveniently. I use \foreignauthor{} and \foreigntitle{} which you use to defined the English versions. Then \maketitle will do what you want, I think. \documentclass[twocolumn]{article} \usepackage{titling} \pretitle{\begin{center}\LARGE} ...


2

The dual title in twocolumn mode causes the page breaks. Perhaps you'd just be interested in setting the title manually. Below I've taken the \maketitle constructions from the titling package code: \documentclass[twocolumn]{article} \usepackage{lipsum}% Just for this example \begin{document} \twocolumn[{ \begin{center} \LARGE First title \end{center} ...


2

LaTeX is trying to typeset what amounts to a poorly formed document. Normally headings are "tied" to the text which follows. This is to avoid the unsightly situation where a heading appears alone at the bottom of a page, with its following text on the next page. Your document has no content, just headings, therefore all break options are equal and no ...


0

I solved problems that out. One Problem about header, \documentclass[a4paper,twoside,openright,11pt]{scrbook} \usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=6cm,marginparsep=1cm,outer=8cm]{geometry} \usepackage{fancyhdr} And... \pagestyle{fancy} \fancyheadoffset[LE,RO]{\marginparsep+\marginparwidth} ...


2

It can be done by switching off the boolean @twoside for the front matter. However, it is not to be recommended. \documentclass[11pt,a4paper,twoside]{book} \usepackage[pdftex]{graphicx} \usepackage[T1]{fontenc} \usepackage{fouriernc} \usepackage{mathtools} \usepackage{amsfonts,amsmath,amssymb,amsthm} \usepackage[a4paper, hmargin={3.5cm,3cm}, ...


4

You should use a \mark command e.g. with the extramarks package: \documentclass[10pt,a4paper]{article} \usepackage{extramarks} \usepackage{amsmath} \usepackage{amssymb} \usepackage{fancyhdr} \rfoot{\large{$\dfrac{}{\lastxmark}$}} \usepackage{perpage} \newcounter{PageTestCounter} \MakePerPage{PageTestCounter} \newcommand{\addTest}[1]{% ...


5

\nopagebreak makes it infinitely bad to break at that point. So TeX will not break at that node However it is possible that it breaks at that point visually for example blah blah \nopagebreak \hrule height 0pt \pagebreak[2] blah blah Then TeX will not break above the invisible rule, but may break after the invisible rule. So it may seem that ...


2

This is not a full solution, rather a starting point, due to lack of time and lack of knowledge on TikZ ;-) I tried to use the tcolorbox breakable and overlay features and its theorem style to make the boxes. The logos from bclogo packages can be inserted, but I fail at the positioning them correctly. This leads to a right shift of the box content as well. ...


2

The package endfloat will move all floats to the end; setting totalnumber to 1 will ensure only one float per page. \documentclass{article} \usepackage[nomarkers,nolists]{endfloat} \usepackage{lipsum} \setcounter{totalnumber}{1} \begin{document} \lipsum[1] \begin{figure} \centering \fbox{\rule{0pt}{1cm}\rule{4cm}{0pt}} \caption{A caption} \end{figure} ...


2

This is what the package endfloat is for.


4

\clearpage will flush each float on to a new page


0

For quotes like that I usually include the attribution into the quote environment and make it "flush right" with an \hfill \begin{quote} Now I am become Death, the destroyer of worlds. Also, I like bananas! I like bananas so much that my quotes about them run to \emph{multiple paragraphs}!\hfill Ronald MacDonald \end{quote} A MWE would help. ...


1

You should not break the two parts into two environments: \documentclass{article} \usepackage{xparse} \NewDocumentEnvironment{mquote}{m} {\begin{quote}} {{\interlinepenalty 10000 \brokenpenalty 0 \par}% <--- change to \par, if you like \nopagebreak\makebox[\linewidth][r]{#1}\end{quote}} \setlength\textheight{2cm} \begin{document} \noindent ...


0

Wow, that's fantastic. Thanks so much for your help - I hadn't realised the enumitem package was so powerful. I tried it some time ago and it kept screwing up the numbering because I was trying to prepend the section number rather than using its internal counters (doh!) I've taken the liberty of posting my final version here in case anyone else finds this ...


2

Don't you think that semantically, your subsections look like items in a list? I propose this solution, with enumitem, in which enumerate mimicks more or less (it's up to you to tell) your subsections. It allows easy page breaks and, adding labels, you still can cross-reference items. \documentclass{article} \usepackage{fontspec} ...



Top 50 recent answers are included