From: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: Re: Adding functionality to org-latex-classes
Date: Mon, 1 Jan 2024 09:06:19 +0100 [thread overview]
Message-ID: <CAO48Bk8JpXmz8=HTsQDjk1inLqkbfJmFNjDJ94HV10Z8=UDn1Q@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1923 bytes --]
>Message: 16
>Date: Sun, 31 Dec 2023 14:40:32 +0000
>From: Ihor Radchenko <yantar92@posteo.net>
>To: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
>Cc: Org Mode List <emacs-orgmode@gnu.org>
>Subject: Re: Adding functionality to org-latex-classes
>Message-ID: <87ttny77vj.fsf@localhost>
>Content-Type: text/plain
>
>Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes:
>
>> I was just wondering whether it would be possible to add further
>> functionality to org-latex-classes and would like to start a discussion
;-)
>>
>> My use case is the following:
>>
>> The document class is tightly coupled with ~org-latex-subtitle-format~
>> and ~org-latex-subtitle-separate~. Koma-script classes, for example,
need
>> those variables to be defined with file or directory local variables in
>> order to take full profit of the layouts. If we found a way of
>> accommodating them in the class definitions, the fuzz of the extra
>> variables could easily be overcome.
>
>We may extend `org-latex-classes' to allow custom backend option values.
>For example,
>
> (latex-subtitle-format . value)
> (latex-subtitle-separate . value)
>
>Then, we can use these values as the overrides when the variables are
>not set explicitly as buffer-locals or as in-buffer/subtree export
>keywords.
>
>--
>Ihor Radchenko // yantar92,
>Org mode contributor,
>Learn more about Org mode at <https://orgmode.org/>.
>Support Org development at <https://liberapay.com/org-mode>,
>or support my work at <https://liberapay.com/yantar92>
Attached is a concept which might be useful. At least it detects when
variables are set locally and then doesn't attempt anything.
Peaceful New Year,
/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: 2910 bytes --]
[-- Attachment #2: org-latex-classes.el --]
[-- Type: text/x-emacs-lisp, Size: 1552 bytes --]
;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with 'C-x C-f' and enter text in its buffer.
(defun is-in-local-variable-alists (sym)
"Check if symbol is in any local variable alist"
(when
(or (and (boundp 'connection-local-variables-alist)
(assoc sym connection-local-variables-alist))
(and (boundp 'file-local-variables-alist)
(assoc sym file-local-variables-alist))
(and (boundp 'dir-local-variables-alist)
(assoc sym dir-local-variables-alist)))
t))
(defun local-or-latex-class ()
(interactive)
;;
;; This would come from ox-latex
;;
(let ((test '((org-latex-subtitle-format . "\\subtitle{%s}")
(org-latex-subtitle-separate . t))))
(mapcar #'(lambda (element)
(let* ((sym (car element))
(skip (is-in-local-variable-alists sym))
(sym-name (symbol-name sym))
(val (cdr element)))
;; (message "--> %s" element)
;; (if skip
;; (message "%s set as file-local" sym-name)
;; (progn
;; (message "Will set %s to %s" sym-name val)
;; (eval '(setq sym-name val))))))
(unless skip
(eval '(setq sym-name val)))))
test)
(message "Is separate: %s" org-latex-subtitle-separate)
(message "subtitle: %s" org-latex-subtitle-format))
)
next reply other threads:[~2024-01-01 8:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-01 8:06 Pedro Andres Aranda Gutierrez [this message]
2024-01-01 9:21 ` Re: Adding functionality to org-latex-classes Ihor Radchenko
2024-01-01 17:00 ` Pedro Andres Aranda Gutierrez
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAO48Bk8JpXmz8=HTsQDjk1inLqkbfJmFNjDJ94HV10Z8=UDn1Q@mail.gmail.com' \
--to=paaguti@gmail.com \
--cc=emacs-orgmode@gnu.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 public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).