From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/14797 Path: news.gmane.org!not-for-mail From: Rick Dooling Newsgroups: gmane.text.pandoc Subject: =?UTF-8?Q?Re:_YAML_block_to_carry_LaTeX_font_det?= =?UTF-8?Q?ails_--_how_do_I_preserve_'{'_and_=E2=80=98}=E2=80=98_=3F?= Date: Sat, 23 Apr 2016 17:57:24 -0700 (PDT) Message-ID: References: <6c4977e8-6dca-4d33-a44b-a72a31603e60@googlegroups.com> <20160410023930.GA96031@MacBook-Air-2.local> <20160410051448.GB2108@MacBook-Air-2.local> <2222a182-2c72-4c59-935a-feb01e091299@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_115_1755400212.1461459444412" X-Trace: ger.gmane.org 1461459447 24297 80.91.229.3 (24 Apr 2016 00:57:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Apr 2016 00:57:27 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDQOP2NVWEIBB5NT6C4AKGQEM5CSRLI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Apr 24 02:57:27 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-qk0-f190.google.com ([209.85.220.190]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1au8MY-0001Fj-G7 for gtp-pandoc-discuss@m.gmane.org; Sun, 24 Apr 2016 02:57:26 +0200 Original-Received: by mail-qk0-f190.google.com with SMTP id k126sf44738421qke.1 for ; Sat, 23 Apr 2016 17:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender: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=tDI0bovHtU7vTV+LEYEiCjlrfN+1n2rfhQkYco0mSCU=; b=RvwcwkDsCVQWF0hGHgS4iqpJCBOR7OL+QZdMN7srdI2ghouaAg9BZbo8Ck8mHrCCMK ozohwF8ZxmV0RqTv94uMpVfJl8I4JEROfxFC3C1fPqF6b0wQYOAhT6/KvoHXtLxEUsCA kEVnhyoh8jCJ+NJN99arANW4UiWGU5OJ1oAV65+NEh1xFYpOvEX1m2ez2+sE1vO3rzFo /GO/EZN21ALIf7rb0JuZrQAD5teGiWhpZl+6+RhFDBMOk7HWU/NT+H1J/l+y1sZ59iXb bqbPi+FnuP+wEhHOOSABoRkL4MjR2Gubkiy/ebHNEb8pyl1RWGhCHjlIk8x9ai5sovIr gxcw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=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=tDI0bovHtU7vTV+LEYEiCjlrfN+1n2rfhQkYco0mSCU=; b=RwpuW9U0GC4oAfXf7I9YLv7Zxkm8xqQKQYSTWYClOxezBeOrujPr0jiXmO/k+EpcMc td74rrsSbilLnwLGPE17uRs5RLrQ76fCk0MYoN7PIXzYJYCUtFy/JGCV3EmgJGI81XJg zYGGzDIHr95RpKNV0UCbrt9p/i58eqyrNTVYcZ5avKeGEGtnQNX9umQZo6DpH95cNQh2 T+eCJ7Yq0KZLlCOq07VeU+bLxQsSC6yHbikz1U5au2KRiRYJEgsYIhjyflNUPdkDx5P1 Kd9iIZsXErPYl7m/JqckVuhbmGFr9mr51bCkxsmagiK8MR8a/qU007eVf/y39mAvnsUE xmzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=tDI0bovHtU7vTV+LEYEiCjlrfN+1n2rfhQkYco0mSCU=; b=ZhUJ1HX5m3droQ1FZhHlB6X4EhFzsJuhQCOLfieoxeWVPy9InQXHJ0UclQq6qbTQuS JhDtZAWE7pYFKChM+4SJfvXoV3UVRfEiSzcFuBNIZgVsI/XRlpkjzvA330ePEy5NVvIX FV1FgoiJADvs2qxcSTe/Eo+ZKU+YUUEMKHMFA/pmNBXschNtHPcNDCJaNxXKGhT6rJMK +9fWy1Y1liAw7qbBukAPbTdnhvJbEGg9dXqTpN8y1jF9zzet57Ah1WuO6GIzaJEHSIQb Z12Kj/s3cw+IRnoLMsBG/B6laEpYSXaldnV7YS9a+Sr7hOBAodEQpva+0sN8VwOynef/ ZIVg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOPr4FUr52EGJT58lCqA6l5Qjiaoi/ESAfftRVzZi+W/FKQ3mztLGB59KkOcd7JriF8xyg== X-Received: by 10.182.176.40 with SMTP id cf8mr296289obc.8.1461459445748; Sat, 23 Apr 2016 17:57:25 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.44.133 with SMTP id p5ls368606otb.79.gmail; Sat, 23 Apr 2016 17:57:24 -0700 (PDT) X-Received: by 10.157.5.180 with SMTP id 49mr307051otd.10.1461459444923; Sat, 23 Apr 2016 17:57:24 -0700 (PDT) In-Reply-To: <2222a182-2c72-4c59-935a-feb01e091299-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: rpdooling-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-Spam-Checked-In-Group: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:14797 Archived-At: ------=_Part_115_1755400212.1461459444412 Content-Type: multipart/alternative; boundary="----=_Part_116_687894130.1461459444412" ------=_Part_116_687894130.1461459444412 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I don't know. Maybe I'm a simpleton but I would just edit the latex=20 templates. I have lots of them. Then you keep your source file clean. Rick On Sunday, April 10, 2016 at 5:42:50 AM UTC-5, kurt.p...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org=20 wrote: > > On Sunday, April 10, 2016 at 7:15:02 AM UTC+2, John MacFarlane wrote: > > +++ John MacFarlane [Apr 09 16 19:39 ]:=20 >> >See BP Johnson's suggestions (recently in this list) about=20 >> >> BP Jonsson, I mean!=20 >> > Well =E2=80=94 and in my OP I meant to say I started to *experiment* (not= to=20 > *experience*)=E2=80=A6 :-) > > I'm referring to the technique of defining a macro like=20 >> >> \newcommand{\wrap}[1]{#1}=20 >> >> and using it to wrap things that you don't want pandoc=20 >> interpreting as Markdown.=20 >> > At first I did not understand at all how I should apply this advice to my= =20 > situation=E2=80=A6 However, thanks to this tipp and some more experimenta= tion on my=20 > part, I found a solution. I=E2=80=99ll document it here in case someone e= lse finds=20 > it useful too. > What I did first (cul-de-sac, not working!)=20 > > I created a file named *wrapmarkdown.tex* with this content: > > \makeatletter > \newcommand{\wrapmarkdown}[1]{#1}- > \makeatother > > and included it as a parameter into my Pandoc command: -H wrapmarkdown.te= x > . > > Into my YAML block I put this modification: > > > > mainfontoptions: \wrapmarkdown{BoldFont=3DWeidemannStd-Bold.otf, Italic= Font=3DWeidemannBookItalic.otf, BoldItalicFont=3DWeidemannStd-BoldItalic.ot= f, ItalicFeatures=3D{Colour=3DAA0001}, BoldFeatures=3D{Colour=3D0000 > > This ended up with a LaTeX output containing this code around line 17: > > > \setmainfont[\wrapmarkdown{BoldFont=3DWeidemannStd-Bold.otf, > ItalicFont=3DWeidemannBookItalic.otf, BoldItalicFont=3DWeidemannSt= d-BoldItalic.otf, > ItalicFeatures=3D{Colour=3DAA0001}, BoldFeatures=3D{Colour=3D0000A= A}, > BoldItalicFeatures=3D{Colour=3DAA00AA}}]{WeidemannBook} > > and this code around line 107: > > \makeatletter > \newcommand{\wrapmarkdown}[1]{#1}=20 > \makeatother > > When compiling this to PDF, an error occurred: > > ! Undefined control sequence. > ...st ,\l__fontspec_fontopts_clist ,\wrapmarkdown > {BoldFont=3DWeidemannStd-Bol... > > ... > > What I did next (final solution)=20 > > The error message made me move the snippet from around line 107 to lines= =20 > 2-4 of my generated LaTeX file. The output PDF was created successfully= =20 > after this modification.=20 > > Therefore I ditched the inclusion of my *wrapmarkdown.tex* file via the -= H > /--include-in-header command line parameter. > > Instead I hard-coded the respective lines into a custom LaTeX template,= =20 > right after its initial lines, and added=20 > --template=3Dmy-custom-latex-template.latex into the command line. > Another question=E2=80=A6=20 > > I assume there is no way to make -H include a code snippet at a specific= =20 > spot in the LaTeX header? The problem with my original approach seems to= =20 > have been that on line 17 the call to the \wrapmarkdown newcommand came= =20 > *before* its definition on line 107=E2=80=A6 and that the only workaround= was the=20 > one I used: to hard-code it into the LaTeX-template at an earlier line? > > Would it be feasible to add a variable-based approach into the default=20 > Pandoc template, which could be utilized from the command line for cases= =20 > like this? > =E2=80=8B > --=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 e= mail 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/b9af327d-6e18-4625-b3de-dbf8702e4d6c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_116_687894130.1461459444412 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I don't know. Maybe I'm a simpleton but I would ju= st edit the latex templates. I have lots of them. Then you keep your source= file clean.

Rick

On Sunday, April 10, 2016 at 5:42:50 AM UTC= -5, kurt.p...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org wrote:

On Sund= ay, April 10, 2016 at 7:15:02 AM UTC+2, John MacFarlane wrote:

+++ John MacFarlane [Apr 09 16 19:39 ]:
>See BP Johnson's suggestions (recently in this list) about

BP Jonsson, I mean!

Well =E2=80=94 and in my OP I meant= to say I started to experiment (not to experience)=E2=80=A6 = =C2=A0 =C2=A0 :-)

I'm referring to the technique of defining a mac= ro like

=C2=A0 =C2=A0 \newcommand{\wrap}[1]{#1}

and using it to wrap things that you don't want pandoc
interpreting as Markdown.

At first I did not understand at al= l how I should apply this advice to my situation=E2=80=A6 However, thanks t= o this tipp and some more experimentation on my part, I found a solution. I= =E2=80=99ll document it here in case someone else finds it useful too.

What I did first (cul-de-sac, not working!)

I created a file named wrapmarkd= own.tex with this content:

\makeatletter
  \newcommand{\wrapmarkdown}[1]{#1}-
\makeatother

and included it as a parameter into= my Pandoc command: -H wrapmarkdown.tex.

Into my YAML block I put this modif= ication:



mainfontoptions:   \wrapmarkdown{BoldFont=3DWeidemannStd-Bold.otf, Ita=
licFont=3DWeidemannBookItalic.otf, BoldItalicFont=3DWeidemannStd-=
BoldItalic.otf, ItalicFeatures=3D{Colour=3DAA0001}, BoldFeatures=3D{Co=
lour=3D0000

This ended up with a LaTeX output c= ontaining this code around line 17:


    \setmainfont[\wrapmarkdown{BoldFont=3DWeidemannStd-Bold.otf,
       ItalicFont=3DWeidemannBookItalic.otf, BoldItalicFont=3DWeideman=
nStd-BoldItalic.otf,
       ItalicFeatures=3D{Colour=3DAA0001}, BoldFeatures=3D{Colour=3D00=
00AA},
       BoldItalicFeatures=3D{Colour=3DAA00AA}}]{WeidemannBook}

and this code around line 107:

\makeatletter
  \newcommand{\wrapmarkdown}[1]{#1}=20
\makeatother

When compiling this to PDF, an erro= r occurred:

! Undefined control sequence.
<argument> ...st ,\l__fontspec_fontopts_clist ,\wrapmarkdown
{BoldFont=3DWeidemannStd-Bol...

...

What I did next (final solution)

The error message made me move the = snippet from around line 107 to lines 2-4 of my generated LaTeX file. The o= utput PDF was created successfully after this modification.

Therefore I ditched the inclusion o= f my wrapmarkdown.tex file via the -H/--include-in-header command line parameter.

Instead I hard-coded the respective= lines into a custom LaTeX template, right after its initial lines, and add= ed --template=3Dmy-custom-latex-template.latex= into the command line.

Another question=E2=80=A6

I assume there is no way to make -H include a code snippet at a specific spot in the L= aTeX header? The problem with my original approach seems to have been that = on line 17 the call to the \wrapmarkdown newcommand= came before its definition on line 107=E2=80=A6 and that the only w= orkaround was the one I used: to hard-code it into the LaTeX-template at an= earlier line?

Would it be feasible to add a varia= ble-based approach into the default Pandoc template, which could be utilize= d from the command line for cases like this?

=E2=80= =8B

--
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/b9af327d-6e18-4625-b3de-dbf8702e4d6c%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_116_687894130.1461459444412-- ------=_Part_115_1755400212.1461459444412--