From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/22798 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Agust=C3=ADn_Mart=C3=ADn?= Newsgroups: gmane.text.pandoc Subject: Re: docx writer: using styles from reference document Date: Thu, 23 May 2019 05:49:49 -0700 (PDT) Message-ID: <52a0ab63-6bb8-4d35-9736-c6a654fc5982@googlegroups.com> References: <0c37bc1d-ea10-4945-98a8-b169997ac437@googlegroups.com> <87v9ynr3wc.fsf@jhu.edu> <87y331f3jz.fsf@jhu.edu> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_372_1745501125.1558615790019" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="69943"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDC7PRMFWYJBB35NTLTQKGQE3ZFKTVI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu May 23 14:49:54 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ot1-f63.google.com ([209.85.210.63]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hTnAP-000I3w-OJ for gtp-pandoc-discuss@m.gmane.org; Thu, 23 May 2019 14:49:54 +0200 Original-Received: by mail-ot1-f63.google.com with SMTP id w110sf2810208otb.10 for ; Thu, 23 May 2019 05:49:53 -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=tDJbXournTBK9DFC53LzpFevkUYNi9uOc+P9UpUuhUg=; b=nJaojvO7Zcp01zhrGCSB0E2g0uju18fpC/gWLHpEvKDqr4+47VM3IeGN7+haXxxml3 aIsXQL5HQXb7cUvjAQ+lsV+rYsitqy8zyc+Ww+uOD6Z7uhhxpuvQHq9Ja2xLofNSx8LC q4mgfNBE/dDLVkSyG5LC1Gj3EuQF76FUwQhHZ0+OXbsIX2+sStjzehOtCJLTwWH/4Cc6 vwFTNo4ROZgvpRtwqqnzZy8kr5Ay+nOENL5NseOuDW7/pZO0EMzNkvLBtet9m5w3JWT4 Rc2FzKoaxz2eILySrzsc8sHmI4Bep7WpLxQIySl9qWsYrkUL3NxgfAd0Hm12vl+XUPdU 77cg== 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=tDJbXournTBK9DFC53LzpFevkUYNi9uOc+P9UpUuhUg=; b=LCzu9AdLPI+fVoSpyvHMYg/mn/+6IOkt5i/8XGFHLl7ZKUXVgCXgJDJbmG2kJqL7VE NzNuaDGrjYeLOW8Fss1BAmIFBT6XMzcmsrQru7YO/JXt5KfoGd+IUai10YT8ssjE6Omu ZEBDfh6EzxVLFgZDAn5wGIyo1FBgZOYk0phATGTVjg6GwIkiuTNK6+43FFazcMmpf2Ao FA30Bn32ZoAIr48H7MVQoAFG6iXf6J5tt7BWj+yIEbk8qHFK6Ioy9poEfnfo9+RvDFbD DdocBZZ090nLpM2CFz+JGBhtrW9nzl6tQ0J9tYT3CPV29TIAlHwOC2ajBclXeygGHCV/ LEaw== 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=tDJbXournTBK9DFC53LzpFevkUYNi9uOc+P9UpUuhUg=; b=hTlOx5YkZMDkeZQw37f/Bcrt6wXGIl2u92K4HGTF5CzGhVl/BpEWHrIXLH8rJs6GHM crmAm1k8CTbZJvq9IEUqNJfJfYnltjxuS8rMcLN5+/CdX8vUpEoU9FROzzYgDjsmNGRX 9kiUzjgUWE/6PgPo5vRbve5iw4B+r5dqD/PBzR30dMOESyemz2wCcnoxwk3DhYufo6/Q ycwbGxVJX8ku134TD+gWHoHp6d1DGjg+DPs1erX07fdscxSqqx/ovAs4aNljZSZSU97t 9ziXswEZ/juT8x4/RPppd9a3JkwcXJEI5D6f+zf3pM7Lm5W5LLnFalIW5Y15JDshFFR/ jQuA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAVt2lbC30ae8zAe+/clcERCVEzgLDsva1PCxwaPnQO4e536piVE JHnOC8UA3lyZGfxF1PMeJxo= X-Google-Smtp-Source: APXvYqxTr3QWfw67H6Z7LLvwF7SZhbgslgTK0EG3PnBf2oExkc685/Q77v+xBj2vtyd+PzRLaGZwPA== X-Received: by 2002:a9d:7f83:: with SMTP id t3mr11348502otp.299.1558615792309; Thu, 23 May 2019 05:49:52 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6830:14f:: with SMTP id j15ls1107711otp.9.gmail; Thu, 23 May 2019 05:49:51 -0700 (PDT) X-Received: by 2002:a9d:6f97:: with SMTP id h23mr9031751otq.60.1558615790616; Thu, 23 May 2019 05:49:50 -0700 (PDT) In-Reply-To: X-Original-Sender: agusmba-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.org gmane.text.pandoc:22798 Archived-At: ------=_Part_372_1745501125.1558615790019 Content-Type: multipart/alternative; boundary="----=_Part_373_1180195784.1558615790019" ------=_Part_373_1180195784.1558615790019 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Alan. I have gone through some of the issues you're experiencing. We also get an official "corporate" word template, which unfortunately has= =20 been designed by graphic designers and not Word power users. Thus the=20 template is difficult to work with, using many custom styles alternative to= =20 the standard ones like "This is my corporate title 3" (which is actually a= =20 level 2 title....), and suffering from bad choices like exact line spacing,= =20 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= =20 the look and feel of the template in a sensible way (using standard style= =20 names, and taking advantage of what Word offers). If I get flack for doing= =20 it, I can always create aliases to the standard styles with the "new"=20 names. In the end I start with a much better working template that uses=20 standard styles. I try to leave pagebreaks for level 1 titles (easy to define in the style,= =20 like you said). If I *really* need additional pagebreaks, I can always use= =20 a lua filter with a specific code-word in my markdown, but that is usually= =20 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=20 template has specific items there such as a table with metadata from the=20 document, etc. Especially if that has to come before the index. If you can= =20 get by having the index in the second page, you should be able to do most= =20 of what you want anyway. Knowing that you can include document properties in your heading/footer=20 reference doc, makes it really easy to customize the first page (different= =20 from the rest) and the rest of the document with your title, department,=20 whatever-you-need. Pagenumbers definitely work! Another thing that is not easily doable is if your template has different= =20 section formatting (like a last page without header/footer). I've only=20 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 mul= l=20 > over whether to support a replacement element in the source document (eg= =20 > the horiz line) or just do something like add page breaks before L1=20 > headers, but either way it should be doable. > > Footers: my reference.docx has got a footer, but it contains two elements= :=20 > an image and a page number. The page number text isn't making it to the= =20 > pandoc output, but the image is. I'm still tinkering with this to see if = I=20 > 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"= . >> >> >> >> --=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/52a0ab63-6bb8-4d35-9736-c6a654fc5982%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_373_1180195784.1558615790019 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Alan.

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

We also get an o= fficial "corporate" word template, which unfortunately has been d= esigned by graphic designers and not Word power users. Thus the template is= difficult to work with, using many custom styles alternative to the standa= rd ones like "This is my corporate 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 feel of the template in a sensible way (usi= ng standard style names, and taking advantage of what Word offers). If I ge= t flack for doing it, I can always create aliases to the standard styles wi= th the "new" names. In the end I start with a much better working= template that uses standard styles.

I try to leav= e 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 markdown, but that is usually 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 doc= ument, if your template has specific items there such as a table with metad= ata from the document, etc. Especially if that has to come before the index= . If you can 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, m= akes it really easy to customize the first page (different from the rest) a= nd the rest of the document with your title, department, whatever-you-need.= Pagenumbers definitely work!

Another thing that i= s not easily doable is if your template has different section formatting (l= ike a last page without header/footer). I've only successfully worked w= ith one-section reference docs.

Good luck and BR,<= /div>
=C2=A0 Agust=C3=ADn.


On Tuesday, May 21, 2019 a= t 4:26:26 PM UTC+2, Alan wrote:
Thanks John, Jesse

Yes, I m= eant page breaks. Sorry for not being clear.
The raw openxml bloc= k approach works well, thanks for that. I need to mull over whether to supp= ort a replacement element in the source document (eg the horiz line) or jus= t do something like add page breaks before L1 headers, but either way it sh= ould be doable.

Footers: my reference.docx has got= a footer, but it contains two elements: an image and a page number. The pa= ge 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 w= rong.

regards
Alan



On = Mon, May 20, 2019 at 7:17 PM Jesse Rosenthal <jrose...-4GNroTWusrE@public.gmane.org> wrote:=
John MacFarlane= <= 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 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/52a0ab63-6bb8-4d35-9736-c6a654fc5982%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_373_1180195784.1558615790019-- ------=_Part_372_1745501125.1558615790019--