From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GCw3NKIkxGFZJgAAgWs5BA (envelope-from ) for ; Thu, 23 Dec 2021 08:26:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id qKq5L6IkxGGJbQAAbx9fmQ (envelope-from ) for ; Thu, 23 Dec 2021 07:26:26 +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 6E21C1A9F5 for ; Thu, 23 Dec 2021 08:26:26 +0100 (CET) Received: from localhost ([::1]:41474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0IUb-0004WJ-H4 for larch@yhetil.org; Thu, 23 Dec 2021 02:26:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ISs-0004VG-NY for emacs-orgmode@gnu.org; Thu, 23 Dec 2021 02:24:39 -0500 Received: from [2001:67c:2050::465:102] (port=34412 helo=mout-p-102.mailbox.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1n0ISq-00070z-JG for emacs-orgmode@gnu.org; Thu, 23 Dec 2021 02:24:38 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1: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-102.mailbox.org (Postfix) with ESMTPS id 4JKMC26wDfzQjkC; Thu, 23 Dec 2021 08:24:30 +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=1640244268; 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=YEAI/ewOC7jV0yp2k/XYlBKWeEeJT6rQXQ8SE6PVxJs=; b=TpwxQ7d3fEBAlUeJOJxWKvkHuo2tk+VKIDWImk50FUO8LRz/mb1v/ZtrNSi7XynAdf1KHX lRSxIRb/X00MOCkZK9kWHcmgUNlUbO5Oh2E+/rNQbGGdUtc4SKa68I6P1pvIdRYuUexzwO Ib/T+qFpE93QbP3HlFUaOFlqihOIEJXCmE7wSWnxjM3NivkpBkVd4OGpJq5SEZsccf5bDg OsenuDejAEBAKfCq7GldeZPtcUYf+U9wskPykcHd7NGzreLgH7ZrgSnggFJliQxL/3KDft ud/VwZ03glIF/zJGzoRHFwFkna211X3IG4k8wSlFb76ncmGNlzJbS/eFXYAduw== Message-ID: Subject: Re: Configuring ox-context From: juh To: Jason Ross , emacs-orgmode@gnu.org Date: Thu, 23 Dec 2021 08:24:25 +0100 In-Reply-To: <10f190b3-ec80-3305-6ec7-506bc596244d@gmail.com> 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> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:67c:2050::465:102 (failed) Received-SPF: pass client-ip=2001:67c:2050::465:102; envelope-from=juh+org-mode@mailbox.org; helo=mout-p-102.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=1640244386; 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=YEAI/ewOC7jV0yp2k/XYlBKWeEeJT6rQXQ8SE6PVxJs=; b=RxCIZqV1aE1P6ICKswqbXdMqLH8Kv6hG7rhA1jg81XXrm0XJ9tqlrIufpRJ899WQ6FzlAW 1xYaHOis7ZTfZHL7utDekrpaIrdLbPS4IFJqLXrOR5hUR5j4HknMNEovp3nu4i9vybi2m9 XUnhqNYAMRqxJ/zZ865lCx1Yzac2gtpJ3St5qams5Kx94bR5UVMzDnua3NfXFmjHWuxd/9 RYkT+ZeT9RydgoHN5qDECifPPBvDyuHoHem7mC3ILObhovm6SXrU0YzOyn8zxk4CRoYZ3P lC2oEE2rTXqiWE+UGiRgjRDJGfJ3xmySRZXb7OqeXHINiGaR4EJZPz11AOYNmw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640244386; a=rsa-sha256; cv=none; b=uxTrEpq8zOtZNH7iXpcFPPZ2qZZwmTF/96hC4SxgQLdHwlEgRygdyfMupdHtzTjplSMEIB eIheM6iSOSxbCN7NKvCcoVYjrXBIyCja+TacMBAlCWN/QVOLwNm9HMofVIORm5Ek3KyLVm nz6dlnUafgHJJRrBCLc/6HvnM8JDVKxPdPqsCq+LP1NCKBdEDHU6Dy0n144eD3+VIdpOIS EIANeoTyL8xw/Ub4TmHJ5XT0SbCTBMn0jHtsU6avptOwhCnK04/CX53nCNm6HdoAQ5inn9 m1IlBtfODMgx3fXwxv3HJj08OAfYslnj8oGIPVE6Y52jV7/ALUPFs3fy0XisZg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=TpwxQ7d3; 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: -5.94 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=TpwxQ7d3; 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: 6E21C1A9F5 X-Spam-Score: -5.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: UbztusIItvaE 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