Re: [PATCH]: add BEAMER_CLASS_OPTIONS

2025-04-08 Thread Pedro Andres Aranda Gutierrez
A new version of the patch, including a test for the new
#+BEAMER_CLASS_OPTIONS

Best, /PA

On Tue, 8 Apr 2025 at 09:08, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> Hmmm...
>
> Isn't it enough to it select with
> #STARTUP: beamer
>
> I have not used any alternative class to 'beamer' when using beamer...
> After all these years, I'd be 8-0 to learn you can use
> other latex classes to generate beamer presentations... but again, could
> be another instance of the proverb
> "you will never go to sleep without learning something new"
>
> And I'm always open to learning new stuff :-)
>
> Thx, /PA
>
> On Tue, 8 Apr 2025 at 07:29, David Masterson 
> wrote:
>
>> Pedro Andres Aranda Gutierrez  writes:
>>
>> > Good point, maybe I didn't explain clearly enough.
>> > #+BEAMER_CLASS_OPTIONS: will only take effect when exporting to
>> > BEAMER.  It is enforced in (org-beamer-template) when and if
>> > present. You can always continue using #+LATEX_CLASS: and
>> > #+LATEX_CLASS_OPTIONS: for backward compatibility or other reasons.
>>
>> Should there be a #+BEAMER_CLASS to go with #+BEAMER_CLASS_OPTIONS ??
>>
>> --
>> David Masterson
>>
>
>
> --
> Fragen sind nicht da, um beantwortet zu werden,
> Fragen sind da um gestellt zu werden
> Georg Kreisler
>
> Sagen's Paradeiser, write BE!
> Year 1 of the New Koprocracy
>
>

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

Sagen's Paradeiser, write BE!
Year 1 of the New Koprocracy
From fcc09ae045806d18bc8534f690b368041c0ec0a5 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Tue, 8 Apr 2025 12:08:45 +0200
Subject: [PATCH] New BEAMER_CLASS_OPTIONS

* lisp/ox-beamer.el: Add #+BEAMER_CLASS_OPTIONS
(org-beamer-template) replace the class options with the
#+BEAMER_CLASS_OPTIONS, if defined.
* testing/lisp/test-ox-beamer.el: Add test for new
#+BEAMER_CLASS_OPTIONS
* doc/org-manual.org: Add entry explaining new
#+BEAMER_CLASS_OPTIONS

---
 doc/org-manual.org | 12 
 etc/ORG-NEWS   | 11 +++
 lisp/ox-beamer.el  | 10 +-
 testing/lisp/test-ox-beamer.el | 14 ++
 4 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 7561c0d62..5a6039ba1 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13064,6 +13064,18 @@ Beamer export backend has several additional keywords for customizing
 Beamer output.  These keywords work similar to the general options
 settings (see [[*Export Settings]]).

+- =BEAMER_CLASS_OPTIONS= ::
+
+  #+cindex: @samp{BEAMER_CLASS_OPTIONS}, keyword
+
+  The options to pass to the beamer class. It is the equivalent
+  to ~LATEX_CLASS_OPTIONS~ in the LaTeX exporter.  For example:
+
+  : #+BEAMER_CLASS_OPTIONS: [handout,12pt,t]
+
+  would produce a handout (as opposed to the slides) with 12pt fonts
+  and align the slide contents to the top of the contents space.
+
 - =BEAMER_THEME= ::

   #+cindex: @samp{BEAMER_THEME}, keyword
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 982bac4e9..8f6911a50 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -215,6 +215,17 @@ take the date as an argument, and generate a list of pairs for
 types of datetrees (e.g. for lunar calendars, academic calendars,
 retail 4-4-5 calendars, etc).

+*** New keyword ~#+BEAMER_CLASS_OPTIONS:~
+
+~#+BEAMER_CLASS_OPTIONS~ is a equivalent to ~#+LATEX_CLASS_OPTIONS~ for
+documents that are meant to be exported to LaTeX/beamer presentations.
+An example: add
+#+BEGIN_EXAMPLE
+#+BEAMER_CLASS_OPTIONS: [handout,t]
+#+END_EXAMPLE
+to produce a handout of the presentation with the items aligned at the
+top of the slide contents space.
+
 ** New and changed options

 # Changes dealing with changing default values of customizations,
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index e862da99d..2f72fa4e3 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -259,6 +259,7 @@ Return overlay specification, as a string, or nil."
   :options-alist
   '((:headline-levels nil "H" org-beamer-frame-level)
 (:latex-class "LATEX_CLASS" nil "beamer" t)
+(:beamer-class-options "BEAMER_CLASS_OPTIONS" nil "[presentation]" t)
 (:beamer-subtitle-format nil nil org-beamer-subtitle-format)
 (:beamer-column-view-format "COLUMNS" nil org-beamer-column-view-format)
 (:beamer-theme "BEAMER_THEME" nil org-beamer-theme)
@@ -872,7 +873,14 @@ holding export options."
  ;; LaTeX compiler
  (org-latex--insert-compiler info)
  ;; Document class and packages.
- (org-latex-make-preamble info)
+ (let* ((preamble  (org-latex-make-preamble info))
+(beamer-class-options (plist-get info :beamer-class-options)))
+   (if beamer-class-options
+   ;; modify the documentclass only
+   (replace-regexp-in-string "class\\[[^]]+\\]"
+ (concat "class " beamer-class-options)
+ preamble)
+   preamble))

#17 [[bbb:OrgMeetup]] on Wed, Apr 9, 19:00 UTC+3

2025-04-08 Thread Ihor Radchenko
Dear all,

Another OrgMeetup will be scheduled on the second Wednesday of April,
**tomorrow**. Let's do it on schedule, even at the cost of late notice.

Previous meetup notes:
https://list.orgmode.org/87friitxvw.fsf@localhost/T/#u

WORG page with earlier notes and meetup schedule:
https://orgmode.org/worg/orgmeetup.html

URL: https://bbb.emacsverse.org/rooms/orgmeetup/join
Time & Date: <2025-04-09 Wed 19:00-21:00 @+03,Europe/Istanbul>

During the meetup, we can:

- Give advice to new users
- Showcase Org configs or workflows
- Demo/discuss interesting packages
- Troubleshoot each-other's issues
- Discuss Org mode development
- Discuss "Org mode" section of Emacs news (https://sachachua.com/blog/)
- Discuss anything else Org-related

Everyone is free to join the discussion/chat or lurk around silently,
listening.

We will _not_ do any recording by default.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[BLOG] #16 [[bbb:OrgMeetup]] on Wed, Feb 12, 19:00 UTC+3

2025-04-08 Thread Ihor Radchenko
Dear all,

Kinda late, but I gotta post the meetup notes anyway :)
Not everything survived the memories, but I managed to write most parts
shortly after the meetup, before I got busy with work.

TL;DR: latex fontification slowness, org-font-lock-element branch,
fast searching of Org buffer AST, evolving Org notes over years, org-merge-tool,
org-crypt, org-crypt-refactor branch, GPG on Android, note-taking
packages for Emacs, speed of opening many Org buffers, highlight-parentheses


We moved back to using BigBlueButton, kindly provided by Sasha Chua.

- As usual, we started from the latest Emacs news
  https://sachachua.com/blog/2025/02/2025-02-10-emacs-news/

- karthink complained about Org mode sometimes being slow when
  ~org-highlight-latex-and-related~ is set to highlight latex fragments
  - This is a known problem related to way too complex regexp used
to search for fragments (see ~org-latex-regexps~)
  - The proper way to solve it is implementing fontificating via
parser (with object cache!)
[[https://orgmode.org/list/87ee7c9quk.fsf@localhost]]
  - However, even adding object cache to the parser is not
trivial. The new =org-element-ast.el= library is one of the steps
in this direction. It will need to be followed by improving
=org-element= itself and then completely rewriting Org's
fontification as in

https://git.sr.ht/~yantar92/org-mode/tree/feature/org-font-lock-element/item/lisp/org-font-lock-core.el
  - TL;DR: Not soon
  - Another option could be using Org parser on the current
fontification code specifically for latex fragments
- The problem here is that ~org-element-context~ can have
  quadratic complexity with number of markup objects in paragraph
  (which is why having parser cache for objects is important)
- On the other side, the current approximate regexp-based approach
  is proven to be slow. So, one may try using
  ~org-element-context~ + simplified regexp and see how it
  compares with the current gigantic regexp. If the performance is
  improved, maybe we can go for it even without changes in the parser
  - Example how to search for something and query the parser
#+begin_src emacs-lisp
  (while (re-search-forward "\\$\\|\\(?:[a-zA-Z[(]\\|[ 
\t]*$\\|_ +\\)" nil t)
(let ((object (org-element-context)))
  (when (org-element-type-p object 'latex-fragment)
(message (buffer-substring-no-properties
(org-element-begin object)
  (org-element-end object)))
;; do the fontification
)))
#+end_src
  - The function doing fontification that needs to be changed is 
~org-do-latex-and-related~

- Jake asked about testing and changing note organization in Org mode
  - He had a very specific idea about somehow maintaining multiple
outline/file taxonomies in different git branches and
synchronizing them automatically
  - He looked into our old GSoC project

https://orgmode.org/worg/org-contrib/gsoc2012/student-projects/git-merge-tool/manual.html
- org-merge-tool is Org syntax-aware implementation of git merge
- It is not meant to maintain multiple taxonomies but rather aims
  at merging diverged versions of the same Org file
  - In general, I doubt that there is a universal automatic solution to
transition between multiple Org file structures. One would need to
write a custom code depending on the specific personal structures
  - That said, it is often the case that Org file structure changes
over time - types of information may change; common tasks may
change; experience with Org mode growth; etc etc
  - I personally went through multiple refactors of my personal
knowledge bases over the 10+ years I am using Org mode
  - I tend to approach such refactors slowly
+ I do not try converting everything at once
+ Instead, I add _new_ information into the new taxonomy while
  keeping the old information as is
+ After some time (when I make sure that the new taxonomy really
  works), I slowly move pieces and bits of information from the
  old taxonomy
+ Such move may take anywhere between weeks and years. I usually
  just create a repeating task to move a few bits from old to new
  structure. Manually, spending ~5min per day (or more, if I have
  mood/time).
  - The slow, manual approach works for arbitrary taxonomies

- Zororg asked about using org-crypt
  - org-crypt encrypts portions of Org files, keeping encrypted
version on disk while temporarily decrypting it via M-x
org-decrypt-entries (or just M-x org-reveal)
  - the encrypted text is still plain text, so it can be synced as usual
  - currently, org-crypt works best with gpg keys
  - symmetric encryption also works, but Org will ask for a password
for each individual subtree that is going to be encrypted, which
is not always conveni

Re: [DISCUSSION] Setting LuaLaTeX as default when exporting to LaTeX/PDF

2025-04-08 Thread Juergen Fenn



Am 03.04.25 um 09:37 Uhr schrieb Ihor Radchenko:
>> I don't agree. Users who are apparently happy with LuaLaTeX should
>> have no problems with pdflatex and UTF8.
> If you know an easy and universal way to support UTF8 is pdflatex,
> please do share.

I am sorry I could not read all the discussion up to here, but you might
like to take a look at this discussion that took place on several TUG
mailing lists whe TeX Live 2025 was published over the last weeks as to
whether to use pdftex, luatex, or xetex as the default engine. It turns
out that only luatex is capable of producing accessible pdf, next comes
pdftex, "albeit with some restrictions", and xetex falls short of this
feature. So most probably only luatex will be used in the long run, as
accessibility will be required for most publications, at least for
scientific papers. This is not only a ITF-8 issue. I'm surprised TeX
Live is said not to work properly out of the box on some Linux
distributions, hard to believe it's true. Please check again and report
to the appropriate tracker in case it really does not work on your system.

https://tug.org/pipermail/tex-live/2025-March/051258.html

Regards,
Jürgen.



Re: [DISCUSSION] Setting LuaLaTeX as default when exporting to LaTeX/PDF

2025-04-08 Thread Pedro Andres Aranda Gutierrez
And what about the speed of xelatex? I have not used it, because when I
tried some time ago, it didn't handle fonts as nicely as lualatex, but I'd
be willing to learn if that means a speedy UTF.8 sound latex.

Thx, /PA

On Tue, 8 Apr 2025 at 16:39, Leo Butler  wrote:

> On Thu, Apr 03 2025, Ihor Radchenko  wrote:
>
> > Karthik Chikmagalur  writes:
> >
> >> For org-latex-preview, one of the other things we tried was to keep all
> >> utf-8 font-related settings out of the header that is precompiled.  If
> >> we manage this precompilation can work (somewhat unreliably) with
> >> lualatex, and previews are a bit faster.  But doing this via string
> >> matching is difficult and fragile.  And even with precompilation,
> >> lualatex has a slow startup time, and we are some distance away from < 1
> >> sec preview updates.
> >
> > I am wondering if the current design with many previews generated using
> > the same latex process can be extended. May we somehow add a Lua code to
> > preview.sty that will not exit at all and watch for new .tex fragments
> > to appear and preview them. The idea is to avoid stopping lualatex
> > process most of the time (unless preamble has to be changed) and make it
> > work like a server. That may bring the preview speed to acceptable
> levels.
>
> Do you mean preview.sty from the preview package [1]?
>
> My understanding of this thread on tug.org [2] is that there isn't an
> easy way to do what you want from within luatex (and the luatex
> developpers are un-interested in speeding up luatex).
>
> I suppose that we could create a stable of luatex processes that are
> waiting for input. I don't know if that would speed things up
> appreciably, though.
>
> Leo
>
> [1] - https://ctan.org/tex-archive/macros/latex/contrib/preview
> [2] - https://tug.org/pipermail/luatex/2023-December/thread.html#7898



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

Sagen's Paradeiser, write BE!
Year 1 of the New Koprocracy


Re: [PATCH]: add BEAMER_CLASS_OPTIONS

2025-04-08 Thread David Masterson
Pedro Andres Aranda Gutierrez  writes:

> On Tue, 8 Apr 2025 at 07:29, David Masterson  wrote:
>>
>>  Should there be a #+BEAMER_CLASS to go with #+BEAMER_CLASS_OPTIONS
>>  ??
>
> Isn't it enough to it select with 
> #STARTUP: beamer

As I think was asked before, how would you set this up in a single Org
file such that, via (say) org-publish, you could export to:

+ Beamer
+ Latex
+ HTML
+ etc

In theory, I would like the setup to be "similar" for each to help
newbies (ie. me) not confuse things by asking "why are these
different -- am I missing something?"

Standards are good.

-- 
David Masterson



Re: [DISCUSSION] Setting LuaLaTeX as default when exporting to LaTeX/PDF

2025-04-08 Thread Leo Butler
On Thu, Apr 03 2025, Ihor Radchenko  wrote:

> Karthik Chikmagalur  writes:
>
>> For org-latex-preview, one of the other things we tried was to keep all
>> utf-8 font-related settings out of the header that is precompiled.  If
>> we manage this precompilation can work (somewhat unreliably) with
>> lualatex, and previews are a bit faster.  But doing this via string
>> matching is difficult and fragile.  And even with precompilation,
>> lualatex has a slow startup time, and we are some distance away from < 1
>> sec preview updates.
>
> I am wondering if the current design with many previews generated using
> the same latex process can be extended. May we somehow add a Lua code to
> preview.sty that will not exit at all and watch for new .tex fragments
> to appear and preview them. The idea is to avoid stopping lualatex
> process most of the time (unless preamble has to be changed) and make it
> work like a server. That may bring the preview speed to acceptable levels.

Do you mean preview.sty from the preview package [1]?

My understanding of this thread on tug.org [2] is that there isn't an
easy way to do what you want from within luatex (and the luatex
developpers are un-interested in speeding up luatex).

I suppose that we could create a stable of luatex processes that are
waiting for input. I don't know if that would speed things up
appreciably, though.

Leo

[1] - https://ctan.org/tex-archive/macros/latex/contrib/preview
[2] - https://tug.org/pipermail/luatex/2023-December/thread.html#7898


[BUG] Incorrect custom types for org-refile-targets, org-capture-templates and org-capture-templates-contexts [9.7.11 (release_9.7.11 @ /usr/local/share/emacs/30.1/lisp/org/)]

2025-04-08 Thread Omar Antolín Camarena


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


I get warnings that org-refile-targets, org-capture-templates and
org-capture-templates-contexts do not satisfy their defcustom :type
specifications, and I believe the reason is that those type
specifications are incorrect!

1. For org-refile-targets the defcustom :type specifies that each list starts 
with:

(choice :value org-agenda-files
(const :tag "All agenda files" org-agenda-files)
(const :tag "Current buffer" nil)
(function) (variable) (file))

I believe (file) should be (repeat (file)) since the docstring says:

- a specification of the files to be considered, either a LIST OF FILES,
  or a symbol whose function or variable value will be used to retrieve
  a file name or a list of file names.  If you use ‘org-agenda-files’ for
  that, all agenda files will be scanned for targets.  Nil means consider
  headings in the current buffer.

2. For org-capture-templates-contexts the defcustom :type specifies
that each list must have:

(string :tag "Capture key")
(string :tag "Replace by template")

but the docstring specifies the "Replace by template" part is optional.

3. For org-capture-templates I couldn't quickly figure out what was
wrong, but I believe my configuration is correct (and org-capture
certainly works), so I believe there is probably another error in the
defcustom :type specifier. You can find my org-capture-templates
configuration below.

Emacs  : GNU Emacs 30.1 (build 4, x86_64-pc-linux-gnu, X toolkit, cairo version 
1.16.0, Xaw scroll bars)
 of 2025-02-25
Package: Org mode version 9.7.11 (release_9.7.11 @ 
/usr/local/share/emacs/30.1/lisp/org/)

current state:
==
(setq
 org-capture-templates-contexts '(("r"
   ((in-mode . "gnus-article-mode")
(in-mode . "gnus-summary-mode"))
   )
  )
 org-special-ctrl-a/e t
 org-agenda-skip-scheduled-if-done t
 org-yank-image-file-name-function 'org-yank-image-autogen-filename
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-pretty-entities t
 org-preview-latex-image-directory "~/.cache/ltximg/"
 org-log-into-drawer t
 org-refile-allow-creating-parent-nodes 'confirm
 org-directory "~/Notes"
 org-latex-format-inlinetask-function 
'org-latex-format-inlinetask-default-function
 org-structure-template-alist '(("a" . "export ascii") ("c" . "center")
("C" . "comment") ("e" . "example")
("E" . "export") ("h" . "export html")
("l" . "export latex") ("q" . "quote")
("s" . "src") ("v" . "verse")
("thm" . "theorem") ("pf" . "proof")
("lem" . "lemma") ("cor" . "corollary")
("def" . "definition") ("rem" . "remark")
("exer" . "exercise") ("prop" . "proposition")
("el" . "src emacs-lisp"))
 org-speed-command-hook '(org-speed-command-activate
  org-babel-speed-command-activate)
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-finalize-hook '(org-modern-agenda)
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-export-async-init-file "~/.emacs.d/my-lisp/org-async-init.el"
 org-modern-mode-hook '(org-modern-mode-set-explicitly)
 org-mode-hook '(#[0 "\301\211\207"
   [imenu-create-index-function org-imenu-get-tree] 2]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-fold-show-all append
local]
   5]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all
append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes
 echo-area-tooltips add-pretty-entities-hook
 org-tweak-syntax-table turn-on-auto-fill
 ediff-with-org-show-all turn-on-org-cdlatex beginend-org-mode)
 org-hide-emphasis-markers t
 org-use-speed-commands t
 org-hide-leading-stars t
 org-capture-templates '(("t" "Task" entry (file "~/Orgzly/Tasks.org")