From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id UJgILQ8SFmeNqgAAe85BDQ:P1 (envelope-from ) for ; Mon, 21 Oct 2024 08:34:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id UJgILQ8SFmeNqgAAe85BDQ (envelope-from ) for ; Mon, 21 Oct 2024 10:34:23 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=christianmoe.com header.s=x header.b=CKT+Oc7I; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=christianmoe.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1729499663; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=/GnNVECMcbTMqayLEpQwd1bZxWqJRqrIotnOvuh1kuc=; b=oJYUyHsqBKJsM8/nYXD3qRa9E91ZtpVefahampKh4hUrtTH9+UjDjOV3MkdYrfyAfGTSHG e3+3vdizaXiH0450+bl9bOYHlL4Tuv0o1Doyb/EfwH/g74esLz6HWs2XARGq6Ud7iVL8D4 xcbD3TVlmQJ0I7fm80IJNwAJWBWo+fF7ovDxr9tjtrEZ1On0iFVzQYjAto7L7jQgp/HPHd hbObfD9HK05Of81xRzebo/sRelOvFMd/Doqj3W0/r70uPxZvKcnxWASJ7M6R32gYBYhn4V Lpe28DTaRat++p162bkiXt/XPL5g5VCAtIcuqrglCTq213nwwC2MIq6RsXuE5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=christianmoe.com header.s=x header.b=CKT+Oc7I; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=christianmoe.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1729499663; a=rsa-sha256; cv=none; b=J/UW5lo6xzOrBb47R5l2MlNom+gZ7sVX0BY0FFefJ/EMEi2tcg5Zdzl3CQ4VvKmIX+ftww QvhnOEVCxXuEWDe4Kn3nIaCaiwQ+309jrhHNzSMaUu4UtcsgJxcmljWCQKa+M+ZjQR5P69 Hy9008pVVIgKDTaq/lCyvFxzbXdWvntzUGl9ZR9k+c36yDyNlucL3Ezy//HuBLgFd+4Wed WZXtxKF4RTXVmSL42mXj6zlu4bf8thkjbnwkU8Xz6w+RQeVBdViH+CZCWNcxajMlzPf2ZH glTsxAZ7E10+qFe9zjXtFXF+PEfxW3WM1gjEKdYu3sKoOkjproi9g/pJw3VqXA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 641697A914 for ; Mon, 21 Oct 2024 10:34:23 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2nr0-0007J3-Vm; Mon, 21 Oct 2024 04:33:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nqy-0007I8-6R for emacs-orgmode@gnu.org; Mon, 21 Oct 2024 04:33:28 -0400 Received: from mailer-211-194.hitrost.net ([91.185.211.194]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nqw-000586-8O for emacs-orgmode@gnu.org; Mon, 21 Oct 2024 04:33:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=christianmoe.com; s=x; h=Content-Type:MIME-Version:Message-ID:In-reply-to: Date:Subject:Cc:To:From:References:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/GnNVECMcbTMqayLEpQwd1bZxWqJRqrIotnOvuh1kuc=; b=CKT+Oc7ISwZU0rYyI5MEMumhgz oo1QtQN/u7VULcKoH8+/InhEyeOni07pgghHslCd4B8MInBMy/Xv/BLhamyydroEsq/GYfA3UCbj2 YPGKmn3rhMCJ8TjDJ2mBKHKKBKSWzIqk0GLdTxzZAwWP62K8P2mLDtwj8k4MO3QZ4OIhLWJ5tBKzp j4Fu4jEayzzIA2fgBeob64bhmNso23W2RsaE/AjgIIU523ye2SAjjvOXnApgGc8bjDxYrJk+t62pQ gQKBqBBFXlUQUhqufEbZ8vrn/hrWxqo5Q/C++7ghuWNp8d88RiD+KzwtFwD3ppvj1M35Ui8V+KQAK mHYrVrtA==; Received: from 84-20-225-53.dynamic.telemach.net ([84.20.225.53] helo=MacMint) by b1.hitrost.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1t2nqo-00000006Jdk-2qDt; Mon, 21 Oct 2024 10:33:18 +0200 References: <871q0j3iv2.fsf@city17.xyz> <87jzeb9ixl.fsf@christianmoe.com> <877caavgj8.fsf@city17.xyz> <87ed4ittcr.fsf@city17.xyz> <87y12q8jiq.fsf@christianmoe.com> <87ed4bq62f.fsf@localhost> User-agent: mu4e 1.6.10; emacs 27.1 From: Christian Moe To: Ihor Radchenko Cc: Christian Moe , jman , emacs-orgmode@gnu.org Subject: Re: Understanding Publish (ox-publish.el) Date: Mon, 21 Oct 2024 09:07:06 +0200 In-reply-to: <87ed4bq62f.fsf@localhost> Message-ID: <874j5526uq.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain X-GeoIP: Country [IP], SI [84.20.225.53] X-Authenticated-Id: mail@christianmoe.com Received-SPF: pass client-ip=91.185.211.194; envelope-from=mail@christianmoe.com; helo=mailer-211-194.hitrost.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam: Yes X-Migadu-Spam: Yes X-Migadu-Spam-Score: 9.50 X-Spam-Score: 9.50 X-Migadu-Queue-Id: 641697A914 X-Migadu-Scanner: mx11.migadu.com X-TUID: c2Tn5UHx6/yb Ihor Radchenko writes: > Christian Moe writes: > >> It's due to Latex refusing to commit the typographic crime of leaving a >> heading at the bottom of the page. >> ... > > and is committing another typographic crime :) > I am wondering if this may somehow be addressed. Indeed. The best place to address it would be in Latex, I suppose. Kind of surprising that it hasn't been. I don't suppose there's any way for Org to know beforehand how much space an empty outline will take on the PDF page. But Org could perhaps just check the outline and insert a page break every so often after a run of empty headers? Something like this hook: #+BEGIN_SRC elisp (defvar my/org-latex-pagebreak-every 20 "Number of empty (sub)headings after which to insert pagebreak.") (defun my/org-latex-insert-pagebreaks (backend) "Insert page breaks in an empty outline on LaTeX export. A page break is inserted for every nth consecutive empty (sub)heading, where n is given by `my/org-latex-pagebreak-after', to allow an empty outline to break gracefully in PDF export." (when (eq backend 'latex) (let ((c 0)) (org-map-entries (lambda () ;; if entry is empty (unless (string-match (org-get-entry) "[[:graph:]]") (setq c (1+ c)) (when (= c my/org-latex-pagebreak-every) (setq c 0) ; reset counter (org-end-of-line) (insert "\n\\clearpage\n")))))))) (add-hook 'org-export-before-parsing-functions #'my/org-latex-insert-pagebreaks) #+END_SRC Yours, Christian