emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org equivalent to \chapter*
@ 2014-08-06  0:11 Alan L Tyree
  2014-08-06  1:11 ` Thorsten Jolitz
  2014-08-06  9:18 ` Rasmus
  0 siblings, 2 replies; 12+ messages in thread
From: Alan L Tyree @ 2014-08-06  0:11 UTC (permalink / raw)
  To: emacs-orgmode

I'm sure this has been asked before, but I can't seem to find it. Is 
there an org markup that produces a starred latex heading?

In a book, for example, I want the Preface to be at chapter level, but 
not included in the numbering. Same for HTML export, of course.

Thanks for any pointers,
Alan

-- 
Alan L Tyree                    http://www2.austlii.edu.au/~alan
Tel:  04 2748 6206              sip:typhoon@iptel.org

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

* Re: Org equivalent to \chapter*
  2014-08-06  0:11 Org equivalent to \chapter* Alan L Tyree
@ 2014-08-06  1:11 ` Thorsten Jolitz
  2014-08-06  2:28   ` Nick Dokos
  2014-08-06  9:18 ` Rasmus
  1 sibling, 1 reply; 12+ messages in thread
From: Thorsten Jolitz @ 2014-08-06  1:11 UTC (permalink / raw)
  To: emacs-orgmode

Alan L Tyree <alantyree@gmail.com> writes:

> I'm sure this has been asked before, but I can't seem to find it. Is
> there an org markup that produces a starred latex heading?
>
> In a book, for example, I want the Preface to be at chapter level, but
> not included in the numbering. Same for HTML export, of course.

,----[ C-h v org-latex-classes RET ]
| org-latex-classes is a variable defined in `ox-latex.el'.
| Its value is shown below.
| 
| Documentation:
| Alist of LaTeX classes and associated header and structure.
| If #+LATEX_CLASS is set in the buffer, use its value and the
| associated information.  Here is the structure of each cell:
| 
|   (class-name
|     header-string
|     (numbered-section . unnumbered-section)
|     ...)
| 
| The header string
| -----------------
| 
| The HEADER-STRING is the header that will be inserted into the
| LaTeX file.  It should contain the \documentclass macro, and
| anything else that is needed for this setup.  To this header, the
| following commands will be added:
| 
| - Calls to \usepackage for all packages mentioned in the
|   variables `org-latex-default-packages-alist' and
|   `org-latex-packages-alist'.  Thus, your header definitions
|   should avoid to also request these packages.
| 
| - Lines specified via "#+LATEX_HEADER:" and
|   "#+LATEX_HEADER_EXTRA:" keywords.
| 
| If you need more control about the sequence in which the header
| is built up, or if you want to exclude one of these building
| blocks for a particular class, you can use the following
| macro-like placeholders.
| 
|  [DEFAULT-PACKAGES]      \usepackage statements for default packages
|  [NO-DEFAULT-PACKAGES]   do not include any of the default packages
|  [PACKAGES]              \usepackage statements for packages
|  [NO-PACKAGES]           do not include the packages
|  [EXTRA]                 the stuff from #+LATEX_HEADER(_EXTRA)
|  [NO-EXTRA]              do not include #+LATEX_HEADER(_EXTRA) stuff
| 
| So a header like
| 
|   \documentclass{article}
|   [NO-DEFAULT-PACKAGES]
|   [EXTRA]
|   \providecommand{\alert}[1]{\textbf{#1}}
|   [PACKAGES]
| 
| will omit the default packages, and will include the
| #+LATEX_HEADER and #+LATEX_HEADER_EXTRA lines, then have a call
| to \providecommand, and then place \usepackage commands based
| on the content of `org-latex-packages-alist'.
| 
| If your header, `org-latex-default-packages-alist' or
| `org-latex-packages-alist' inserts "\usepackage[AUTO]{inputenc}",
| AUTO will automatically be replaced with a coding system derived
| from `buffer-file-coding-system'.  See also the variable
| `org-latex-inputenc-alist' for a way to influence this mechanism.
| 
| Likewise, if your header contains "\usepackage[AUTO]{babel}",
| AUTO will be replaced with the language related to the language
| code specified by `org-export-default-language', which see.  Note
| that constructions such as "\usepackage[french,AUTO,english]{babel}"
| are permitted.
| 
| The sectioning structure
| ------------------------
| 
| The sectioning structure of the class is given by the elements
| following the header string.  For each sectioning level, a number
| of strings is specified.  A %s formatter is mandatory in each
| section string and will be replaced by the title of the section.
| 
| Instead of a cons cell (numbered . unnumbered), you can also
| provide a list of 2 or 4 elements,
| 
|   (numbered-open numbered-close)
| 
| or
| 
|   (numbered-open numbered-close unnumbered-open unnumbered-close)
| 
| providing opening and closing strings for a LaTeX environment
| that should represent the document section.  The opening clause
| should have a %s to represent the section title.
| 
| Instead of a list of sectioning commands, you can also specify
| a function name.  That function will be called with two
| parameters, the (reduced) level of the headline, and a predicate
| non-nil when the headline should be numbered.  It must return
| a format string in which the section title will be added.
| 
| You can customize this variable.
| 
| Value: (("koma-book" "\\documentclass{scrbook}"
|   ("\\part{%s}" . "\\part*{%s}")
|   ("\\chapter{%s}" . "\\chapter*{%s}")
|   ("\\section{%s}" . "\\section*{%s}")
|   ("\\subsection{%s}" . "\\subsection*{%s}")
|   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|   ("\\paragraph{%s}" . "\\paragraph*{%s}")
|   ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
|  ("koma-article" "\\documentclass{scrartcl}"
|   ("\\section{%s}" . "\\section*{%s}")
|   ("\\subsection{%s}" . "\\subsection*{%s}")
|   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|   ("\\paragraph{%s}" . "\\paragraph*{%s}")
|   ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
|  ("article" "\\documentclass[11pt]{article}"
|   ("\\section{%s}" . "\\section*{%s}")
|   ("\\subsection{%s}" . "\\subsection*{%s}")
|   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|   ("\\paragraph{%s}" . "\\paragraph*{%s}")
|   ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
|  ("report" "\\documentclass[11pt]{report}"
|   ("\\part{%s}" . "\\part*{%s}")
|   ("\\chapter{%s}" . "\\chapter*{%s}")
|   ("\\section{%s}" . "\\section*{%s}")
|   ("\\subsection{%s}" . "\\subsection*{%s}")
|   ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
|  ("book" "\\documentclass[11pt]{book}"
|   ("\\part{%s}" . "\\part*{%s}")
|   ("\\chapter{%s}" . "\\chapter*{%s}")
|   ("\\section{%s}" . "\\section*{%s}")
|   ("\\subsection{%s}" . "\\subsection*{%s}")
|   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
| 
| Original value was 
| (("article" "\\documentclass[11pt]{article}"
|   ("\\section{%s}" . "\\section*{%s}")
|   ("\\subsection{%s}" . "\\subsection*{%s}")
|   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|   ("\\paragraph{%s}" . "\\paragraph*{%s}")
|   ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
|  ("report" "\\documentclass[11pt]{report}"
|   ("\\part{%s}" . "\\part*{%s}")
|   ("\\chapter{%s}" . "\\chapter*{%s}")
|   ("\\section{%s}" . "\\section*{%s}")
|   ("\\subsection{%s}" . "\\subsection*{%s}")
|   ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
|  ("book" "\\documentclass[11pt]{book}"
|   ("\\part{%s}" . "\\part*{%s}")
|   ("\\chapter{%s}" . "\\chapter*{%s}")
|   ("\\section{%s}" . "\\section*{%s}")
|   ("\\subsection{%s}" . "\\subsection*{%s}")
|   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
| 
| [back]
`----

-- 
cheers,
Thorsten

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

* Re: Org equivalent to \chapter*
  2014-08-06  1:11 ` Thorsten Jolitz
@ 2014-08-06  2:28   ` Nick Dokos
  2014-08-06  8:09     ` Thorsten Jolitz
  0 siblings, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2014-08-06  2:28 UTC (permalink / raw)
  To: emacs-orgmode

Thorsten Jolitz <tjolitz@gmail.com> writes:

> Alan L Tyree <alantyree@gmail.com> writes:
>
>> I'm sure this has been asked before, but I can't seem to find it. Is
>> there an org markup that produces a starred latex heading?
>>
>> In a book, for example, I want the Preface to be at chapter level, but
>> not included in the numbering. Same for HTML export, of course.
>
> ,----[ C-h v org-latex-classes RET ]
> | org-latex-classes is a variable defined in `ox-latex.el'.
> | Its value is shown below.
> | ...
> `----

How does org-latex-classes help with the OP's question?

AFAIK, org-latex-classes works together with :section-numbers
(org-export-with-section-numbers or #+OPTIONS: num: t|nil|N) to allow
the first N [fn:1] levels of headlines to be numbered while lower levels
are unnumbered. It does not allow selectively turning on/off numbers for
a given level: they are either all on or all off.

And it cannot possibly affect HTML export.

To the best of my knowledge, the answer to the OP's question is that it
cannot be done from org: you have to tweak the export output.

Footnotes:

[fn:1] If set to t, then N is set from the value of org-export-headline-levels
       (3 by default).

-- 
Nick

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

* Re: Org equivalent to \chapter*
  2014-08-06  2:28   ` Nick Dokos
@ 2014-08-06  8:09     ` Thorsten Jolitz
  0 siblings, 0 replies; 12+ messages in thread
From: Thorsten Jolitz @ 2014-08-06  8:09 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> Alan L Tyree <alantyree@gmail.com> writes:
>>
>>> I'm sure this has been asked before, but I can't seem to find it. Is
>>> there an org markup that produces a starred latex heading?
>>>
>>> In a book, for example, I want the Preface to be at chapter level, but
>>> not included in the numbering. Same for HTML export, of course.
>>
>> ,----[ C-h v org-latex-classes RET ]
>> | org-latex-classes is a variable defined in `ox-latex.el'.
>> | Its value is shown below.
>> | ...
>> `----
>
> How does org-latex-classes help with the OP's question?

OP said 'any hint', and when exporting to LaTeX this variable is where
the starred latex headings come from.

> To the best of my knowledge, the answer to the OP's question is that it
> cannot be done from org: you have to tweak the export output.

So you gave him how many other hints?

-- 
cheers,
Thorsten

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

* Re: Org equivalent to \chapter*
  2014-08-06  0:11 Org equivalent to \chapter* Alan L Tyree
  2014-08-06  1:11 ` Thorsten Jolitz
@ 2014-08-06  9:18 ` Rasmus
  2014-08-06 17:15   ` Thomas S. Dye
  1 sibling, 1 reply; 12+ messages in thread
From: Rasmus @ 2014-08-06  9:18 UTC (permalink / raw)
  To: emacs-orgmode

Alan L Tyree <alantyree@gmail.com> writes:

> I'm sure this has been asked before, but I can't seem to find it. Is
> there an org markup that produces a starred latex heading?
>
> In a book, for example, I want the Preface to be at chapter level, but
> not included in the numbering. Same for HTML export, of course.

You would probably need some sort of filter for this.  Most certainly
you will be able to find implementations on this list.

Here's something from my init file that works with LaTeX.  Other
formats such as txt and html are harder since Org generates section
numbers and the TOC.

The filter will translate this file

     #+OPTIONS: tags:nil
     * preface							      :nonum:
       my preface
     * introduction
       this is numbered. 

To something like this:

    \section*{preface}
    \label{sec-1}
    my preface
    \section{introduction}
    \label{sec-2}
    this is numbered. 

If your other filters require #+OPTIONS: tags:t then you will have to
manually clean up the tag remedies.  I will not work on verbatim-only
headlines.

  (defun rasmus/get-org-headline-string-element  (headline backend info)
    "Return the org element representation of an element.  Does not
    work with verbatim only headlines, e.g. \"* ~Verb~.\""
    (let ((prop-point (next-property-change 0 headline)))
      (if prop-point (plist-get (text-properties-at prop-point headline) :parent))))


  (defun rasmus/org-export-nonum (headline backend info)
    "Remove the number from LaTeX headlines with the tag \"nonum\""
    (when (org-export-derived-backend-p backend 'latex 'ascii)
      (let* ((e (rasmus/get-org-headline-string-element headline backend info))
             (tags (org-element-property :tags e))
             (level (org-element-property :level e))
             (class (assoc (plist-get info :latex-class) org-latex-classes)))
        (when  (and level (member-ignore-case "nonum" tags))
          (string-match
           (format "\\(\\%s\\)" (replace-regexp-in-string "{.*?}" "" (car (nth (1+ level) class))))
           headline)
          (replace-match (replace-regexp-in-string "{.*?}" "" (concat "\\" (cdr (nth (1+  level) class)))) nil nil headline 0)))))

  (add-to-list 'org-export-filter-headline-functions 'rasmus/org-export-nonum)


-- 
Governments should be afraid of their people

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

* Re: Org equivalent to \chapter*
  2014-08-06  9:18 ` Rasmus
@ 2014-08-06 17:15   ` Thomas S. Dye
  2014-08-06 17:38     ` Rasmus
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas S. Dye @ 2014-08-06 17:15 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Aloha Rasmus,

Rasmus <rasmus@gmx.us> writes:

> Alan L Tyree <alantyree@gmail.com> writes:
>
>> I'm sure this has been asked before, but I can't seem to find it. Is
>> there an org markup that produces a starred latex heading?
>>
>> In a book, for example, I want the Preface to be at chapter level, but
>> not included in the numbering. Same for HTML export, of course.
>
> You would probably need some sort of filter for this.  Most certainly
> you will be able to find implementations on this list.
>
> Here's something from my init file that works with LaTeX.  Other
> formats such as txt and html are harder since Org generates section
> numbers and the TOC.

Thanks for sharing this.  It will be useful for book authors. 

Do you think it is possible to write a general headline filter that
takes care of all the various LaTeX possibilities?  Right now Iʻm using
tags to ignoreheading, clearpage, and newpage.  In addition to your
nonum filter, Eric S. has a filter that gets rid of a heading and
promotes the content, which I havenʻt had occasion to use, but also has
its own tag.

From the LaTeX authorʻs point of view, it would be great to have a set
of tags (and options) that "just work."  Do you (and others) think the
"tag and filter" approach can achieve this?  Or, are there too many
moving parts to make it feasible?

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: Org equivalent to \chapter*
  2014-08-06 17:15   ` Thomas S. Dye
@ 2014-08-06 17:38     ` Rasmus
  2014-08-06 19:52       ` Thomas S. Dye
  0 siblings, 1 reply; 12+ messages in thread
From: Rasmus @ 2014-08-06 17:38 UTC (permalink / raw)
  To: tsd; +Cc: emacs-orgmode

Thomas,

tsd@tsdye.com (Thomas S. Dye) writes:

> Rasmus <rasmus@gmx.us> writes:
>
>> Alan L Tyree <alantyree@gmail.com> writes:
>>
>>> I'm sure this has been asked before, but I can't seem to find it. Is
>>> there an org markup that produces a starred latex heading?
>>>
>>> In a book, for example, I want the Preface to be at chapter level, but
>>> not included in the numbering. Same for HTML export, of course.
>>
>> You would probably need some sort of filter for this.  Most certainly
>> you will be able to find implementations on this list.
>>
>> Here's something from my init file that works with LaTeX.  Other
>> formats such as txt and html are harder since Org generates section
>> numbers and the TOC.
>
> Thanks for sharing this.  It will be useful for book authors. 
>
> Do you think it is possible to write a general headline filter that
> takes care of all the various LaTeX possibilities?  

I don't like *one* filter to rule them all.  Of course, if it's a
collection of other function calls that is OK.  As your recent
question showed execution order may matter,
(e.g. with :ignoreheading:clearpage:).

Of course it's possible to bundle a couple of filters generally useful
for ox-latex and provide a "consistent" interface.  Alternatively, one
could make a ox-latex+.el that provides a derived class with extra
options. That's may be more work, and may be harder to hack.

In fact Aaron started ox-extra.el, with the intention of providing
"semi-official" extensions but Worg may be a better means of
communication.

> Right now Iʻm using tags to ignoreheading, clearpage, and newpage.
> In addition to your nonum filter, Eric S. has a filter that gets rid
> of a heading and promotes the content, which I havenʻt had occasion
> to use, but also has its own tag.

Yes, Eric has cool tree-based filter(s).  I want to study them more
carefully.  Quite possibly, it's easier to provide elegant filters
with trees.  For instance, you have direct access to the element
representation.  In my filters I "hack" my way to this using
text-properties.

> From the LaTeX authorʻs point of view, it would be great to have a set
> of tags (and options) that "just work."

Would you want this as a derived class or filters?  Perhaps it's
easier to have a derived class with an alternative headline
function. . .

> Do you (and others) think the "tag and filter" approach can achieve
> this?  Or, are there too many moving parts to make it feasible?

Yes.

The ox-koma-script interface is basically controlled via tags.  I
think it's nice.

—Rasmus

-- 
If you can mix business and politics wonderful things can happen!

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

* Re: Org equivalent to \chapter*
  2014-08-06 17:38     ` Rasmus
@ 2014-08-06 19:52       ` Thomas S. Dye
  2014-08-06 22:46         ` Alan L Tyree
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas S. Dye @ 2014-08-06 19:52 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Aloha Rasmus,

Rasmus <rasmus@gmx.us> writes:

> Thomas,
>
> tsd@tsdye.com (Thomas S. Dye) writes:
>
>> Rasmus <rasmus@gmx.us> writes:
>>
>>> Alan L Tyree <alantyree@gmail.com> writes:
>>>
>>>> I'm sure this has been asked before, but I can't seem to find it. Is
>>>> there an org markup that produces a starred latex heading?
>>>>
>>>> In a book, for example, I want the Preface to be at chapter level, but
>>>> not included in the numbering. Same for HTML export, of course.
>>>
>>> You would probably need some sort of filter for this.  Most certainly
>>> you will be able to find implementations on this list.
>>>
>>> Here's something from my init file that works with LaTeX.  Other
>>> formats such as txt and html are harder since Org generates section
>>> numbers and the TOC.
>>
>> Thanks for sharing this.  It will be useful for book authors. 
>>
>> Do you think it is possible to write a general headline filter that
>> takes care of all the various LaTeX possibilities?  
>
> I don't like *one* filter to rule them all.  Of course, if it's a
> collection of other function calls that is OK.  As your recent
> question showed execution order may matter,
> (e.g. with :ignoreheading:clearpage:).
>
> Of course it's possible to bundle a couple of filters generally useful
> for ox-latex and provide a "consistent" interface.  Alternatively, one
> could make a ox-latex+.el that provides a derived class with extra
> options. That's may be more work, and may be harder to hack.
>
> In fact Aaron started ox-extra.el, with the intention of providing
> "semi-official" extensions but Worg may be a better means of
> communication.
>
>> Right now Iʻm using tags to ignoreheading, clearpage, and newpage.
>> In addition to your nonum filter, Eric S. has a filter that gets rid
>> of a heading and promotes the content, which I havenʻt had occasion
>> to use, but also has its own tag.
>
> Yes, Eric has cool tree-based filter(s).  I want to study them more
> carefully.  Quite possibly, it's easier to provide elegant filters
> with trees.  For instance, you have direct access to the element
> representation.  In my filters I "hack" my way to this using
> text-properties.
>
>> From the LaTeX authorʻs point of view, it would be great to have a set
>> of tags (and options) that "just work."
>
> Would you want this as a derived class or filters?  Perhaps it's
> easier to have a derived class with an alternative headline
> function. . .
>
>> Do you (and others) think the "tag and filter" approach can achieve
>> this?  Or, are there too many moving parts to make it feasible?
>
> Yes.
>
> The ox-koma-script interface is basically controlled via tags.  I
> think it's nice.

Thanks for this useful overview and the pointers to good examples.

Iʻve been slowly building a set of filters and links that work for me,
but each new project differs a bit from the previous one and I have to
fiddle with the Org mode setup.  Iʻm eager to get to the place Iʻm at
with LaTeX, where I just jump in and start writing.

Thanks again for your help.

All the best,
Tom

-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com

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

* Re: Org equivalent to \chapter*
  2014-08-06 19:52       ` Thomas S. Dye
@ 2014-08-06 22:46         ` Alan L Tyree
  2014-08-07 10:05           ` Rasmus
  0 siblings, 1 reply; 12+ messages in thread
From: Alan L Tyree @ 2014-08-06 22:46 UTC (permalink / raw)
  To: emacs-orgmode


On 07/08/14 05:52, Thomas S. Dye wrote:
> Aloha Rasmus,
>
> Rasmus <rasmus@gmx.us> writes:
>
>> Thomas,
>>
>> tsd@tsdye.com (Thomas S. Dye) writes:
>>
>>> Rasmus <rasmus@gmx.us> writes:
>>>
>>>> Alan L Tyree <alantyree@gmail.com> writes:
>>>>
>>>>> I'm sure this has been asked before, but I can't seem to find it. Is
>>>>> there an org markup that produces a starred latex heading?
>>>>>
>>>>> In a book, for example, I want the Preface to be at chapter level, but
>>>>> not included in the numbering. Same for HTML export, of course.
>>>> You would probably need some sort of filter for this.  Most certainly
>>>> you will be able to find implementations on this list.
>>>>
>>>> Here's something from my init file that works with LaTeX.  Other
>>>> formats such as txt and html are harder since Org generates section
>>>> numbers and the TOC.
>>> Thanks for sharing this.  It will be useful for book authors.
>>>
>>> Do you think it is possible to write a general headline filter that
>>> takes care of all the various LaTeX possibilities?
>> I don't like *one* filter to rule them all.  Of course, if it's a
>> collection of other function calls that is OK.  As your recent
>> question showed execution order may matter,
>> (e.g. with :ignoreheading:clearpage:).
>>
>> Of course it's possible to bundle a couple of filters generally useful
>> for ox-latex and provide a "consistent" interface.  Alternatively, one
>> could make a ox-latex+.el that provides a derived class with extra
>> options. That's may be more work, and may be harder to hack.
>>
>> In fact Aaron started ox-extra.el, with the intention of providing
>> "semi-official" extensions but Worg may be a better means of
>> communication.
>>
>>> Right now Iʻm using tags to ignoreheading, clearpage, and newpage.
>>> In addition to your nonum filter, Eric S. has a filter that gets rid
>>> of a heading and promotes the content, which I havenʻt had occasion
>>> to use, but also has its own tag.
>> Yes, Eric has cool tree-based filter(s).  I want to study them more
>> carefully.  Quite possibly, it's easier to provide elegant filters
>> with trees.  For instance, you have direct access to the element
>> representation.  In my filters I "hack" my way to this using
>> text-properties.
>>
>>>  From the LaTeX authorʻs point of view, it would be great to have a set
>>> of tags (and options) that "just work."
>> Would you want this as a derived class or filters?  Perhaps it's
>> easier to have a derived class with an alternative headline
>> function. . .
>>
>>> Do you (and others) think the "tag and filter" approach can achieve
>>> this?  Or, are there too many moving parts to make it feasible?
>> Yes.
>>
>> The ox-koma-script interface is basically controlled via tags.  I
>> think it's nice.
> Thanks for this useful overview and the pointers to good examples.
>
> Iʻve been slowly building a set of filters and links that work for me,
> but each new project differs a bit from the previous one and I have to
> fiddle with the Org mode setup.  Iʻm eager to get to the place Iʻm at
> with LaTeX, where I just jump in and start writing.
>
> Thanks again for your help.
>
> All the best,
> Tom
>
Thanks to everyone who responded.

Several of my books are out of print and I am converting them to ePub 
and to printed form. ePub is pretty smooth by exporting to HTML and then 
using Calibre. LaTeX is the obvious choice for print.

It would be nice to have a single tag that gives the \section*{} 
equivalent for all exports, but I can see that there is some difficulty 
with that. Thanks Rasmus for the LaTeX filter -- I'll have a look at 
adapting it for the HTML.

As Thomas mentioned, having selectively unnumbered sections is pretty 
important for book authors.

Thanks again,
Alan

-- 
Alan L Tyree                    http://www2.austlii.edu.au/~alan
Tel:  04 2748 6206              sip:typhoon@iptel.org

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

* Re: Org equivalent to \chapter*
  2014-08-06 22:46         ` Alan L Tyree
@ 2014-08-07 10:05           ` Rasmus
  2014-08-07 22:07             ` Alan L Tyree
  0 siblings, 1 reply; 12+ messages in thread
From: Rasmus @ 2014-08-07 10:05 UTC (permalink / raw)
  To: emacs-orgmode

Alan L Tyree <alantyree@gmail.com> writes:

> On 07/08/14 05:52, Thomas S. Dye wrote:
>> Aloha Rasmus,
>>
>
>> Rasmus <rasmus@gmx.us> writes:
>>
>>> Thomas,
>>>
>>> tsd@tsdye.com (Thomas S. Dye) writes:
>>>
>>>> Rasmus <rasmus@gmx.us> writes:
>>>>
>>>>> Alan L Tyree <alantyree@gmail.com> writes:
>>>>>
>>>>>> I'm sure this has been asked before, but I can't seem to find it. Is
>>>>>> there an org markup that produces a starred latex heading?
>>>>>>
>>>>>> In a book, for example, I want the Preface to be at chapter level, but
>>>>>> not included in the numbering. Same for HTML export, of course.
>>>>> You would probably need some sort of filter for this.  Most certainly
>>>>> you will be able to find implementations on this list.
>>>>>
>>>>> Here's something from my init file that works with LaTeX.  Other
>>>>> formats such as txt and html are harder since Org generates section
>>>>> numbers and the TOC.
>>>> Thanks for sharing this.  It will be useful for book authors.
>>>>
>>>> Do you think it is possible to write a general headline filter that
>>>> takes care of all the various LaTeX possibilities?
>>> I don't like *one* filter to rule them all.  Of course, if it's a
>>> collection of other function calls that is OK.  As your recent
>>> question showed execution order may matter,
>>> (e.g. with :ignoreheading:clearpage:).
>>>
>>> Of course it's possible to bundle a couple of filters generally useful
>>> for ox-latex and provide a "consistent" interface.  Alternatively, one
>>> could make a ox-latex+.el that provides a derived class with extra
>>> options. That's may be more work, and may be harder to hack.
>>>
>>> In fact Aaron started ox-extra.el, with the intention of providing
>>> "semi-official" extensions but Worg may be a better means of
>>> communication.
>>>
>>>> Right now Iʻm using tags to ignoreheading, clearpage, and newpage.
>>>> In addition to your nonum filter, Eric S. has a filter that gets rid
>>>> of a heading and promotes the content, which I havenʻt had occasion
>>>> to use, but also has its own tag.
>>> Yes, Eric has cool tree-based filter(s).  I want to study them more
>>> carefully.  Quite possibly, it's easier to provide elegant filters
>>> with trees.  For instance, you have direct access to the element
>>> representation.  In my filters I "hack" my way to this using
>>> text-properties.
>>>
>>>>  From the LaTeX authorʻs point of view, it would be great to have a set
>>>> of tags (and options) that "just work."
>>> Would you want this as a derived class or filters?  Perhaps it's
>>> easier to have a derived class with an alternative headline
>>> function. . .
>>>
>>>> Do you (and others) think the "tag and filter" approach can achieve
>>>> this?  Or, are there too many moving parts to make it feasible?
>>> Yes.
>>>
>>> The ox-koma-script interface is basically controlled via tags.  I
>>> think it's nice.
>> Thanks for this useful overview and the pointers to good examples.
>>
>> Iʻve been slowly building a set of filters and links that work for me,
>> but each new project differs a bit from the previous one and I have to
>> fiddle with the Org mode setup.  Iʻm eager to get to the place Iʻm at
>> with LaTeX, where I just jump in and start writing.
>>
>> Thanks again for your help.
>>
>> All the best,
>> Tom
>>
> Thanks to everyone who responded.
>
> Several of my books are out of print and I am converting them to ePub
> and to printed form. ePub is pretty smooth by exporting to HTML and
> then using Calibre. LaTeX is the obvious choice for print.

Have you seen this project:

     https://github.com/rzoller/tex2ebook

I haven't tried it myself, but the process seems similar to what you
are doing only that it uses hevea to convert from tex to html.

—Rasmus

--
Lasciate ogni speranza o voi che entrate: siete nella mani di'machellaio

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

* Re: Org equivalent to \chapter*
  2014-08-07 10:05           ` Rasmus
@ 2014-08-07 22:07             ` Alan L Tyree
  2014-08-08  8:42               ` Rasmus
  0 siblings, 1 reply; 12+ messages in thread
From: Alan L Tyree @ 2014-08-07 22:07 UTC (permalink / raw)
  To: emacs-orgmode


On 07/08/14 20:05, Rasmus wrote:
> Alan L Tyree <alantyree@gmail.com> writes:
>
>> On 07/08/14 05:52, Thomas S. Dye wrote:
>>> Aloha Rasmus,
>>>
>>> Rasmus <rasmus@gmx.us> writes:
>>>
>>>> Thomas,
>>>>
>>>> tsd@tsdye.com (Thomas S. Dye) writes:
>>>>
>>>>> Rasmus <rasmus@gmx.us> writes:
>>>>>
>>>>>> Alan L Tyree <alantyree@gmail.com> writes:
>>>>>>
>>>>>>> I'm sure this has been asked before, but I can't seem to find it. Is
>>>>>>> there an org markup that produces a starred latex heading?
>>>>>>>
>>>>>>> In a book, for example, I want the Preface to be at chapter level, but
>>>>>>> not included in the numbering. Same for HTML export, of course.
>>>>>> You would probably need some sort of filter for this.  Most certainly
>>>>>> you will be able to find implementations on this list.
>>>>>>
>>>>>> Here's something from my init file that works with LaTeX.  Other
>>>>>> formats such as txt and html are harder since Org generates section
>>>>>> numbers and the TOC.
>>>>> Thanks for sharing this.  It will be useful for book authors.
>>>>>
>>>>> Do you think it is possible to write a general headline filter that
>>>>> takes care of all the various LaTeX possibilities?
>>>> I don't like *one* filter to rule them all.  Of course, if it's a
>>>> collection of other function calls that is OK.  As your recent
>>>> question showed execution order may matter,
>>>> (e.g. with :ignoreheading:clearpage:).
>>>>
>>>> Of course it's possible to bundle a couple of filters generally useful
>>>> for ox-latex and provide a "consistent" interface.  Alternatively, one
>>>> could make a ox-latex+.el that provides a derived class with extra
>>>> options. That's may be more work, and may be harder to hack.
>>>>
>>>> In fact Aaron started ox-extra.el, with the intention of providing
>>>> "semi-official" extensions but Worg may be a better means of
>>>> communication.
>>>>
>>>>> Right now Iʻm using tags to ignoreheading, clearpage, and newpage.
>>>>> In addition to your nonum filter, Eric S. has a filter that gets rid
>>>>> of a heading and promotes the content, which I havenʻt had occasion
>>>>> to use, but also has its own tag.
>>>> Yes, Eric has cool tree-based filter(s).  I want to study them more
>>>> carefully.  Quite possibly, it's easier to provide elegant filters
>>>> with trees.  For instance, you have direct access to the element
>>>> representation.  In my filters I "hack" my way to this using
>>>> text-properties.
>>>>
>>>>>   From the LaTeX authorʻs point of view, it would be great to have a set
>>>>> of tags (and options) that "just work."
>>>> Would you want this as a derived class or filters?  Perhaps it's
>>>> easier to have a derived class with an alternative headline
>>>> function. . .
>>>>
>>>>> Do you (and others) think the "tag and filter" approach can achieve
>>>>> this?  Or, are there too many moving parts to make it feasible?
>>>> Yes.
>>>>
>>>> The ox-koma-script interface is basically controlled via tags.  I
>>>> think it's nice.
>>> Thanks for this useful overview and the pointers to good examples.
>>>
>>> Iʻve been slowly building a set of filters and links that work for me,
>>> but each new project differs a bit from the previous one and I have to
>>> fiddle with the Org mode setup.  Iʻm eager to get to the place Iʻm at
>>> with LaTeX, where I just jump in and start writing.
>>>
>>> Thanks again for your help.
>>>
>>> All the best,
>>> Tom
>>>
>> Thanks to everyone who responded.
>>
>> Several of my books are out of print and I am converting them to ePub
>> and to printed form. ePub is pretty smooth by exporting to HTML and
>> then using Calibre. LaTeX is the obvious choice for print.
> Have you seen this project:
>
>       https://github.com/rzoller/tex2ebook
>
> I haven't tried it myself, but the process seems similar to what you
> are doing only that it uses hevea to convert from tex to html.
>
> —Rasmus
>
> --
> Lasciate ogni speranza o voi che entrate: siete nella mani di'machellaio
>
>
>
Thanks, Rasmus. I'll have a look at this and report back. Org -> tex -> 
HTML would at least solve the unnumbered heading problem (with the use 
of your filter).

As an additional aside, note that Pandoc Markdown permits the use of a 
tag to produce an unnumbered heading when exporting to HTML and LaTeX.

# Heading {.unnumbered}

I'm a very inexperienced lisp coder, but it seems to me that this should 
be incorporated into the basic exporters. The HTML exporter, for 
example, adds the numbering to each heading. In the loop that 
accomplishes that, it should be easy to ignore headings with a tag such 
as your :nonum:. Otherwise, it is necessary to write a filter that not 
only undoes the numbering for selected headlines, but essentially 
reproduces the numbering algorithms originally introduced in ox-html.

Cheers,
Alan


-- 
Alan L Tyree                    http://www2.austlii.edu.au/~alan
Tel:  04 2748 6206              sip:typhoon@iptel.org

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

* Re: Org equivalent to \chapter*
  2014-08-07 22:07             ` Alan L Tyree
@ 2014-08-08  8:42               ` Rasmus
  0 siblings, 0 replies; 12+ messages in thread
From: Rasmus @ 2014-08-08  8:42 UTC (permalink / raw)
  To: emacs-orgmode

Alan L Tyree <alantyree@gmail.com> writes:

> On 07/08/14 20:05, Rasmus wrote:
>>>>>>>> I'm sure this has been asked before, but I can't seem to find it. Is
>>>>>>>> there an org markup that produces a starred latex heading?
>>>>>>>>
>>>>>>>> In a book, for example, I want the Preface to be at chapter level, but
>>>>>>>> not included in the numbering. Same for HTML export, of course.
>>>>>>> You would probably need some sort of filter for this.  Most certainly
>>>>>>> you will be able to find implementations on this list.
>>>>>>>
>>>>>>> Here's something from my init file that works with LaTeX.  Other
>>>>>>> formats such as txt and html are harder since Org generates section
>>>>>>> numbers and the TOC.
>>>>>> Thanks for sharing this.  It will be useful for book authors.
>>>>>>
>>>>>> Do you think it is possible to write a general headline filter that
>>>>>> takes care of all the various LaTeX possibilities?
>>>>> I don't like *one* filter to rule them all.  Of course, if it's a
>>>>> collection of other function calls that is OK.  As your recent
>>>>> question showed execution order may matter,
>>>>> (e.g. with :ignoreheading:clearpage:).
>>>>>
>>>>> Of course it's possible to bundle a couple of filters generally useful
>>>>> for ox-latex and provide a "consistent" interface.  Alternatively, one
>>>>> could make a ox-latex+.el that provides a derived class with extra
>>>>> options. That's may be more work, and may be harder to hack.
>>>>>
>>>>> In fact Aaron started ox-extra.el, with the intention of providing
>>>>> "semi-official" extensions but Worg may be a better means of
>>>>> communication.
>>>>>
>>>>>> Right now Iʻm using tags to ignoreheading, clearpage, and newpage.
>>>>>> In addition to your nonum filter, Eric S. has a filter that gets rid
>>>>>> of a heading and promotes the content, which I havenʻt had occasion
>>>>>> to use, but also has its own tag.
>>>>> Yes, Eric has cool tree-based filter(s).  I want to study them more
>>>>> carefully.  Quite possibly, it's easier to provide elegant filters
>>>>> with trees.  For instance, you have direct access to the element
>>>>> representation.  In my filters I "hack" my way to this using
>>>>> text-properties.
>>>>>
>>>>>>   From the LaTeX authorʻs point of view, it would be great to have a set
>>>>>> of tags (and options) that "just work."
>>>>> Would you want this as a derived class or filters?  Perhaps it's
>>>>> easier to have a derived class with an alternative headline
>>>>> function. . .
>>>>>
>>>>>> Do you (and others) think the "tag and filter" approach can achieve
>>>>>> this?  Or, are there too many moving parts to make it feasible?
>>>>> Yes.
>>>>>
>>>>> The ox-koma-script interface is basically controlled via tags.  I
>>>>> think it's nice.
>>>> Thanks for this useful overview and the pointers to good examples.
>>>>
>>>> Iʻve been slowly building a set of filters and links that work for me,
>>>> but each new project differs a bit from the previous one and I have to
>>>> fiddle with the Org mode setup.  Iʻm eager to get to the place Iʻm at
>>>> with LaTeX, where I just jump in and start writing.
>>>>
>>>> Thanks again for your help.
>>>>
>>>> All the best,
>>>> Tom
>>>>
>>> Thanks to everyone who responded.
>>>
>>> Several of my books are out of print and I am converting them to ePub
>>> and to printed form. ePub is pretty smooth by exporting to HTML and
>>> then using Calibre. LaTeX is the obvious choice for print.
>> Have you seen this project:
>>
>>       https://github.com/rzoller/tex2ebook
>>
>> I haven't tried it myself, but the process seems similar to what you
>> are doing only that it uses hevea to convert from tex to html.
>>
>> —Rasmus
>>
>>
> Thanks, Rasmus. I'll have a look at this and report back. Org -> tex
> -> 
> HTML would at least solve the unnumbered heading problem (with the use
> of your filter).
>
> As an additional aside, note that Pandoc Markdown permits the use of a
> tag to produce an unnumbered heading when exporting to HTML and LaTeX.
>
> # Heading {.unnumbered}

Pandoc has something good going for it, though in this case Org tags
seem nicer.  I'm particularly envious of the native support of
citations via "@·" in Pandoc.

> I'm a very inexperienced lisp coder, but it seems to me that this
> should be incorporated into the basic exporters. The HTML exporter,
> for example, adds the numbering to each heading. In the loop that
> accomplishes that, it should be easy to ignore headings with a tag
> such as your :nonum:. Otherwise, it is necessary to write a filter
> that not only undoes the numbering for selected headlines, but
> essentially reproduces the numbering algorithms originally introduced
> in ox-html.

How about the TOC?  Should unnumbered headlines still appear there?
If yes the implementation may be as easy as you are suggesting here
and a patch could be written.

—Rasmus

-- 
Send from my Emacs

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

end of thread, other threads:[~2014-08-08  8:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-06  0:11 Org equivalent to \chapter* Alan L Tyree
2014-08-06  1:11 ` Thorsten Jolitz
2014-08-06  2:28   ` Nick Dokos
2014-08-06  8:09     ` Thorsten Jolitz
2014-08-06  9:18 ` Rasmus
2014-08-06 17:15   ` Thomas S. Dye
2014-08-06 17:38     ` Rasmus
2014-08-06 19:52       ` Thomas S. Dye
2014-08-06 22:46         ` Alan L Tyree
2014-08-07 10:05           ` Rasmus
2014-08-07 22:07             ` Alan L Tyree
2014-08-08  8:42               ` Rasmus

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