From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QLeMHHnZxGGGfgAAgWs5BA (envelope-from ) for ; Thu, 23 Dec 2021 21:18:01 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id mEdTGHnZxGF+fQAAbx9fmQ (envelope-from ) for ; Thu, 23 Dec 2021 20:18:01 +0000 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 114922B0E4 for ; Thu, 23 Dec 2021 21:18:01 +0100 (CET) Received: from localhost ([::1]:38238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0UXI-00016b-6T for larch@yhetil.org; Thu, 23 Dec 2021 15:18:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0UWM-00015N-5c for emacs-orgmode@gnu.org; Thu, 23 Dec 2021 15:17:02 -0500 Received: from [2001:67c:2050::465:202] (port=17846 helo=mout-p-202.mailbox.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1n0UWJ-0004BK-Qf for emacs-orgmode@gnu.org; Thu, 23 Dec 2021 15:17:01 -0500 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:105:465:1:4:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4JKhLH3MBHzQjmg; Thu, 23 Dec 2021 21:16:55 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1640290613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zITMcf0yPhnOtJzVyzAr1hgH2SzDbp1UmBVbw4hzCCU=; b=MOuLS6K2lSdLwpA0eIpICN8HP3BNKBikT0vSZuisYHPWJOLiAJQLs3K5FWsGwEK8QtKxMs 2HvC2qu952l6G4KndSU+85114u/3+TCkDwiEQrMdLQ1Px8IFMNNbff4tnSoW8/Bq7/Dz5b OpBCLAm44zKXZEZrC0UGQTlWdVcEKaHal3tYm5FED59vZgr73WpuHsTnLVJZsX6Czs9tw+ SfD29QpxDLyEX3bhXtfBq6phOGOmou5cwM3N2DnWSq0e38e76dmzEDqZBoBFCEJbu3UctH yhvH83GsPOVOu85mDXXBQnTA3YOQikwJHehjdCuyU5p7+Ey+tpp6vdrFsEUxag== Message-ID: <22eaa236-e867-da4c-8ec3-84e906a23751@mailbox.org> Date: Thu, 23 Dec 2021 21:16:52 +0100 MIME-Version: 1.0 Subject: Re: Configuring ox-context To: juh , Jason Ross , emacs-orgmode@gnu.org References: <8cde8270-704d-d515-dca4-0a65d910f9cd@gmail.com> <80b1375a-bb79-c401-3f23-e662f2035795@mailbox.org> <08bc53958783811414afe8588cb25cc373c71589.camel@mailbox.org> <735dec68-d319-172c-32ad-49804a8569bb@gmail.com> <55f6016624f755bed17a0895c1b49799ef2d62b7.camel@mailbox.org> <10f190b3-ec80-3305-6ec7-506bc596244d@gmail.com> From: Denis Maier In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:67c:2050::465:202 (failed) Received-SPF: pass client-ip=2001:67c:2050::465:202; envelope-from=denismaier@mailbox.org; helo=mout-p-202.mailbox.org X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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_DNSWL_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640290681; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=zITMcf0yPhnOtJzVyzAr1hgH2SzDbp1UmBVbw4hzCCU=; b=Fz+Cf1cI5mc5jtkWiEJ0ads7KQmQv9cpfDDP9uBwJ4wstW6/Cz5SA60Qb+fJi4WawSPArK IZsHb0psbQbfhT4RQFZ4sV5u7w4pF2lrwO51Jz63JvaHElRSDaoVJMkWq5M4dgO/UqEvH1 p2PLQClQ6MzNeNOSL4hIeG4FfteJrOrbrmY3v0DCBrTOQo0r9nCKcQgLqqCebwqFkdYwz7 NtqvYSntmfFRo68QxmRP5LtggKd/hlgFK5zoVMw2ZMeITjv8VRQ8PDOvDPkzA8q7qcLGBQ GtX3n9Yd6wfX6BbYshl+0Fr8K0vkMF4ql5AWJsvjRFJ6a35+UnFurPgEundmig== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640290681; a=rsa-sha256; cv=none; b=fxFGsNOt9iASGcv3oWIjBEVWS6RbzEfV6lE4JhCFiNHGvoff9g8TBENRzw6X7edMXl7xEk bOm8aFQfft8r2ZrwAGWcWgc6uYv/GQXl9wcCtlPCb+cQkjfXVU5ZNopgrZ9oOajpTTyRhm L94xUQgopU+XIhQBhjLOvZuJk/2nP+MQSlCT7J8oWkpTGtEfR4IO+Dk22Ncr0xcxxFnyF+ iL+CfcRM59T4gG5pe3wkWIHJL1c3xKiJiVny7X7qyE/JAXFQVVGWjVboAIenvL0SFKZcQH D+RnKtFJs75ZLg10sInkD15sB2foLGFo9iGZAm+SVgyoA983r0ZL/BRyMyJpXw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=MOuLS6K2; dmarc=pass (policy=reject) header.from=mailbox.org; 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" X-Migadu-Spam-Score: -4.35 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=MOuLS6K2; dmarc=pass (policy=reject) header.from=mailbox.org; 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" X-Migadu-Queue-Id: 114922B0E4 X-Spam-Score: -4.35 X-Migadu-Scanner: scn0.migadu.com X-TUID: hLv1xKUnCte1 What do you think about using context's structurelevels instead? That would allow users to define their own mappings. Denis Am 23.12.2021 um 08:24 schrieb juh: > Am Mittwoch, dem 22.12.2021 um 10:37 -0800 schrieb Jason Ross: >> >> 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. > > I think that the scheme is conventional, and grown up with books and > LaTeX we are accustomed to it. The chapter-title scheme seems to be > from ConTeXt and I don't know the real reason behind this. > > For me the part-chapter-section line is the book oriented sectioning > (with or without numbering) as books can have parts, often have > chapters and sometimes sections. > > The title-subject line is the magazine oriented line, because articles > in a magazine or essays in a collection only have titles and subjects, > and they are complete units which could be published elsewhere. > > (Sometimes I use titles to mark special chapters that don't appear in > the table of contents.) > > I don't think that what we do is always logical and consistent in > itself. But it might be a good memory hook to organize different items > such as books with chapters, articles and independent essays collected > in a book. > > To get a broader view on this, we should discuss it in the ConTeXt > mailinglist. > > I am deploying a production chain with Markdown-Pandoc-ConTeXt in my > organization. AFAIK Pandoc only produces the part-chapter-section line > while the highest level is configurable. So if we ever need a title- > subject scheme we will have to use filters. > >> 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. >> > > Yes I think they are flexible enough and I can customize my styles, but > I would prefer to have a solution which can be used with the usual > sectioning of ConTeXt. > > My proposal would be > > 1.) to have a switch for using > (a) the part-chapter-section line or > (b) the title-subject-line on export. > > 2.) to have a customization for (a) similiar to pandocs "top-level- > division" > > > >> 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 >> >> > Thanks a lot. I will try this the next days. > >> >> >> This is fixed on the "develop" branch as of today. I missed a >> comma... > > Great. > > juh > > >