public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Sans serif text in HTML and PDF outputs
@ 2016-05-20 19:07 R (Chandra) Chandrasekhar
       [not found] ` <4ddc7c71-2642-2ef8-f634-1908f2a52794-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: R (Chandra) Chandrasekhar @ 2016-05-20 19:07 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

I wish to display some sans serif text in both HTML and PDF output from 
the _same_ single source document, if possible. I have three questions.

I can do it in XeLaTeX/PDF with \textsf{sans serif} but the text in the 
braces will not show up in the HTML version.

Question 1: How might I get it to show sans serif in the HTML version as 
well?

To get sans serif text in HTML, I can show sans serif text as 
<textsf>sans serif</textsf> and define a CSS file with the single line

textsf {font-family: sans-serif;}

save that file as sans-serif.css and invoke pandoc with

--css="sans-serif.css"

or alternatively, save the single line

<style type="text/css">textsf {font-family: sans-serif;}</style>

and save that as "sans-serif-header.css" and invoke pandoc with

--include-in-header="sans-serif-header.css"

In both cases, the HTML shows the sans-serif font correctly while the 
XeLaTeX/PDF output does not.

Question 2: How might I get it to display sans serif in PDF as well?

Finally, I tried including the CSS one-liner file 
"sans-serif-header.css" as a file in the YAML header block like so:

---
header-includes:
   - "sans-serif-header.css"
---

both with and without quotes, but apart from printing the text in 
quotes, nothing else happened in the HTML version, and the PDF version 
would not compile due to LaTeX errors.

Question 3: Is there a way to include a filename as part of the 
header-includes YAML field and have the file compile correctly both for 
HTML and XeLaTeX/PDF?

Thank you.


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

* Re: Sans serif text in HTML and PDF outputs
       [not found] ` <4ddc7c71-2642-2ef8-f634-1908f2a52794-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-05-20 21:36   ` BP Jonsson
  0 siblings, 0 replies; 2+ messages in thread
From: BP Jonsson @ 2016-05-20 21:36 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Den 2016-05-20 kl. 21:07, skrev R (Chandra) Chandrasekhar:
> I wish to display some sans serif text in both HTML and PDF output
> from the _same_ single source document, if possible. I have three
> questions.
>
> I can do it in XeLaTeX/PDF with \textsf{sans serif} but the text
> in the braces will not show up in the HTML version.
>
> Question 1: How might I get it to show sans serif in the HTML
> version as well?

You might find this filter helpful:

<https://gist.github.com/bpj/dc09a4943bc51ca64327c65623a121e9>

/bpj


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

end of thread, other threads:[~2016-05-20 21:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-20 19:07 Sans serif text in HTML and PDF outputs R (Chandra) Chandrasekhar
     [not found] ` <4ddc7c71-2642-2ef8-f634-1908f2a52794-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-20 21:36   ` BP Jonsson

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