From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/22816 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Newsgroups: gmane.text.pandoc Subject: Re: docx writer: using styles from reference document Date: Mon, 27 May 2019 08:06:40 +0200 Message-ID: References: <0c37bc1d-ea10-4945-98a8-b169997ac437@googlegroups.com> <87v9ynr3wc.fsf@jhu.edu> <87y331f3jz.fsf@jhu.edu> <52a0ab63-6bb8-4d35-9736-c6a654fc5982@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c151470589d85a68" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="183481"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCHJFA6CVYERB7P4VXTQKGQEJASVWKQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon May 27 08:06:54 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-lj1-f184.google.com ([209.85.208.184]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hV8mc-000lat-BL for gtp-pandoc-discuss@m.gmane.org; Mon, 27 May 2019 08:06:54 +0200 Original-Received: by mail-lj1-f184.google.com with SMTP id h1sf3005462ljj.14 for ; Sun, 26 May 2019 23:06:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1558937213; cv=pass; d=google.com; s=arc-20160816; b=fyNrOMcw9pPVPty7aYvX/9r7H+AYqKUkpMvfx3ThUq8hcQJ+nA5UGGuXmGxiKuJ6UQ eWHvnHyC1yIkm1CvPwxciG4WTaatpGH1iMnaumory50PZLAzLHGMXbsxwksHbZd/aMKB 75WPOtcXl/7QPeVs7+xGY3cHGyzMlZY/dQRvHfz3t2nAWFtmMq6ynW52osQrDa50AXxv q90ffcoiIh3QuCpiCSEs1dOQfbfJERb7oAxGluEOP3QnIN8EIaw62+Cggt+IZJBqsvAc 1uX5yohCWQoLFaxOnv7qizPG5CGsTbQyDe4p6Niv0fBCarSvZrMA61d17Z4p5WMW5CPz Dm1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=o1Yuj+j/DEAMEzO1WTR2OhrP5o8yR4S0jQswmYkrdOc=; b=ejDJQpow1GkKfVqu+5RC1aGtmmPz4mo7+9DpH/eGP7yEyvfqSvzO/1g62DqFW0AbUk 4rLA3941T3SGe+tqL5f7IuhAU+zWCP2kVY/ko7TOxfE6jl4fhxfRQzelqD17RDM/pQMa IuLdyo1AbeCg7JLFs/E9Cu+4TdmLIwvx+OVu+gqNioXeEcR824pi5YtRR/bIrK3tVGB7 6nnFEKIWZm7ZLzi2YaiCUgimYkPOQRpFZYrMBhP6u/GttURkRKUHFBT+8dnM5NBErevX OGH0zSNnBOxvSXGy81mijqQVD3RZ74EFDRtJO4sMbGy6KY/fNSmtC7sOmtqx1pTvw4hO YVvQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ez87ynPS; spf=pass (google.com: domain of alan.mcl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::432 as permitted sender) smtp.mailfrom=alan.mcl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject:to:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=o1Yuj+j/DEAMEzO1WTR2OhrP5o8yR4S0jQswmYkrdOc=; b=I64IqmS91zGe1N7q0UnW7yTPH/ABpFijpfXnwGMy9kOF8EuskvUbXCZgPFCLhwM6Kz siuo+QU6rLKa5uqG0HvO9bkCZU9mg7ZG+2Gj2zttD4baOj3OVbgqbQiT/bk4INxRn/PB FdZnOG9MI5iPWXgLT7LHdUX8NR24+lkBx5bUuVMyH/XBuKi3jzOE6X4B7xfWFCy4x8L7 7CdBiqgHzZtwLNQCaeYijaWLeOgaIxzZHq0qFrih5MZbbhwSIM5L3M4wlOFHIgDo3cGP z9376hDE9GRBrn3Q9qKwd1r5ApATFICx3N5bG0v+Z2Kh8BeQs/hOwV8Q/F8jN7m+jgt4 p0Tg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=o1Yuj+j/DEAMEzO1WTR2OhrP5o8yR4S0jQswmYkrdOc=; b=K7mOWPFcXUfWjlRZ/xsGKyCX0iAaSHfZ6qdO561Ag2vW1fOZqtgzBfwyn78FmXGFGd c9+t1FHjsbPnY34qMVy0KZydfLuN//TZPk9FbV2IrpYhuyQJY5Pq2T01Gal8a1Vsdeip I7aPzS37jWJc39TBaEl8g9R0IQ0yrieGr2R2VGsVKpiNAh+OZkU+oz0uKlV5V2i3i061 zbGn9sJJf2HQhSCTY3qoMUshecUhs6LfUHlIR6uZqKmmJ5ODzEztLdj9ZGeqw9RIr33x OWSjFp/3ek9XMT5YUF83mGCRlMglCn9LNDQFJHsTVhkWSbyY42AvbCghjDibkH1b7OQE 1jug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=o1Yuj+j/DEAMEzO1WTR2OhrP5o8yR4S0jQswmYkrdOc=; b=RNGnneba81Y+lRQWpjKYlzPBrMDjKIv563+VUDeY/83+/N0A0DvS8l0Vx8Ck1XjKgX 7/FPb2dQdd1ZVxVDL36BNfD+/xUg5IZhnSKnULIJVcnVsT5kcjZ4T+cEDPJZH/X9haZW Wj9TEClzN65CHVSTvNAS4ixLfOD2wSaR+p8yyuCeDiE+WcW+vimDgKIfIbBfjMgvTeBG 5ar3uyBCbClHYsfLoF4VOWHSNhLcL9i+yTWZ2+a4dE957VyWHfiOuh58URmBqJQfPlgG Dd/RnkLYu9fK3AkXypmmbYNzeCUvkmKGqd0hKNZAy1chpvYLz1DG5xUoMETtIFdCaKKv dWsA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAVJH6mEopnu1U5xY9S3P8icdUlFniY0YdarN5QPV4eJtCHb7kNh 8EhID4FxbONNoOhgpDwVYaM= X-Google-Smtp-Source: APXvYqyNh/I5wVJ4CINw0vs13717z4AfwoznDktm16tSqJoQ2mDUEWGYsZqJtFO+0DXzgRtQCYxDIQ== X-Received: by 2002:ac2:4a78:: with SMTP id q24mr2460802lfp.59.1558937213830; Sun, 26 May 2019 23:06:53 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a19:294b:: with SMTP id p72ls1361235lfp.11.gmail; Sun, 26 May 2019 23:06:52 -0700 (PDT) X-Received: by 2002:a19:760e:: with SMTP id c14mr42730275lff.48.1558937212939; Sun, 26 May 2019 23:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558937212; cv=none; d=google.com; s=arc-20160816; b=dkZf3+GkrBM9FiYoGt8tVUhiQqcHevEtUj6ny6D5/IL+p/XU+rCecn1uoR+GRPTL9y AYCtNc7vCP08jUD0yns2DBPUvGHgbW+fdoDg1lFMJgMbtYTvxL55oCO51dN6zpgaOrVp YqzoGeBrtzeMSPa+6Zs5uPXn6w4AEaEzKJGDOg3RzTfhQ0nb3peYFwYxE0EweU8ujC9c GM6p89O0qVeptPkghk7+1SEW0YrFsCDc1a7S2LrpODxE44JBaErj3j7vSPNtruTSFPdX xJNt1VWdEiA6I2in1HV7rFJ1ycqieBP77JcCx9ZB3LfWVKKNMIolvYdTa8iK1bNzh0Vp 9edg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=mp21Q9hYa4reoRlVbRhfmVrrzO0VeVC49NH93d8zRfY=; b=H9g8hM9BJiw7JAyv9jsVWBDLuYkGzTKqfahkQBbd3tJJwkKKoPPMuhLJh27raOUwI/ ZbpG+zJbldhE2t8nPj3SqlxlNkCoWyNz+RRXu6vGA7k39lmT3wrEPk3ZiL4vtu1tViJJ TJuNX2n28X70F6UFV28lGwwEjxJZvTf8VT1GZFox6e/MN6kx2dMfEF0E6UWilzmmB2jY 8s09tIdjqLZNrnS59KQKLCu3ANOGRdAGT88n8V4g4tYTuP+blCRJ9QEmX+p8MaUVyZuF 9CpAZJ0cHd7cg+AmhVHecjQQ1Zs/UYHFQKjMLhItC7orFPGahbpxuJ0q9MEYI3BJ1KLX WEeQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ez87ynPS; spf=pass (google.com: domain of alan.mcl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::432 as permitted sender) smtp.mailfrom=alan.mcl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com. [2a00:1450:4864:20::432]) by gmr-mx.google.com with ESMTPS id o20si476876lji.2.2019.05.26.23.06.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 May 2019 23:06:52 -0700 (PDT) Received-SPF: pass (google.com: domain of alan.mcl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::432 as permitted sender) client-ip=2a00:1450:4864:20::432; Original-Received: by mail-wr1-x432.google.com with SMTP id d9so15607254wrx.0 for ; Sun, 26 May 2019 23:06:52 -0700 (PDT) X-Received: by 2002:adf:8307:: with SMTP id 7mr61658048wrd.86.1558937212111; Sun, 26 May 2019 23:06:52 -0700 (PDT) In-Reply-To: <52a0ab63-6bb8-4d35-9736-c6a654fc5982-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: alan.mcl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ez87ynPS; spf=pass (google.com: domain of alan.mcl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::432 as permitted sender) smtp.mailfrom=alan.mcl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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.org gmane.text.pandoc:22816 Archived-At: --000000000000c151470589d85a68 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Augustin, thanks for the input. It sounds like your corporate dotx template is a little more wacky than mine (except for the footer). I luckily have no page2 summary stuff to deal with, just a standard auto generated TOC. No special section formatting etc luckily. I did look at hand crafting an equivalent dotx, but in this case it does get a tweak every couple months and I'd like other teams to use the automation that I'm building. So a fairly seamless "just drop in the new template" is important. Since my last mail I've worked around a few more issues using the RawBlock approach that Jesse suggested. Page numbers in the footer are still not working, but that has more to do with the mad jumble of a footer in my source template. cheers Alan On Thu, May 23, 2019 at 2:49 PM Agust=C3=ADn Mart=C3=ADn wrote: > Hi Alan. > > I have gone through some of the issues you're experiencing. > > We also get an official "corporate" word template, which unfortunately ha= s > been designed by graphic designers and not Word power users. Thus the > template is difficult to work with, using many custom styles alternative = to > the standard ones like "This is my corporate title 3" (which is actually = a > level 2 title....), and suffering from bad choices like exact line spacin= g, > or hard-to-change default fonts, or messing up the navigation panel. > > Since we only get new templates every 1-2 years, what I do is I replicate > the look and feel of the template in a sensible way (using standard style > names, and taking advantage of what Word offers). If I get flack for doin= g > it, I can always create aliases to the standard styles with the "new" > names. In the end I start with a much better working template that uses > standard styles. > > I try to leave pagebreaks for level 1 titles (easy to define in the style= , > like you said). If I *really* need additional pagebreaks, I can always us= e > a lua filter with a specific code-word in my markdown, but that is usuall= y > an indication that something is not quite as "clean" as it should be. > > IMHO the hardest part to get is the second page of the document, if your > template has specific items there such as a table with metadata from the > document, etc. Especially if that has to come before the index. If you ca= n > get by having the index in the second page, you should be able to do most > of what you want anyway. > > Knowing that you can include document properties in your heading/footer > reference doc, makes it really easy to customize the first page (differen= t > from the rest) and the rest of the document with your title, department, > whatever-you-need. Pagenumbers definitely work! > > Another thing that is not easily doable is if your template has different > section formatting (like a last page without header/footer). I've only > successfully worked with one-section reference docs. > > Good luck and BR, > Agust=C3=ADn. > > > On Tuesday, May 21, 2019 at 4:26:26 PM UTC+2, Alan wrote: >> >> Thanks John, Jesse >> >> Yes, I meant page breaks. Sorry for not being clear. >> The raw openxml block approach works well, thanks for that. I need to >> mull over whether to support a replacement element in the source documen= t >> (eg the horiz line) or just do something like add page breaks before L1 >> headers, but either way it should be doable. >> >> Footers: my reference.docx has got a footer, but it contains two >> elements: an image and a page number. The page number text isn't making = it >> to the pandoc output, but the image is. I'm still tinkering with this to >> see if I figure out what's going wrong. >> >> regards >> Alan >> >> >> >> On Mon, May 20, 2019 at 7:17 PM Jesse Rosenthal wrote= : >> >>> John MacFarlane writes: >>> >>> > You should be able to insert page breaks using a lua >>> > filter, though. (You'd need to figure out exactly >>> > what openxml code to insert as raw openxml.) >>> >>> The openxml is: >>> >>> >>> >>> So you should be able to insert that as a RawBlock with format "openxml= ". >>> >>> >>> >>> -- > You received this message because you are subscribed to a topic in the > Google Groups "pandoc-discuss" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/pandoc-discuss/zzEvOYD3IR4/unsubscribe. > To unsubscribe from this group and all its topics, 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/52a0ab63-6bb8-4d35-9736-= c6a654fc5982%40googlegroups.com > > . > For more options, visit https://groups.google.com/d/optout. > --=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/CABQ_dt9jbn1avtHeq3cJpCe3fGbfAWTJFRdG5oukGPKxRcPr7Q%40mail.g= mail.com. For more options, visit https://groups.google.com/d/optout. --000000000000c151470589d85a68 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Augustin, thanks for the input.

It sounds like your corporate dotx template is a little more wacky t= han mine (except for the footer). I luckily have no page2 summary stuff to = deal with, just a standard auto generated TOC. No special section formattin= g etc luckily. I did look at hand crafting an equivalent dotx, but in this = case it does get a tweak every couple months and I'd like other teams t= o use the automation that I'm building. So a fairly seamless "just= drop in the new template" is important.

Sinc= e my last mail I've worked around a few more issues using the RawBlock = approach that Jesse suggested. Page numbers in the footer are still not wor= king, but that has more to do with the mad jumble of a footer in my source = template.

cheers
Alan


On Thu, May 23, 2019 at 2:49 PM Agust=C3=ADn Mart=C3=ADn <agusmba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi Alan.

I have gone through some of the issues you're experie= ncing.

We also get an official "corporate" wor= d template, which unfortunately has been designed by graphic designers and = not Word power users. Thus the template is difficult to work with, using ma= ny custom styles alternative to the standard ones like "This is my cor= porate title 3" (which is actually a level 2 title....), and suffering= from bad choices like exact line spacing, or hard-to-change default fonts,= or messing up the navigation panel.

Since we only= get new templates every 1-2 years, what I do is I replicate the look and f= eel of the template in a sensible way (using standard style names, and taki= ng advantage of what Word offers). If I get flack for doing it, I can alway= s create aliases to the standard styles with the "new" names. In = the end I start with a much better working template that uses standard styl= es.

I try to leave pagebreaks for level 1 titles (= easy to define in the style, like you said). If I *really* need additional = pagebreaks, I can always use a lua filter with a specific code-word in my m= arkdown, but that is usually an indication that something is not quite as &= quot;clean" as it should be.

IMHO the hardest= part to get is the second page of the document, if your template has speci= fic items there such as a table with metadata from the document, etc. Espec= ially if that has to come before the index. If you can get by having the in= dex in the second page, you should be able to do most of what you want anyw= ay.

Knowing that you can include document properti= es in your heading/footer reference doc, makes it really easy to customize = the first page (different from the rest) and the rest of the document with = your title, department, whatever-you-need. Pagenumbers definitely work!

Another thing that is not easily doable is if your te= mplate has different section formatting (like a last page without header/fo= oter). I've only successfully worked with one-section reference docs.

Good luck and BR,
=C2=A0 Agust=C3=ADn.


On Tuesday, May 21, 2019 at 4:26:26 PM UTC+2, Alan wrote:
Thank= s John, Jesse

Yes, I meant page breaks. Sorry for = not being clear.
The raw openxml block approach works well, thank= s for that. I need to mull over whether to support a replacement element in= the source document (eg the horiz line) or just do something like add page= breaks before L1 headers, but either way it should be doable.
Footers: my reference.docx has got a footer, but it contains t= wo elements: an image and a page number. The page number text isn't mak= ing it to the pandoc output, but the image is. I'm still tinkering with= this to see if I figure out what's going wrong.

regards
Alan



=
On Mon, May 20, 2019 at 7:17 PM= Jesse Rosenthal <jrose...-4GNroTWusrE@public.gmane.org> wrote:
John MacFarlane &l= t;j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> writes:

> You should be able to insert page breaks using a lua
> filter, though.=C2=A0 (You'd need to figure out exactly
> what openxml code to insert as raw openxml.)

The openxml is:

=C2=A0 =C2=A0 <w:p><w:r><w:br w:type=3D"page" />= ;</w:r></w:p>

So you should be able to insert that as a RawBlock with format "openxm= l".



--
You received this message because you are subscribed to a topic in the Goog= le Groups "pandoc-discuss" group.
To unsubscribe from this topic, visit https://g= roups.google.com/d/topic/pandoc-discuss/zzEvOYD3IR4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to p= andoc-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/52a0ab63-6bb8-4d35-9736-c6a654fc= 5982%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CABQ_dt9jbn1avtHeq3cJpCe3fGbfAWTJFRdG5ouk= GPKxRcPr7Q%40mail.gmail.com.
For more options, visit http= s://groups.google.com/d/optout.
--000000000000c151470589d85a68--