From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23292 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: BP Jonsson Newsgroups: gmane.text.pandoc Subject: Re: How to improve .docx output? Date: Thu, 22 Aug 2019 15:44:22 +0200 Message-ID: References: <32bb05e7-9d7b-47d8-8729-dd7b42281839@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ca3d100590b4e3aa" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="221635"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDIY76M674FRBQ5Y7LVAKGQEVZRTFUA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Aug 22 15:44:38 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-yw1-f64.google.com ([209.85.161.64]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1i0nOH-000vXH-Hn for gtp-pandoc-discuss@m.gmane.org; Thu, 22 Aug 2019 15:44:37 +0200 Original-Received: by mail-yw1-f64.google.com with SMTP id z7sf4005526ywc.4 for ; Thu, 22 Aug 2019 06:44:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1566481476; cv=pass; d=google.com; s=arc-20160816; b=hhRVjojvYNeeelfv9DzlhAmw6cCrEMwqxkqIIdp06K+Litvk/Xpbi81bZ93xm0rPvu L/n4OMlbDgSJe0nM37TkqI8gNXG/15/kXjjTDvCCiUDhoPy0t+RTjz+rhVfPBXYvaGGl boV1/1L8qenJpGj5nD6cbK+8IZgBnvn5Gt/+QNG4H0vmokGDzKq9lB7Fdpc9DWy3sulS mqs0e5gwwbZeRsGpdfdjnQA2Zur6BVZeBkAlt0luwFX9Gt/C672R6kHBbpGJpJ+8/mwv pBwA1sJTcAzz16YIOTqE6KpYsTc0N3wZN9dVnI53WtU7X3S1Kl8n5D+MyIrZ76jX657J eXSA== 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=5xYOA0IAekLPP320dqOeICmRmax5DLVENC79YZ83wEg=; b=obU0lhpuGyIB6FKf0FcyLpQIs/bCJE3Ai1U2TIIt6XLjaK8HmdAC4lUjKKFjxxj148 fxeIs26vXMYezQsQtYGe6gixg117YnZLdx3NomC8appb+bqXayFILERmW+K5JA1KVgrJ 1JVg270tcrcxXSKGlx5d6gAJ+u/gbDkA6xmA+gNRzijbfZBRguQrc83DslWiVBVWrHF8 qDTrch9JiYIDQvDtE5E3hzF2Bro//mx296hUGvUIG03HBNDvrzzqGWK1NNrUtrLiYFOR ZG1VKFhwsNBVcnpugfgQnlKxAC0qAcMLP3bPzJZ1hlzFFCJQ68xW4Pa0SlNEGO8HCl7+ mnpw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=to1a5TGe; spf=pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::535 as permitted sender) smtp.mailfrom=bpjonsson-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=5xYOA0IAekLPP320dqOeICmRmax5DLVENC79YZ83wEg=; b=nRW/qpsqKzCBbURRKYaW5Dcgf3nIDqObr9VgPosxnH1Ot/X39iXQiQwSeSmTN2noSk O29lMNIXtnUdy/DJ4YNDRdEbkUGaWlFfJOYr7emRiSjve/lf0dU/uVgPblR3Yj/gE6p5 2wH0pExoxXMTGQ+ZeSsMMSGQpXUmkw+JbSjmGkpvAuzNkLneM7VDb4COhcSabbKJ1gIz dmH+EI2YI6cF0xCCR8W4GzI0nUnJPbR/wrQwbHExc/0OWa5EToX1hs8x/xWFUBdAio3f tgFKx6ZwJEDpAqjfQNt+xMwaOTnBl0FglsPAx8HCgaJ9RTbYVxNT9r8ysnQuQkt/keJD 4uDA== 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=5xYOA0IAekLPP320dqOeICmRmax5DLVENC79YZ83wEg=; b=KkxCZ9IL+sWAYnBkdbFD2+88FCgtqfIJIl2QDLt0IajL1/uIdgJ+G3p4M9UJsEdaif I8LK0vgSzDPOYlgQ33jlPoU0SY8EuK4XowPHodzoBRE7dOGPF/JcLuFz/mbv65e+VW2I QN2S4M0onAGP8HMTVPjJJ4VZAqUDDk2baY9DKfE8RIBC8RK2AWWus2eg6jFZvCTqF1Km UqU++xNOH8ugzqHkWBQW+t8VLH/mf82Eg45qzeRT8zZdrSy9bdZW/EL2n61dgtv1A43s X9ZokiBnPNKm7aUdBD7p+IByr2KYkkdF5yj1XMjptxmzvGaBnXjvvCJio4HTrFyUjquN neOA== 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=5xYOA0IAekLPP320dqOeICmRmax5DLVENC79YZ83wEg=; b=eLOHzJs1LGnZfEF56/V3KuOZRUSCsQV9lR1ioALBXsIn0q4SjoLg4WJLBojPg7ZAA2 OuO1ID6ey050ECa5yl3PCtftrKd7fEvU4ZEFbG/iJfZTUkvPmzdVMMajsWwXswh0CnDp YHDcq8xkHbLLBdRUvJIVGKIYVi9AHncXAEkxx+oYG15paY915cCM/4zEW/8uLWZ95Id+ 6xwA5goSPU+jpKwc/R+q9vxCocAWNXIMjEMSxRvGrZN1ALCabMFnnVWCDyviZBQG1vhL /koUoGC4bzjFLSSWxDv2Eh0kjO3oSMrCDlmD0TrWRxnIx6s9ZB5j2sIcZNGAvwLKvn1G cDHA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAXJyv/H9asHGWCp0E91G8SMnSnx7XEC95DD9RJTT6PDLH2cx1hF 7WVDdKmobrZDagb1fjKo4CE= X-Google-Smtp-Source: APXvYqwmKgQRuCZ4+id0ui+u8hgsfmH9rDI9rjEIUZxQEh0UNJrgM34sPoNJroBMfFQqXtOzXa7Icw== X-Received: by 2002:a81:4987:: with SMTP id w129mr29157919ywa.5.1566481475949; Thu, 22 Aug 2019 06:44:35 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a81:2456:: with SMTP id k83ls1412087ywk.0.gmail; Thu, 22 Aug 2019 06:44:35 -0700 (PDT) X-Received: by 2002:a81:3313:: with SMTP id z19mr27970355ywz.188.1566481474965; Thu, 22 Aug 2019 06:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566481474; cv=none; d=google.com; s=arc-20160816; b=0tZknB8q2aDR0X6uQceC+Mvu2UKGhXZW8rfVm+6QvjNHBjsYohvH4RNuUxufTmKmD1 WZC4LaGcjcGyNIJrENddCjzl4nZ3XLdrcFgUgoUFeZkI0Jz8r3j1iisGvPkbuVJD9oWa 6iayldNVVtmVC40lfFdkX2HPTCm+wP725hKhfDhhT1RbRUJJjrYqhL4rDUTMCe4t3A9D PAcArA8QtQJ2y7uVkB0sQ8+nK0487DBjvgMk4+TR58SckRBpfh+mPaIeYV3lVMsTIGvl 5YmNzhwUKYscH12yi+o0j5EiZyicI9AqcCGYVQ80W1IAhD+e3bmGxAEaOM+MOICnU67d +/cw== 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=ZzGgUEbTPujMsjJ1+c0V9R8RuWAaL9tPpdJrJRVRgM4=; b=tKo4Jmgmd5e9JTEHsy2vERimUkT+IDpj3iLPVA44Gwfo7jqSR2imOUzSTrfCniHYTl ibojKYM+KY1NrGC9T3l/bee8t1EivdMmuLZ0oeElss7p0eE7Z17M+WGFXzPlFQz9azSg UG1yF4cs29DXSQPf2sMSkLn7tl7A2ZJGu3q5ofIS3rnApbT/L5parH9YVoiIVjRkOlIs /zJuOPq4oLoaRv/XTesC9Eg2v6+Qx9TasPqSawEBAFMg+CTIxBJhxTxEt1dUUMEeHm0a sduVZiS4WTHnRhjOAqYit6qx9AljehxoUTxIJnuqSO3LY4j6GKTgmxAVDHSpxe8vr366 3GEA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=to1a5TGe; spf=pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::535 as permitted sender) smtp.mailfrom=bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com. [2607:f8b0:4864:20::535]) by gmr-mx.google.com with ESMTPS id r134si1584144ybc.4.2019.08.22.06.44.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Aug 2019 06:44:34 -0700 (PDT) Received-SPF: pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::535 as permitted sender) client-ip=2607:f8b0:4864:20::535; Original-Received: by mail-pg1-x535.google.com with SMTP id k3so3692995pgb.10 for ; Thu, 22 Aug 2019 06:44:34 -0700 (PDT) X-Received: by 2002:a65:64c5:: with SMTP id t5mr34882621pgv.168.1566481473746; Thu, 22 Aug 2019 06:44:33 -0700 (PDT) In-Reply-To: <32bb05e7-9d7b-47d8-8729-dd7b42281839-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=to1a5TGe; spf=pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::535 as permitted sender) smtp.mailfrom=bpjonsson-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:23292 Archived-At: --000000000000ca3d100590b4e3aa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm AFK (on my phone) ATM so that I can't check the things I talk about below, but hopefully they should be helpful. Like you I use LibreOffice rather than Word. I'm exclusively on Linux these days so I couldn't use Word even if I wanted to, since I couldn't afford neither Mac, Windows or Office even if I wanted to. I use LaTeX =E2=80=94 u= sually Pandoc+LaTeX =E2=80=94 produced PDF whenever I can, but for some reason som= e people want me to send them DOCX files! ;-) I think that the section numbering issue can be fixed, and IIRC I have done so in the past: As for the toc and references headings getting numbered that should be possible to fix, although perhaps in the output document rather than in the reference document. Hopefully it will become possible to use a `custom-style` attribute with headings. See the discussion at for several issues regarding custom-style for different kinds of content. It doesn't seem like headings have been on the table yet. Perhaps it should be worthwhile to create a meta-issue (is that a thing?) listing the various things which can have named styles attached to them where the corresponding Pandoc element either takes attributes itself or can be meaningfully wrapped in a Div or Span. (Page styles would probably be out!) As for default fonts it's hard to find any which everyone can be expected to have across various Linux distros, Mac and Windows, so sticking to the DOCX defaults may be the best thing to do ATM. For example fonts called "Times" and "Helvetica" may or may not exist on a given system, or they may be 256-character Type1 fonts with different charsets depending on the OS rather than Unicode OpenType fonts. It's pretty easy to change in a reference DOCX, but perhaps it could be made easier e.g. by having all headings inherit their font from the same style, if they don't already. It should be worthwhile to go through the custom styles defined in a DOCX produced by Pandoc and inspect where the various styles inherit from, or make them inherit from where you want them to and use that as your master reference DOCX so that you easily can make global changes in the future. As for a more LaTeX like appearance some of the answers to this SX question seem useful: < https://tex.stackexchange.com/questions/8308/make-ms-word-document-look-lik= e-it-has-been-typeset-in-latex?rq=3D1 > This answer has some links to actual templates: One problem with making Pandoc's default DOCX more like anything other than the Word defaults is that presumably most people producing DOCX with Pandoc do so because someone higher up the food chain expects to get DOCX files rather than PDF or whatever, and if they don't provide their own templates chances are they want the Word defaults, sadly. This page on the GitHub wiki (originally written by me) may also be helpful= : < https://github.com/jgm/pandoc/wiki/Defining-custom-DOCX-styles-in-LibreOffi= ce-(and-Word) > Den tors 22 aug. 2019 15:04K4zuki skrev: > Hello, > > I have also been working for docx output. > > [...] > - With a custom-reference.docx modified to number section headings, > `# References {-}` came out numbered, too; i.e., `{-}` was ignored. > (A proper fix would probably require pandoc to attach a docx style > like "Heading (unnumbered) 1" to such headings.) > [...] > > This Lua filter might help you: > > https://github.com/pandocker/pandocker-lua-filters/blob/master/lua/docx-u= nnumberedheadings.lua > > Your guess is correct; you have to prepare unnumbered custom heading > styles(up to 4th level) in your reference.docx, > also need to point them in YAML frontmatter (or dedicated extra YAML file= ). > > -- > 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/32bb05e7-9d7b-47d8-8729-= dd7b42281839%40googlegroups.com > > . > --=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 view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CAFC_yuTh-0ATckyTq1TsnkgD%2BFrPRGr%2BGxDjd1P6MezD8FQuXw%40ma= il.gmail.com. --000000000000ca3d100590b4e3aa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm AFK (on my phone) ATM so that I= can't check the things I talk about below, but hopefully they should b= e helpful.

Like you I us= e LibreOffice rather than Word. I'm exclusively on Linux these days so = I couldn't use Word even if I wanted to, since I couldn't afford ne= ither Mac, Windows or Office even if I wanted to. I use LaTeX =E2=80=94 usu= ally Pandoc+LaTeX =E2=80=94 produced PDF whenever I can, but for some reaso= n some people want me to send them DOCX files! ;-)
<= br>
I think that the section numbering issue can be = fixed, and IIRC I have done so in the past:



See the discussio= n at <https://gith= ub.com/jgm/pandoc/issues/4697> for several issues regarding custom-s= tyle for different kinds of content. It doesn't seem like headings have= been on the table yet. Perhaps it should be worthwhile to create a meta-is= sue (is that a thing?) listing the various things which can have named styl= es attached to them where the corresponding Pandoc element either takes att= ributes itself or can be meaningfully wrapped in a Div or Span. (Page style= s would probably be out!)

As for default fonts it's hard to find any which everyone can be expe= cted to have across various Linux distros, Mac and Windows, so sticking to = the DOCX defaults may be the best thing to do ATM. For example fonts called= "Times" and "Helvetica" may or may not exist on a give= n system, or they may be 256-character Type1 fonts with different charsets = depending on the OS rather than Unicode OpenType fonts. It's pretty eas= y to change in a reference DOCX, but perhaps it could be made easier e.g. b= y having all headings inherit their font from the same style, if they don&#= 39;t already.

It should = be worthwhile to go through the custom styles defined in a DOCX produced by= Pandoc and inspect where the various styles inherit from, or make them inh= erit from where you want them to and use that as your master reference DOCX= so that you easily can make global changes in the future.

As for a more LaTeX like appearance some= of the answers to this SX question seem useful:
=
This answer has some links to actual templates:=


One problem = with making Pandoc's default DOCX more like anything other than the Wor= d defaults is that presumably most people producing DOCX with Pandoc do so = because someone higher up the food chain expects to get DOCX files rather t= han PDF or whatever, and if they don't provide their own templates chan= ces are they want the Word defaults, sadly.

This page on the GitHub wiki (originally written by me)= may also be helpful:


Den tors 22 aug. 201= 9 15:04K4zuki <k.yamamo= to.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
Hello,

I have also been working for d= ocx output.

[...]
-=C2=A0 =C2=A0With a cus= tom-reference.docx modified to number section headings,=C2=A0
=C2= =A0 =C2=A0 `# References {-}` came out numbered, too; i.e., `{-}` was ignor= ed.=C2=A0
=C2=A0 =C2=A0 (A proper fix would probably require pand= oc to attach a docx style=C2=A0
=C2=A0 =C2=A0 like "Heading = (unnumbered) 1" to such headings.)=C2=A0
[...]
This Lua filter might help you:

Your guess is correct; you have to prepare unnumb= ered custom heading styles(up to 4th level) in your reference.docx,=C2=A0
also need to point them in YAML frontmatter (or dedicated extra YA= ML file).

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/32bb05e7-9d7b= -47d8-8729-dd7b42281839%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://gro= ups.google.com/d/msgid/pandoc-discuss/CAFC_yuTh-0ATckyTq1TsnkgD%2BFrPRGr%2B= GxDjd1P6MezD8FQuXw%40mail.gmail.com.
--000000000000ca3d100590b4e3aa--