# Tag Info

18

It has always been a possibility although obviously the document markup side of latex is mostly aimed at hand authored documents, but even back while 2e was being developed there were wysiwyg systems like sw that are essentially generating latex that isn't touched and latex is often used for typesetting from XML (or previously SGML) using xslt or dsssl or ...

6

Without any additional package, add the following lines in your preamble \makeatletter \renewcommand\@afterheading{% \@nobreaktrue \everypar{% \if@nobreak \@nobreakfalse \clubpenalty 1 \if@afterindent \else {\setbox\z@\lastbox}% \fi \else \clubpenalty 1 \everypar{}% \fi}} \makeatother MWE: ...

5

If you are willing to use an additional package, I'd suggest you to use tcolorbox. This offers you endless customization possibilities and offers you mechanisms to solve the issues you mention (no page breaks in the title, minimum 5 lines before a page break, automatic handling of the optional argument, easily customization of spacing betwee the various ...

3

The needspace package allows reserving vertical space before doing the next thing. If the space does not exist, it issues a page break. Here, I redefined \item to perform a \needspace before it. You can change the value I used (\baselineskip), but it works for your MWE. \documentclass[letterpaper]{article} \usepackage{enumitem} \usepackage{lipsum} ...

3

I can't see such a style without section starting off in a new page. So here it is: we add \clearpage before all \section commands (after the first) and \filbreak before every \subsection. \documentclass{article} \usepackage{etoolbox} \preto{\section}{\clearpageafterfirst} \preto{\subsection}{\filbreak} \newcommand{\clearpageafterfirst}{% ...

3

The general answer is yes: LaTeX is supposed to be used for unattended typesetting. There are plenty of options that change LaTeX's behavior for avoiding orphans, widows, and to influence figure placements. There are a few exceptions to the rule, however, such as balancing the columns on the last page of a document in two-column mode. While there is at ...

3

\documentclass{book} \usepackage[showframe]{geometry}% just for this example \usepackage{lipsum} \newcommand\dummy{This is a test } \widowpenalty=-1000 %%%%%%%%%%%%%%%%%%%%%%%%%% \clubpenalty=-1000 %%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \lipsum[1-6] \section{bla} This is a test This is a test This is a test This is a test This is a test This is a ...

3

I have used the nowidow package by Raphael Pinson with some success. \usepackage[<options>]{nowidow} I use: \usepackage[defaultlines=4,all]{nowidow} A value of 4 works for me because I can tolerate some breaks in very large paragraphs. I think you can be pretty sure of banning all page breaks in a paragraph if you set the value of defaultlines ...

2

Apart from setting in oneside mode with \documentclass[oneside]{hepthesis} the following works, if you want to stay in twoside mode: \PassOptionsToClass{openany}{scrbook} \documentclass{hepthesis} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[english]{babel} \usepackage{kantlipsum}% just for dummy text \begin{document} \chapter{Kantian ...

1

A solution using the stackengine package: it's by construction that the "Heading" part cannot be separated from the first line of the content since it belongs to the first line. It also has the advantage to greatly simplify the code – unless you have specific reasons to type the heading with its own \item command: \documentclass[a4paper]{article} ...

1

First of all, LaTeX is not really intended for unattended typesetting of large documents. ConTeXT may lend itself marginally better for this, but will still not be on par with the requirements for automatically typesetting a newspaper. By contrast, the combination of HTML and CSS performs way much better at automatically positioning and resizing content ...

1

With markup converters like Pandoc it is now possible to generate LaTeX documents without ever touching any LaTeX code. However, obtaining aesthetic page breaks for slightly complex documents, taking for example into account figures, widows and orphans may still require manual intervention in the LaTeX code. Quoting Frank Mittelbach: This issue ...

1

The best alternative in your case, would be to use \cr once the environment for supertabular begins. With this approach, you don't have to unreliably guess, where the break is to occur, like the first comment suggested, or unnecessarily pollute the document with unneeded space, like the other one which followed. So in your document replace the \\ with \cr ...

1

There is now way to say to have a full paragraph not broken, because that has no sense if a paragraph is longer than a page. Indeed, in "normal" LaTeX there is also no way to have this behavior. The only way is to add a \nopagebreak to prevent page breaking in some point. In eledmac, there is \lednopb command. Its use is quite complex. I invite you to read ...

1

One approach could be fix a variable spacing above the subsections with the titlesec package and left to LaTeX to do the best. In the MWE below is from 2.8ex to 9ex so LaTeX use a spacing of 3ex when possible, otherwise is enlarged more or less, or even reduced in a barely perceptible extent, in order to obtain the best results. You can combine this also ...

1

If you have a fairly consistent (maximum) subsection length, then a rudimentary approach would be to use the needspace package to insert a page break if there is less than (say) 12\baselineskip available on the page. \documentclass{article} \usepackage{needspace}% http://ctan.org/pkg/needspace \let\oldsubsection\subsection ...

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