From: Jason Ross <jasonross1024@gmail.com>
To: juh <juh+org-mode@mailbox.org>, emacs-orgmode@gnu.org
Subject: Re: Configuring ox-context
Date: Wed, 22 Dec 2021 10:37:39 -0800 [thread overview]
Message-ID: <10f190b3-ec80-3305-6ec7-506bc596244d@gmail.com> (raw)
In-Reply-To: <55f6016624f755bed17a0895c1b49799ef2d62b7.camel@mailbox.org>
On 12/22/21 3:24 AM, juh wrote:
> In the meantime I debugged my context styles and discovered that ox-
> context starts with section not with chapters. My styles are always
> book styles starting at chapter level. *feeling a little dumb*
>
> I browsed through the code and found no hint for a book-like preset or
> a switch to start at chapter level. I made a feature request about
> this.
Thank you for bringing this up. I'd like to discuss this a bit with you
before implementing such a feature.
I'm not sure how an implementation of this would look to the end user.
ConTeXt has the following system:
https://wiki.contextgarden.net/Command/_section
\part highest level of sectioning
\chapter level 2
\section level 3
\subsection level 4
\subsubsection level 5
\subsubsubsection level 6
\subsubsubsubsection level 7
\title level 2, unnumbered
\subject level 3, unnumbered
\subsubject level 4, unnumbered
\subsubsubject level 5, unnumbered
\subsubsubsubject level 6, unnumbered
\subsubsubsubsubject level 7, unnumbered
So there are a couple of questions that need to be answered:
1. There's no "level 1, unnumbered" sectioning command in ConTeXt.
How should this be handled?
2. How does the user specify which sectioning scheme to use?
Question (1) implies that the user may need to choose their highest
level to be either a part or a chapter in order to have unnumbered
level 1 sections. Things start to get complicated if we do that.
To avoid these questions, I went with the simplest implementation
possible and just concatenated "sub"*n with either "section" or
"subject" to create a sectioning command of depth n.
My understanding is that the sectioning commands are flexible enough
that any desired result in the output pdf can be produced by modifying
the sectioning commands in the preamble. However, if you are using
existing environments that rely on those specific names you are out of
luck.
For your purposes, if you need a fix _right now_, consider overriding
the definition of `org-context--get-headline-command` to something
like this:
#+begin_src elisp
(defun org-context--get-headline-command (headline info)
"Create a headline name with the correct depth.
HEADLINE is the headline object. INFO is a plist containing
contextual information."
(let* ((level (org-export-get-relative-level headline info))
(numberedp (org-export-numbered-headline-p headline info))
(hname
(cond
((and (= 1 level) numberedp) "chapter")
((= 1 level) "title")
(t (let ((prefix (apply 'concat (make-list (+ level (- 2))
"sub")))
(suffix (if numberedp "section" "subject")))
(concat prefix suffix)))))
(notoc (org-export-excluded-from-toc-p headline info)))
(if notoc
(format "%sNoToc" hname)
hname)))
#+end_src
> One more thing.
>
> #+begin_quote
>
> results in the verbatim line
>
> OrgBlockQuoteEnumEmpty 1
>
> in the pdf and a very indented quote block.
>
> In html export I get an normal indented blockquote.
This is fixed on the "develop" branch as of today. I missed a comma...
Thanks,
Jason
next prev parent reply other threads:[~2021-12-22 18:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-21 15:50 Configuring ox-context juh
2021-12-21 16:19 ` Jason Ross
2021-12-21 17:55 ` juh
2021-12-21 18:04 ` Jason Ross
2021-12-21 18:36 ` juh
2021-12-21 18:56 ` juh
2021-12-21 19:05 ` Jason Ross
2021-12-22 11:24 ` juh
2021-12-22 18:37 ` Jason Ross [this message]
2021-12-23 7:24 ` juh
2021-12-23 20:16 ` Denis Maier
2021-12-24 16:36 ` Jason Ross
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=10f190b3-ec80-3305-6ec7-506bc596244d@gmail.com \
--to=jasonross1024@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=juh+org-mode@mailbox.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).