From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26005 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pranesh Prakash Newsgroups: gmane.text.pandoc Subject: Re: Hiding TeX headers from HTML output Date: Wed, 26 Aug 2020 03:48:52 -0700 (PDT) Message-ID: <8eccb293-2c5b-492f-9ac0-8cc505cfa4efn@googlegroups.com> References: <95f7f71e-6af3-4d73-b47e-dd7bd28585e9n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1606_836279913.1598438932357" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29610"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDA2Z3PTWYIBBFP4TD5AKGQEEKLRYIQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Aug 26 12:48:58 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f58.google.com ([209.85.161.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kAszB-0007a8-NT for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 26 Aug 2020 12:48:57 +0200 Original-Received: by mail-oo1-f58.google.com with SMTP id f13sf810632ooo.13 for ; Wed, 26 Aug 2020 03:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender: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:list-subscribe :list-unsubscribe; bh=1se0Nn4Gur1NfdlsBQMLv3ot5dVgPWRiZQ6NddLy2qU=; b=iDbQ/jSBqagUwBeNgVkvupjMTDOui24HiG0sq96RS5fycHQAkTM5cVHIc1eYTyzbYh xzUURf6yyDrgOaKZih13tIIJjfCNkCv7SYXMHEG7yAkv+T01QiKmC6YNxDG6TVcnZW5s 6vKpVCbBlyCYKPUfXm8nQSmwuSRYFoCFoWhWJoNVjG5B4+Ur26XQfmbEM7yF0NwPPgUR TzhN+jBaHAJW3Vu8531pgA20/maMt67mw8rTGaz6nNyZMOVG5Q0xRhLTYrxf+QtchsYh +YQyz7Qw/53JRQIuxP+M3KmTLU53QA+uAZW5lQlLFIwH3do5WJLvwnFvlivyzHP+6Tn8 V8lg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; 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:list-subscribe:list-unsubscribe; bh=1se0Nn4Gur1NfdlsBQMLv3ot5dVgPWRiZQ6NddLy2qU=; b=lRid/X0doPfXKsNsBUvRA2jPxwZ4XgqVzplnDAIAx3n7cQ61RhZtMFzsHMlLqlt6Q5 EBCh76LdYw3QglCpg0YzI4tBswM5/c/HDEoDRuVHNvvHHRItqG/O3RAB7HH/bJAqWQQJ WqMD2AEi3VsVbVBoDJ27r4mrsYOmPA+XYMDs/rm5CdXal15psD0iYd0vxjrFpzY73l9o 8KHK97WHHVfqKrHiXUpXD0igAMHU+2k/j3AtHUpeOxx8WXJbCz3rIHmj6o3KtTPA3uTG 5Mc3Z53eJdoYdfBYjMwKmx68N+lIO0eL5ze4bA7mEMTeeLZ/yT+/6+QgnO25qN+Gg6qz R74Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=1se0Nn4Gur1NfdlsBQMLv3ot5dVgPWRiZQ6NddLy2qU=; b=tew4WEYnYiW+diogAA12PU2WKmqWs77LeJGX+PVw+uY1UmMZz1/QUAdZEng/dzkAVq O3NRKEyAA+rKFL9qCHf60foehKWJFnvBqZqLNONPWY50Gi4VLt6f2UcGio7D91hY4zGr 9mDxcXjTfZXUdj2uzVm/YMBSByGDKW8l/StEm4/L2elx1KN0DJWIi+fZytXN4lMfCLMC jvjYQOLAMmRc30jiErfgKFy3saKbQQREOcSPaIKrwpsLrPZmlr5j8os01jKRG8ix1aG8 0j0rIRjFqfZOthegPqY2tf1kGS1jH0kIejhjKqQU/gFOoaveb49SzO2ndhAlu1Ls587o o3Ow== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532ysknB1AK/Fv6xBm+zKaktpR2SD6zW4jyJbz0dyLsR9rON5cD0 nMHrfPGiWrgadXwu9catntg= X-Google-Smtp-Source: ABdhPJwka8t2KRYl6sDGlIdTQ/fTN1mXxkqNuPH8yCTpLLrBhPDW0stcss4t2LoutblQTHLoA2Eb4Q== X-Received: by 2002:a05:6808:8db:: with SMTP id k27mr3539306oij.18.1598438936640; Wed, 26 Aug 2020 03:48:56 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:3d6:: with SMTP id f80ls439183otf.4.gmail; Wed, 26 Aug 2020 03:48:53 -0700 (PDT) X-Received: by 2002:a05:6830:cc:: with SMTP id x12mr10094952oto.54.1598438933076; Wed, 26 Aug 2020 03:48:53 -0700 (PDT) In-Reply-To: X-Original-Sender: the.solipsist-Re5JQEeQqe8AvxtiuMwx3w@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: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:26005 Archived-At: ------=_Part_1606_836279913.1598438932357 Content-Type: multipart/alternative; boundary="----=_Part_1607_1762320902.1598438932357" ------=_Part_1607_1762320902.1598438932357 Content-Type: text/plain; charset="UTF-8" Goodness gracious me! It's all worked out. I started using `-H` for including the tex files some years ago not to avoid using `header-includes`, but because I couldn't get in-file `headers-include` to work properly. It probably wasn't working correctly back then because I hadn't used ```{=latex}. But now, finally, this worked, when placed in the in-file YAML metadata block: ``` header-includes: | ```{=latex} \usepackage{microtype,parskip,bookmark,setspace,xurl,secdot} \setlength{\parskip}{9pt plus1pt} \setlength{\parindent}{1.5em} \usepackage[hang,bottom,multiple]{footmisc} \setlength{\footnotesep}{3mm} ``` ``` Thanks so much John! I think eventually I will try to learn a bit of Lua to write a filter for this, since it's a bit ungainly to keep copy-pasting this snippet into each document I write. One work-around (I think, if that's the right word), which seems to work for me: Create a latex-headers.md with the above `header-includes` YAML metadata, and include it as an input file (from being "markdown") in addition to your main file. Then it seems to (a) get parsed as markdown, (b) recognized as `headers-includes` metadata, (c) results in the LaTeX being used to create PDFs, but not showing up in the HTML. And thank you so much for the defaults system. It's a game-changer for the coding-challenged amongst us. On Wednesday, 26 August, 2020 at 11:49:07 am UTC+5:30 John MacFarlane wrote: > > 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 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 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 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-discus...-/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 > . > -- 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/8eccb293-2c5b-492f-9ac0-8cc505cfa4efn%40googlegroups.com. ------=_Part_1607_1762320902.1598438932357 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Goodness gracious me!  It's all worked out.  I started using= `-H` for including the tex files some years ago not to avoid using `header= -includes`, but because I couldn't get in-file `headers-include` to work pr= operly.  It probably wasn't working correctly back then because I hadn= 't used ```{=3Dlatex}.  But now, finally, this worked, when placed in = the in-file YAML metadata block:
```
header-include= s: |
  ```{=3Dlatex}
  \usepackage{microtype,parskip,bookma= rk,setspace,xurl,secdot}
  \setlength{\parskip}{9pt plus1pt}
&nb= sp; \setlength{\parindent}{1.5em}
  \usepackage[hang,bottom,multipl= e]{footmisc}
  \setlength{\footnotesep}{3mm}
  ```
```

Thanks so much John!

I think eventually I will try to learn a bit of Lua to write a filter for= this, since it's a bit ungainly to keep copy-pasting this snippet into eac= h document I write.

One work-around (I think, if t= hat's the right word), which seems to work for me:

Create a latex-headers.md with the above `header-includes` YAML metadata, = and include it as an input file (from being "markdown") in addition to your= main file.  Then it seems to (a) get parsed as markdown, (b) recogniz= ed as `headers-includes` metadata, (c) results in the LaTeX being used to c= reate PDFs, but not showing up in the HTML.

And th= ank you so much for the defaults system. It's a game-changer for the coding= -challenged amongst us.
On Wednesday, 26 August, 2020 at 11:49:07 am UTC+5:= 30 John MacFarlane wrote:

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.so..= .@gmail.com> writes:

> On Wednesday, 26 August, 2020 at 3:14:37 am UTC+5:30 John MacFarla= ne wrote:
>> header-includes is the field name to use.=20
>
> If I use header-includes in my defaults.yaml file thusly, without= =20
> 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}.
>>=20
>> See the LaTeX manual or LaTeX Companion for explanation.
>> Type H <return> for immediate help.
>> ... =20
>> =20
>> l.43 \textbackslash
>
> If I use header-includes in my defaults.yaml file thusly, with bac= k-ticks:
> ---
> metadata:
> header-includes:
> - |
> ```{=3Dlatex}
> \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}.
>>=20
>> See the LaTeX manual or LaTeX Companion for explanation.
>> Type H <return> for immediate help.
>> ... =20
>> =20
>> l.43 `
>
> Regards,
> Pranesh
>
> --=20
> 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-discus..= .@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9= 5f7f71e-6af3-4d73-b47e-dd7bd28585e9n%40googlegroups.com.

--
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 view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/8eccb293-2c5b-492f-9ac0-8cc505cfa4efn%40googlegroups.= com.
------=_Part_1607_1762320902.1598438932357-- ------=_Part_1606_836279913.1598438932357--