emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org publish restrict to certain levels
@ 2012-02-23 11:46 Xin Shi
  2012-02-23 23:35 ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Xin Shi @ 2012-02-23 11:46 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 329 bytes --]

Hello Experts,

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 cumbersome. I'm wondering if there is any in-file config to enable
this.

Thanks!

Xin

[-- Attachment #2: Type: text/html, Size: 427 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Org publish restrict to certain levels
  2012-02-23 11:46 Org publish restrict to certain levels Xin Shi
@ 2012-02-23 23:35 ` Nick Dokos
  2012-03-27 21:09   ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2012-02-23 23:35 UTC (permalink / raw)
  To: Xin Shi; +Cc: nicholas.dokos, emacs-orgmode

Xin Shi <shixin111@gmail.com> 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 cumbersome. I'm wondering if there is any in-file
> config to enable this. 
> 

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
| 
| 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.
| 
| 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.
| 
| 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 third
| string should be like "\end{itemize".
| 
| You can customize this variable.
`----


Unfortunately, there is a bug in org-latex.el, in org-export-latex-subcontent

,----
| 	    ((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"))     ;;;; <<<< org-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"))
| 
`----

Nick

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Org publish restrict to certain levels
  2012-02-23 23:35 ` Nick Dokos
@ 2012-03-27 21:09   ` Bastien
  2012-03-28  1:20     ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2012-03-27 21:09 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, Xin Shi

Hi Nick,

Nick Dokos <nicholas.dokos@hp.com> writes:

> Unfortunately, there is a bug in org-latex.el, in org-export-latex-subcontent
>
> ,----
> | 	    ((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"))     ;;;; <<<< org-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"))
> | 
> `----

This is fixed -- you can now set `org-export-latex-low-levels' to nil,
low levels won't be exported.

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Org publish restrict to certain levels
  2012-03-27 21:09   ` Bastien
@ 2012-03-28  1:20     ` Nick Dokos
  2012-03-28  7:53       ` Xin Shi
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2012-03-28  1:20 UTC (permalink / raw)
  To: Bastien; +Cc: nicholas.dokos, emacs-orgmode, Xin Shi

Bastien <bzg@gnu.org> wrote:

> Hi Nick,
> 
> Nick Dokos <nicholas.dokos@hp.com> writes:
> 
> > Unfortunately, there is a bug in org-latex.el, in org-export-latex-subcontent
> >
> > ,----
> > | 	    ((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"))     ;;;; <<<< org-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"))
> > | 
> > `----
> 
> This is fixed -- you can now set `org-export-latex-low-levels' to nil,
> low levels won't be exported.
> 

Verified - thanks!

Nick

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Org publish restrict to certain levels
  2012-03-28  1:20     ` Nick Dokos
@ 2012-03-28  7:53       ` Xin Shi
  0 siblings, 0 replies; 5+ messages in thread
From: Xin Shi @ 2012-03-28  7:53 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1393 bytes --]

Thank you!

Xin



On Wed, Mar 28, 2012 at 3:20 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Bastien <bzg@gnu.org> wrote:
>
> > Hi Nick,
> >
> > Nick Dokos <nicholas.dokos@hp.com> writes:
> >
> > > Unfortunately, there is a bug in org-latex.el, in
> org-export-latex-subcontent
> > >
> > > ,----
> > > |       ((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"))     ;;;;
> <<<< org-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"))
> > > |
> > > `----
> >
> > This is fixed -- you can now set `org-export-latex-low-levels' to nil,
> > low levels won't be exported.
> >
>
> Verified - thanks!
>
> Nick
>

[-- Attachment #2: Type: text/html, Size: 2186 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-28  7:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-23 11:46 Org publish restrict to certain levels Xin Shi
2012-02-23 23:35 ` Nick Dokos
2012-03-27 21:09   ` Bastien
2012-03-28  1:20     ` Nick Dokos
2012-03-28  7:53       ` Xin Shi

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).