public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: Pranesh Prakash
	<the.solipsist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Hiding TeX headers from HTML output
Date: Tue, 25 Aug 2020 23:18:50 -0700	[thread overview]
Message-ID: <m2r1ruszed.fsf@johnmacfarlane.net> (raw)
In-Reply-To: <95f7f71e-6af3-4d73-b47e-dd7bd28585e9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


OK, I thought you were talking about metadata in the document,
not defaults.yaml.  defaults.yaml isn't quite the same -- it
is a way of specifying default values for things you can specify
on the command line, and they work the same for the most part.
Metadata in defaults.yaml files is NOT parsed as Markdown,
but rather as plain text, just like --metadata on the command line.

This is pointed out in the documentation, which notes:

# metadata values specified here are parsed as literal
# string text, not markdown

If you want to include some metadata conditionally,
depending on the output format, but NOT by adding
header-includes to the YAML metadata in a markdown
file, then your best bet is to use a lua filter, which
has access to the output format in the FORMAT variable
and can insert the appropriate thing into header-includes
in the document's metadata.


Pranesh Prakash <the.solipsist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> On Wednesday, 26 August, 2020 at 3:14:37 am UTC+5:30 John MacFarlane wrote:
>> header-includes is the field name to use. 
>
> If I use header-includes in my defaults.yaml file thusly, without 
> back-ticks:
> ---
> metadata:
>    header-includes: |
>    \usepackage{microtype,parskip,bookmark,setspace,xurl,secdot}
>    \usepackage[hang,bottom]{footmisc}
>    \setlength{\footnotesep}{3mm}
> ...
>
> I get the following error:
>
>> Error producing PDF.
>> ! LaTeX Error: Missing \begin{document}.
>> 
>>  See the LaTeX manual or LaTeX Companion for explanation.
>> Type  H <return>  for immediate help.
>>  ...                                              
>>                                                   
>> l.43 \textbackslash
>
> If I use header-includes in my defaults.yaml file thusly, with back-ticks:
> ---
> metadata:
>    header-includes:
>   - |
>    ```{=latex}
>    \usepackage{microtype,parskip,bookmark,setspace,xurl,secdot}
>    \usepackage[hang,bottom]{footmisc}
>    \setlength{\footnotesep}{3mm}
>    ```
> ...
>
> I get the following error:
>
>> Error producing PDF.
>> ! LaTeX Error: Missing \begin{document}.
>> 
>>  See the LaTeX manual or LaTeX Companion for explanation.
>> Type  H <return>  for immediate help.
>>  ...                                              
>>  
>> l.43 `
>
> Regards,
> Pranesh
>
> -- 
> 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/95f7f71e-6af3-4d73-b47e-dd7bd28585e9n%40googlegroups.com.


  parent reply	other threads:[~2020-08-26  6:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 18:20 Pranesh Prakash
     [not found] ` <a669b6a7-167e-4056-b0fa-546e4fe53d7fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-08-25 19:53   ` Pranesh Prakash
2020-08-25 21:44   ` John MacFarlane
     [not found]     ` <m28se2v1sb.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2020-08-25 22:06       ` Pranesh Prakash
     [not found]         ` <95f7f71e-6af3-4d73-b47e-dd7bd28585e9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-08-26  6:18           ` John MacFarlane [this message]
     [not found]             ` <m2r1ruszed.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2020-08-26 10:48               ` Pranesh Prakash

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2r1ruszed.fsf@johnmacfarlane.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=the.solipsist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).