From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/9803 Path: news.gmane.org!not-for-mail From: Russ Newsgroups: gmane.text.pandoc Subject: Re: How could I add an image in title_page? Date: Sun, 11 May 2014 11:54:04 -0700 (PDT) Message-ID: <345dfff1-dd39-4aa9-862b-09d4cc0d2dd4@googlegroups.com> References: <20130504020837.GC18967@Johns-MacBook-Pro.local> <83fcb9e5-f974-4520-8b5b-f3359d4d3869@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_90_9400202.1399834444346" X-Trace: ger.gmane.org 1399834451 946 80.91.229.3 (11 May 2014 18:54:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 May 2014 18:54:11 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBC77N3USRAPBBTMOX6NQKGQEHIYB5EQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun May 11 20:54:06 2014 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-qc0-f183.google.com ([209.85.216.183]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WjYsw-000051-8H for gtp-pandoc-discuss@m.gmane.org; Sun, 11 May 2014 20:54:06 +0200 Original-Received: by mail-qc0-f183.google.com with SMTP id m20sf1487559qcx.20 for ; Sun, 11 May 2014 11:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=ZuYmk6gPVcESvd4vc9enK5qxBUKoNyuloCS2OTyPd4U=; b=Y1yWhyXGm0/pyFNw8kdeUSKD56s2nEjvg4xpuHdlU4cXLr9Fv9M10SGqiJ0n8KVKdY +mrfOJvFA8U+gnY9VxDDfK5YtlmxKsnUW3bIf0ffEnaZROHmiTM8qGNVbLzY0zN8P3TU 1FM3nBVCtv9UjiqUbgi9tQsvsBw3jIcBN0WJrrvdayCpkgqk+lQU69+clBGJnfS1ElZQ 39HtPUq1D/Zq2iTpD6C34pQOnoRrGIuFwlH/VFSHd+QtP68XuwdCGul5nIVYSmZqh2E7 V8Z+G3TsNzCCp2q7yu5WgC4yXEzMBvg1P6e0oSZ7uhRD3dereYSu3khWtDHJt+xsPzY9 kaFA== X-Received: by 10.140.44.75 with SMTP id f69mr2295qga.11.1399834445503; Sun, 11 May 2014 11:54:05 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.140.49.112 with SMTP id p103ls1093170qga.41.gmail; Sun, 11 May 2014 11:54:05 -0700 (PDT) X-Received: by 10.140.97.166 with SMTP id m35mr2194qge.28.1399834445111; Sun, 11 May 2014 11:54:05 -0700 (PDT) In-Reply-To: X-Original-Sender: info-ckBjHRpK5r9MPTj2movljOTW4wlIGRCZ@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-Subscribe: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:9803 Archived-At: ------=_Part_90_9400202.1399834444346 Content-Type: text/plain; charset=UTF-8 Thanks for your help, I now see what John meant. On Sunday, 11 May 2014 17:38:14 UTC+1, Matthew Pickering wrote: > > What John was referring to was using data urls instead of a relative path. > Try converting your image into base64 (using something like this) > and replacing your current image code with what that tool returns. > > On Sunday, May 11, 2014 12:56:03 PM UTC+1, Russ wrote: >> >> I want to do something similar, but I'm not really sure I understood the >> answer. >> >> Basically we want to use a small version of the cover image on the title >> page (we could size using css.) >> We'd ideally like to use only one image because of size. >> >> If I examine a built epub book, I can see the cover image in in >> '../Images/cover-image.jpg' >> >> I initially thought I'd just include a link to it in the default.epub >> template, something like >> >> ```html >>
>> cover image >>
>> ``` >> But when I build that and validate using epubcheck (v2.0.1) >> I get errors: >> >> ``` >> Validating against EPUB version 2.0 >> ERROR: aj-hall-test-book.epub: could not parse title_page.xhtml: Invalid >> path: ../Images/cover-image.jpg >> ``` >> >> Anyone have any ideas, even a more idiot-proof explanation of the >> previous answer would be much appreciated. >> >> >> On Saturday, 4 May 2013 03:08:37 UTC+1, fiddlosopher wrote: >>> >>> +++ Feng LI [May 03 13 15:52 ]: >>> > Hi all, >>> > >>> > I would like add an image in the title page (highlight part) in the >>> > generated epub file. Something like this: >>> > >>> > $if(titlepage)$ >>> >

$title$

>>> > $for(author)$ >>> >

$author$

>>> > $endfor$ >>> > $if(date)$ >>> >

$date$

>>> > $endif$ >>> > >>> > >>> > But couldn't figure how to refer to an image in the template since >>> all >>> > images are renamed after processing by pandoc? >>> >>> I suppose you could use a data: URL. (To get the code for this, >>> try >>> >>> echo "![](mylogo.gif)" | pandoc --self-contained >>> >>> -- 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/345dfff1-dd39-4aa9-862b-09d4cc0d2dd4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_90_9400202.1399834444346 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for your help, I now see what John meant.

On= Sunday, 11 May 2014 17:38:14 UTC+1, Matthew Pickering wrote:
What John was referring to= was using data urls instead of a relative path. Try converting your image = into base64 (using something like this) and replacing = your current image code with what that tool returns.

On = Sunday, May 11, 2014 12:56:03 PM UTC+1, Russ wrote:
I want to do something similar, but I'm no= t really sure I understood the answer.

Basically we want to use a s= mall version of the cover image on the title page (we could size using css.= )
We'd ideally like to use only one image because of size.

If I e= xamine a built epub book, I can see the cover image  in in '../Images/= cover-image.jpg'

I initially thought I'd just include a link to it i= n the default.epub template, something like

```html
  <di= v class=3D"cover-image-small">
    <img alt=3D"cove= r image" src=3D"../Images/cover-image.jpg" />
  </div>= ;
```
But when I build that and validate using epubcheck (v2.0.1)
= I get errors:

```
Validating against EPUB version 2.0
ERROR: a= j-hall-test-book.epub: could not parse title_page.xhtml: Invalid path: ../I= mages/cover-image.jpg
```

Anyone have any ideas, even a more idio= t-proof explanation of the previous answer would be much appreciated.

On Saturday, 4 May 2013 03:08:37 UTC+1, fiddlosopher wrote:+++ Feng LI [May 03 13 15:52 ]:
>    Hi all,
>=20
>    I would like add an image in the title page (highligh= t part) in the
>    generated epub file. Something like this:
>=20
>    $if(titlepage)$
>      <h1 class=3D"title">$title$</h1>
>    $for(author)$
>      <h2 class=3D"author">$author$</h2>
>    $endfor$
>    $if(date)$
>      <h3 class=3D"date">$date$</h3>
>    $endif$
>    <div class=3D"my-logo"><img src=3D"mylogo.gi= f" /></div>
>=20
>    But couldn't figure how to refer to an image in the t= emplate since all
>    images are renamed after processing by pandoc?

I suppose you could use a data: URL.  (To get the code for this,
try

echo "![](mylogo.gif)" | pandoc --self-contained

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/345dfff1-dd39-4aa9-862b-09d4cc0d2dd4%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_90_9400202.1399834444346--