all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: Controlling pagination on headings in Latex/PDF export?
Date: Fri, 17 Feb 2012 09:55:36 +0100	[thread overview]
Message-ID: <80obsxq1o7.fsf@somewhere.org> (raw)
In-Reply-To: 24985.1329426160@alphaville

Hi Nick,

Nick Dokos wrote:
> @ is a character that is reserved for .sty files: it's basically used as
> a mechanism to manufacture private names that are not going to conflict
> with other names. If you want to use @ in a macro in your .tex file,
> then you have to do something like this:
>
> #+LaTeX_HEADER: \makeatletter
> #+LaTeX_HEADER: \def\mykeepwithnextpar{\par\nobreak\@afterheading}
> #+LaTeX_HEADER: \makeatother
>
> However the best thing is to put the definition in a .sty file:
>
> --8<---------------keeper.sty---------------start------------->8---
> \def\mykeepwithnextpar{\par\nobreak\@afterheading}
> --8<---------------keeper.sty---------------end--------------->8---
>
> and then use
>
> #+LaTeX_HEADER: \usepackage{keeper}
>
> in your .org file.

In my case, yes, that's in a style file... reason allowing me to forget to
mention the makeatletter thingie.

> However, I find it exceedingly difficult to manufacture an example that
> will produce the bad break that the OP reports: LaTeX seems very
> reluctant to break after the headline. E.g. in the appended file, I can
> vary the number of foo lines from 0 to enough to fill the page and I
> cannot split the DEPARTMENT headline from the table. I also tried
> various lengths for the table (not very systematically, I must admit)
> and I still cannot get the default settings to misbehave. This leads me
> to believe that there are those "other" factors that affect badness:
> LaTeX thinks that there is something so severely out of whack in the
> "other" factors that it is willing to make the supreme sacrifice of
> splitting the headline from the table.
>
> So if the OP can provide a misbehaving example, that could help clarify
> things.
>
> Nick
>
> PS. Note that the call to \mykeewithnextpar is disabled in the file
>     below. If I enable it, I actually get a foo line at the top of the
>     second page before the DEPARTMENT headline, so it certainly affects
>     the output, but not in a good way.

You cannot reproduce it, because I misplaced the call to mykeewithnextpar: it
must be between the two things you want to see glue'd together.

Hence, in the example you mention, it works perfectly.

For answering the OP's question, the call must be moved between the DEPARTMENT
title and the table...

> #+LaTeX_HEADER: \usepackage{keeper}
>
> * Period 2012-02-06 to 2012-02-12
> ** Asset
> foo foo foo foo foo foo foo foo foo foo foo foo foo foofoo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo foo foo foofoo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo foo foo foofoo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo foo foo foofoo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo foo foo foofoo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo foo foo foofoo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo foo foo foofoo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo foo foo foofoo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo foo foo foofoo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo foo foo foofoo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo foo foo foofoo foo foo foo foo foo
> ##+LATEX: \mykeepwithnextpar{}
> *** DEPARTMENT
>     | Data        | Data | Data | Data |
>     |-------------+------+------+------|
>     |      XXXXXX |    1 |    1 |    0 |
>     |      YYYYYY |    5 |    4 |    0 |
>     |      XXXXXX |    1 |    1 |    0 |

Best regards,
  Seb

-- 
Sebastien Vauban

  parent reply	other threads:[~2012-02-17  8:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16 17:45 Controlling pagination on headings in Latex/PDF export? Jos'h Fuller
2012-02-16 18:20 ` Nick Dokos
2012-02-16 18:25   ` Jos'h Fuller
2012-02-16 18:58     ` Russell Adams
2012-02-16 19:44     ` Sebastien Vauban
2012-02-16 20:09       ` Jos'h Fuller
2012-02-16 20:16         ` Jos'h Fuller
2012-02-16 20:25           ` Sebastien Vauban
2012-02-16 21:02             ` Nick Dokos
2012-02-17  8:05               ` Stefan Nobis
2012-02-17  8:13                 ` Ian Barton
2012-02-17  8:55               ` Sebastien Vauban [this message]
2012-02-17 16:40                 ` Nick Dokos
2012-02-17 16:50                   ` Sebastien Vauban
2012-02-17 17:19                     ` Nick Dokos
2012-02-17 21:48                       ` Sebastien Vauban
2012-02-16 21:12           ` Nick Dokos
2012-02-16 23:12             ` Jos'h Fuller
2012-02-17  8:50               ` Stefan Nobis
2012-02-17  9:09               ` Stefan Nobis
2012-02-17 16:42                 ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80obsxq1o7.fsf@somewhere.org \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.