public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Custom epub3 template with imprint dedication and epigraph in front of the text
@ 2021-07-16  9:57 'juh' via pandoc-discuss
  2021-07-17  4:34 ` John MacFarlane
  0 siblings, 1 reply; 7+ messages in thread
From: 'juh' via pandoc-discuss @ 2021-07-16  9:57 UTC (permalink / raw)
  To: Pandoc Mailinglist

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

Dear all,

in my single source publishing process I use a custom context template
to include stuff like imprint, dedication and epigraph right before the
body text. 

All these infos are stored in the frontmatter like this

---
dedication: "To someone special"
---

I insert it in the context template like this:

$if(dedication)$
\startdedicationmakeup
$dedication$  
\stopdedicationmakeup
$endif$


I cannot find the right place to insert this into an epub3 template.

If I put 

$if(dedication)$
<section epub:type="dedication"> 
$dedication$  
</section>
$endif$

right before $body$ the content is inserted in front of every chapter.

So my question is:

How can I insert these components **only** in front of the whole body
text?

I saw the hint to the conditional titlepage here:

https://github.com/jgm/pandoc/issues/4823

But inserting imprint, dedication and epigraph there does not give the
right solution.

My preliminary solution is to conditionally include an
epub-frontmatter.md when I produce an ebook which gives the desired
result via this markup:

# Dedication {epub:type=dedication .hidden}

This creates single chapter files in the ebook with AFAICS the right
defintions.

The drawback is that I have two places where I define imprint,
dedication epigraph etc.  which is not, what I want in a single source
publishing project.

I know that I am using two different approaches to put the information
in place.

- In ConTeXt via variables from the frontmatter
- In EPUB via conditionally included content

Both ways work fine in their place.

Is there a third way to achieve this with really one source?

Many thanks in advance

Jan Ulrich Hasecke

-- 
Autoren-Homepage: ......... http://literatur.hasecke.com
Satiren & Essays: ......... http://www.sudelbuch.de
Privater Blog: ............ http://www.hasecke.eu
Netzliteratur-Projekt: .... http://www.generationenprojekt.de


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

* Re: Custom epub3 template with imprint dedication and epigraph in front of the text
  2021-07-16  9:57 Custom epub3 template with imprint dedication and epigraph in front of the text 'juh' via pandoc-discuss
@ 2021-07-17  4:34 ` John MacFarlane
       [not found]   ` <m2sg0do8xr.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2021-07-17  4:34 UTC (permalink / raw)
  To: 'juh' via pandoc-discuss, Pandoc Mailinglist

"'juh' via pandoc-discuss" <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
writes:

> I know that I am using two different approaches to put the information
> in place.
>
> - In ConTeXt via variables from the frontmatter
> - In EPUB via conditionally included content
>
> Both ways work fine in their place.
>
> Is there a third way to achieve this with really one source?

Have you considered using a custom template for epub that
includes $dedication$, etc.?


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

* Re: Custom epub3 template with imprint dedication and epigraph in front of the text
       [not found]   ` <m2sg0do8xr.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
@ 2021-07-17  8:36     ` 'juh' via pandoc-discuss
  2021-07-17 16:08       ` John MacFarlane
  0 siblings, 1 reply; 7+ messages in thread
From: 'juh' via pandoc-discuss @ 2021-07-17  8:36 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Am Fri, Jul 16, 2021 at 09:34:08PM -0700 schrieb John MacFarlane:
> Have you considered using a custom template for epub that
> includes $dedication$, etc.?

Yes, that was the first thing I did, but the included stuff appears on
top of every chapter. And as some discussions here and on github showed
me that this is the intended behavior I used the other way.

Jan Ulrich Hasecke 

-- 
Autoren-Homepage: ......... http://literatur.hasecke.com
Satiren & Essays: ......... http://www.sudelbuch.de
Privater Blog: ............ http://www.hasecke.eu
Netzliteratur-Projekt: .... http://www.generationenprojekt.de


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

* Re: Custom epub3 template with imprint dedication and epigraph in front of the text
  2021-07-17  8:36     ` 'juh' via pandoc-discuss
@ 2021-07-17 16:08       ` John MacFarlane
       [not found]         ` <m25yx8ordk.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2021-07-17 16:08 UTC (permalink / raw)
  To: 'juh' via pandoc-discuss, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


There's a section of the template under a conditional
$if(titlepage)$ -- that's where the title, subtitle,
and author appear.  Put it there and it will only
appear on the title page.

Forgive me if you already explained why that's not
what you want.

"'juh' via pandoc-discuss" <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
writes:

> Am Fri, Jul 16, 2021 at 09:34:08PM -0700 schrieb John MacFarlane:
>> Have you considered using a custom template for epub that
>> includes $dedication$, etc.?
>
> Yes, that was the first thing I did, but the included stuff appears on
> top of every chapter. And as some discussions here and on github showed
> me that this is the intended behavior I used the other way.
>
> Jan Ulrich Hasecke 
>
> -- 
> Autoren-Homepage: ......... http://literatur.hasecke.com
> Satiren & Essays: ......... http://www.sudelbuch.de
> Privater Blog: ............ http://www.hasecke.eu
> Netzliteratur-Projekt: .... http://www.generationenprojekt.de
>
>
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/20210717083627.GA6263%40sokrates.


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

* Re: Custom epub3 template with imprint dedication and epigraph in front of the text
       [not found]         ` <m25yx8ordk.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
@ 2021-07-18  8:38           ` 'juh' via pandoc-discuss
  2021-07-18 18:44             ` John MacFarlane
  0 siblings, 1 reply; 7+ messages in thread
From: 'juh' via pandoc-discuss @ 2021-07-18  8:38 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Am Sat, Jul 17, 2021 at 09:08:07AM -0700 schrieb John MacFarlane:
> 
> There's a section of the template under a conditional
> $if(titlepage)$ -- that's where the title, subtitle,
> and author appear.  Put it there and it will only
> appear on the title page.
> 
> Forgive me if you already explained why that's not
> what you want.

I am afraid that my knowledge of the epub format is too limited. I saw
your remark on this if-clause somewhere and tried it, but I got a
long title page without page breaks between title, imprint, dedication
and epigraph, which is not what I want. 

The result of

# Dedication {epub:type=dedication .hidden}

creates an extra ch00X.xhtml file with the dedication so that it appears
to be on its own "page".

Manual page breaks in epub3 are possible but a complex task as this answer
suggests.

https://ebooks.stackexchange.com/questions/6668/do-epub-3-0-pagebreaks-always-require-an-id

For the time being my second best solution which breaks the rule of
single source publishing is a good way to go.

Ciao!
Jan Ulrich Hasecke
 

-- 
Autoren-Homepage: ......... http://literatur.hasecke.com
Satiren & Essays: ......... http://www.sudelbuch.de
Privater Blog: ............ http://www.hasecke.eu
Netzliteratur-Projekt: .... http://www.generationenprojekt.de


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

* Re: Custom epub3 template with imprint dedication and epigraph in front of the text
  2021-07-18  8:38           ` 'juh' via pandoc-discuss
@ 2021-07-18 18:44             ` John MacFarlane
       [not found]               ` <m2im17lawq.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2021-07-18 18:44 UTC (permalink / raw)
  To: 'juh' via pandoc-discuss, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

"'juh' via pandoc-discuss" <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
writes:

> For the time being my second best solution which breaks the rule of
> single source publishing is a good way to go.

You could always auto-generate the markdown file for the dedication
from the metadata in the other file, using a custom template
and -t markdown.  Put this all together with a Makefile.


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

* Re: Custom epub3 template with imprint dedication and epigraph in front of the text
       [not found]               ` <m2im17lawq.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
@ 2021-07-19  7:09                 ` 'juh' via pandoc-discuss
  0 siblings, 0 replies; 7+ messages in thread
From: 'juh' via pandoc-discuss @ 2021-07-19  7:09 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Am Sun, Jul 18, 2021 at 11:44:21AM -0700 schrieb John MacFarlane:
> You could always auto-generate the markdown file for the dedication
> from the metadata in the other file, using a custom template
> and -t markdown.  Put this all together with a Makefile.

Thanks a lot. Great idea and – as most great ideas – so simple!

Jan Ulrich Hasecke


-- 
Autoren-Homepage: ......... http://literatur.hasecke.com
Satiren & Essays: ......... http://www.sudelbuch.de
Privater Blog: ............ http://www.hasecke.eu
Netzliteratur-Projekt: .... http://www.generationenprojekt.de


-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/20210719070931.GA9962%40sokrates.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2021-07-19  7:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16  9:57 Custom epub3 template with imprint dedication and epigraph in front of the text 'juh' via pandoc-discuss
2021-07-17  4:34 ` John MacFarlane
     [not found]   ` <m2sg0do8xr.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-17  8:36     ` 'juh' via pandoc-discuss
2021-07-17 16:08       ` John MacFarlane
     [not found]         ` <m25yx8ordk.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-18  8:38           ` 'juh' via pandoc-discuss
2021-07-18 18:44             ` John MacFarlane
     [not found]               ` <m2im17lawq.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-19  7:09                 ` 'juh' via pandoc-discuss

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 NNTP newsgroup(s).