all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
To: rudolf@adamkovic.org
Cc: Org Mode List <emacs-orgmode@gnu.org>,
	Ihor Radchenko <yantar92@posteo.net>
Subject: Re: LaTeX export is broken with 'num:nil` and 'ALT_TITLE`
Date: Fri, 27 Dec 2024 07:59:40 +0100	[thread overview]
Message-ID: <CAO48Bk_29YE1RvQ56M427CFGqtGD+rr2xmRobKsS6ULS5030VA@mail.gmail.com> (raw)
In-Reply-To: <495AE5B0-0551-40EC-B501-B681E479D261@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2064 bytes --]

Hi,

A quick fix (on main) attached. With this ALT_TITLE is ignored in the
document with #+OPTIONS: num:nil and if #+OPTIONS: num:t and :PROPERTIES:
:UNNUMBERED: t

MWE:
----
#+OPTIONS: num:t

* Test
:PROPERTIES:
:UNNUMBERED: t
:ALT_TITLE: alt
:END:

This is a test.

* Numbered test
:PROPERTIES:
:alt_title: alt numbered
:END:

This is the second part of the test.
----

PS: maybe a rework of this part to make it more readable could be
desirable....

Seasons greetings, /PA

On Thu, 26 Dec 2024 at 18:15, Pedro Andres Aranda Gutierrez <
paaguti@gmail.com> wrote:

> A MWE:
>
> ——
> \documentclass{article}
>
> \title{test}
> \author{paranda }
> \date{December 2024}
>
> \begin{document}
>
> \maketitle
> \tableofcontents
>
> \section{Introduction}
>
> \subsection[Sub - shown 1]{Sub intro - shown}
> This section shows up with a modified heading
> \subsection*{Sub intro - hidden}
> This subsection doesn't show up in the ToC
> \subsection{Sub intro - shown 2}
> This subsection shows up as is in the ToC
> \end{document}
> ——
> > El 26 dic 2024, a las 18:08, Pedro Andres Aranda Gutierrez <
> paaguti@gmail.com> escribió:
> >
> > Hi Rudolf,
> >
> > After playing around with the generated LaTeX in overleaf, I have to
> conclude that the problem is that ALT_TITLE should be not generated for
> unnumbered chapters, sections, etc. As far as my LaTeX goes, you use the
> [alt_title] to get something different in the TOC, so it makes no sense and
> LaTeX doesn’t cater for it.
> >
> > Solutions from the org-mode side:
> > 1. You don’t use ALT_TITLE if section is unnumbered (easier)
> > 2. We make org-mode throw an error in this case (???)
> >
> > Discussion open ;-)
> >
> > Seasons greetings,
> > /PA
>
>

-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #1.2: Type: text/html, Size: 2944 bytes --]

[-- Attachment #2: fix.diff --]
[-- Type: text/x-patch, Size: 899 bytes --]

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 4b2e797d0..6507a1c42 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2402,10 +2402,10 @@ holding contextual information."
 				  (string-match-p "\\<local\\>" v)
 				  (format "\\stopcontents[level-%d]" level)))))
 		    info t)))))
-	  (if (and (or (and opt-title (not (equal opt-title full-text)))
+	  (if (and numberedp (or (and opt-title (not (equal opt-title full-text)))
                        ;; Heading contains footnotes.  Add optional title
                        ;; version without footnotes to avoid footnotes in
-                       ;; TOC/footers.
+                       ;; TOC/footers for numbered sections *only*
                        (and (not (equal full-text-no-footnote full-text))
                             (setq opt-title full-text-no-footnote)))
 		   (string-match "\\`\\\\\\(.+?\\){" section-fmt))

  reply	other threads:[~2024-12-27  7:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-26 17:08 LaTeX export is broken with 'num:nil` and 'ALT_TITLE` Pedro Andres Aranda Gutierrez
2024-12-26 17:15 ` Pedro Andres Aranda Gutierrez
2024-12-27  6:59   ` Pedro Andres Aranda Gutierrez [this message]
2024-12-27 17:43     ` Ihor Radchenko
2024-12-27 17:56       ` Pedro Andres Aranda Gutierrez
2024-12-27 18:01         ` Ihor Radchenko
2024-12-27 18:07           ` Pedro Andres Aranda Gutierrez
  -- strict thread matches above, loose matches on Subject: below --
2024-12-25 17:45 Rudolf Adamkovič
2024-12-26 15:08 ` Ihor Radchenko

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=CAO48Bk_29YE1RvQ56M427CFGqtGD+rr2xmRobKsS6ULS5030VA@mail.gmail.com \
    --to=paaguti@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rudolf@adamkovic.org \
    --cc=yantar92@posteo.net \
    /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.