From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Org publish restrict to certain levels Date: Thu, 23 Feb 2012 18:35:24 -0500 Message-ID: <4502.1330040124@alphaville> References: Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0iC8-0001HL-26 for emacs-orgmode@gnu.org; Thu, 23 Feb 2012 18:35:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0iC7-0003hC-1J for emacs-orgmode@gnu.org; Thu, 23 Feb 2012 18:35:28 -0500 Received: from g4t0014.houston.hp.com ([15.201.24.17]:5150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0iC6-0003h1-R5 for emacs-orgmode@gnu.org; Thu, 23 Feb 2012 18:35:26 -0500 In-Reply-To: Message from Xin Shi of "Thu\, 23 Feb 2012 12\:46\:29 +0100." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Xin Shi Cc: nicholas.dokos@hp.com, emacs-orgmode Xin Shi wrote: > I have a relatively long and detailed document maintained in org but > only won't to publish into LaTeX to the first 3 levels, because the > rest of the levels are too many details. If I use COMMENT into every > of them, looks very=C2=A0cumbersome. I'm wondering if there is any in-file > config to enable this.=C2=A0 >=20 I thought it could be done through a combination of settings: an infile setting of H:3 (or thereabouts) and a BIND setting of org-export-latex-low-= levels to nil. C-h v org-export-latex-low-levels RET says: ,---- | org-export-latex-low-levels is a variable defined in `org-latex.el'. | Its value is itemize |=20 | Documentation: | How to convert sections below the current level of sectioning. | This is specified by the `org-export-headline-levels' option or the | value of "H:" in Org's #+OPTION line. |=20 | This can be either nil (skip the sections), `description', `itemize', <<= <<< the doc says it can be nil to skip them | or `enumerate' (convert the sections as the corresponding list type), or | a string to be used instead of \section{%s}. In this latter case, | the %s stands here for the inserted headline and is mandatory. |=20 | It may also be a list of three string to define a user-defined environment | that should be used. The first string should be the like | "\begin{itemize}", the second should be like "\item %s %s" with up | to two occurrences of %s for the title and a label, respectively. The th= ird | string should be like "\end{itemize". |=20 | You can customize this variable. `---- Unfortunately, there is a bug in org-latex.el, in org-export-latex-subconte= nt ,---- | ((listp org-export-latex-low-levels) | (if (string-match "% ends low level$" | (buffer-substring (point-at-bol 0) (point))) | (delete-region (point-at-bol 0) (point)) | (insert (car org-export-latex-low-levels) "\n")) ;;;; <<<< or= g-export-latex-low-levels cannot be nil here: car will blow up | (insert (format (nth 2 org-export-latex-low-levels) ;;;; <<<< or= here: format will blow up | heading | (if label (format "\\label{%s}" label) ""))) | (insert (org-export-latex-content content)) | (cond ((stringp subcontent) (insert subcontent)) | ((listp subcontent) (org-export-latex-sub subcontent))) | (insert (nth 1 org-export-latex-low-levels) | " %% ends low level\n")) |=20 `---- Nick