emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Getting "Chapter" before a heading number
@ 2016-12-29 19:54 Peter Davis
  2016-12-29 22:26 ` Richard Lawrence
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Davis @ 2016-12-29 19:54 UTC (permalink / raw)
  To: emacs-orgmode


I'm preparing a proposed table of contents for a book, and I'd like the HTML output to appear like:

Chapter 1 Blah
  1.1 blah
  1.2 blah blah
  1.3 blah blah blah

Chapter 2 Blah Blah
  2.1 blah
  2.2 blah blah

etc.

Is there a way to get HTML output to do this? I'd like the "*" at the start of a line to denote a new chapter, and nested headings
to go inside. I haven't been able to find anything like this.

Thanks very much, and Happy New Year to all!

-pd

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

* Re: Getting "Chapter" before a heading number
  2016-12-29 19:54 Getting "Chapter" before a heading number Peter Davis
@ 2016-12-29 22:26 ` Richard Lawrence
  2016-12-29 22:41   ` Peter Davis
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Lawrence @ 2016-12-29 22:26 UTC (permalink / raw)
  To: Peter Davis, emacs-orgmode

Hi Peter,

Peter Davis <pfd@pfdstudio.com> writes:

> I'm preparing a proposed table of contents for a book, and I'd like the HTML output to appear like:
>
> Chapter 1 Blah
>   1.1 blah
>   1.2 blah blah
>   1.3 blah blah blah
>
> Chapter 2 Blah Blah
>   2.1 blah
>   2.2 blah blah
>
> etc.
>
> Is there a way to get HTML output to do this? I'd like the "*" at the start of a line to denote a new chapter, and nested headings
> to go inside. I haven't been able to find anything like this.
>

This might not be exactly what you want, but it's pretty trivial to do
this with CSS.  In your stylesheet, you want something like (untested):

span.section-number-2:before { content: "Chapter" }

Basically, this tells the browser to put the word "Chapter" before the
number of a first-level headline (which, in a default setup, is exported
as a span tag with class section-number-2).

If you'd rather that "Chapter" appears in the actual HTML, you probably
want to use a filter on headlines during export.

Hope that helps!
 
Best,
Richard

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

* Re: Getting "Chapter" before a heading number
  2016-12-29 22:26 ` Richard Lawrence
@ 2016-12-29 22:41   ` Peter Davis
  2016-12-31 14:23     ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Davis @ 2016-12-29 22:41 UTC (permalink / raw)
  To: Richard Lawrence, Peter Davis, emacs-orgmode


On 12/29/16 5:26 PM, Richard Lawrence wrote:
> Hi Peter,
>
> Peter Davis <pfd@pfdstudio.com> writes:
>
>> I'm preparing a proposed table of contents for a book, and I'd like the HTML output to appear like:
>>
>> Chapter 1 Blah
>>    1.1 blah
>>    1.2 blah blah
>>    1.3 blah blah blah
>>
>> Chapter 2 Blah Blah
>>    2.1 blah
>>    2.2 blah blah
>>
>> etc.
>>
>> Is there a way to get HTML output to do this? I'd like the "*" at the start of a line to denote a new chapter, and nested headings
>> to go inside. I haven't been able to find anything like this.
>>
> This might not be exactly what you want, but it's pretty trivial to do
> this with CSS.  In your stylesheet, you want something like (untested):
>
> span.section-number-2:before { content: "Chapter" }
>
> Basically, this tells the browser to put the word "Chapter" before the
> number of a first-level headline (which, in a default setup, is exported
> as a span tag with class section-number-2).
>
> If you'd rather that "Chapter" appears in the actual HTML, you probably
> want to use a filter on headlines during export.
>
> Hope that helps!
Yes, thanks, Richard! This will certainly work for this occasion. It 
would be great to find a way to do this through org in future, for 
documents that keep changing, but this will work for now.

Thanks!
-pd

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

* Re: Getting "Chapter" before a heading number
@ 2016-12-30 19:21 Peter Davis
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Davis @ 2016-12-30 19:21 UTC (permalink / raw)
  To: emacs-orgmode

Peter Davis <pfd@pfdstudio.com> writes:

> I'm preparing a proposed table of contents for a book, and I'd like the HTML output to appear like:
>
> Chapter 1 Blah
>   1.1 blah
>   1.2 blah blah
>   1.3 blah blah blah
>
> Chapter 2 Blah Blah
>   2.1 blah
>   2.2 blah blah
>
> etc.
>
> Is there a way to get HTML output to do this? I'd like the "*" at the start of a line to denote a new chapter, and nested headings
> to go inside. I haven't been able to find anything like this.

It occurred to me that another way to get this effect might be with numbered lists:

#+BEGIN_SRC org
 * Chapter 1 Blah
   1. blah
   2. blah blah
   3. blah blah blah
 * Chapter 2 Blah Blah
   1. blah
   2. blah blah
#+END_SRC

and so on. Is there any way to get numbered lists to use a "." notation, where the path to each list item is indicated by
.-separated numbers?

 1
 1.1
 1.2
 1.2.1
 ...


Thanks, and Happy New Year!

-pd

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

* Re: Getting "Chapter" before a heading number
  2016-12-29 22:41   ` Peter Davis
@ 2016-12-31 14:23     ` Nicolas Goaziou
  2016-12-31 14:40       ` Peter Davis
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2016-12-31 14:23 UTC (permalink / raw)
  To: Peter Davis; +Cc: emacs-orgmode, Peter Davis

Hello,

Peter Davis <pfdavis@fastmail.fm> writes:

> Yes, thanks, Richard! This will certainly work for this occasion. It
> would be great to find a way to do this through org in future,

As answered by Richard, the way to do this through Org is to use
a filter.


Regards,

-- 
Nicolas Goaziou

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

* Re: Getting "Chapter" before a heading number
  2016-12-31 14:23     ` Nicolas Goaziou
@ 2016-12-31 14:40       ` Peter Davis
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Davis @ 2016-12-31 14:40 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Peter Davis


On 12/31/16 9:23 AM, Nicolas Goaziou wrote:
> Hello,
>
> Peter Davis <pfdavis@fastmail.fm> writes:
>
>> Yes, thanks, Richard! This will certainly work for this occasion. It
>> would be great to find a way to do this through org in future,
> As answered by Richard, the way to do this through Org is to use
> a filter.

Aha! Thank you, Nicolas and Richard. I missed this in the earlier reply. 
I'll read up on it. Looks like a very powerful feature.

Thanks!
-pd

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

end of thread, other threads:[~2016-12-31 14:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-29 19:54 Getting "Chapter" before a heading number Peter Davis
2016-12-29 22:26 ` Richard Lawrence
2016-12-29 22:41   ` Peter Davis
2016-12-31 14:23     ` Nicolas Goaziou
2016-12-31 14:40       ` Peter Davis
  -- strict thread matches above, loose matches on Subject: below --
2016-12-30 19:21 Peter Davis

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