public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BP Jonsson <bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: How to improve .docx output?
Date: Thu, 22 Aug 2019 15:44:22 +0200	[thread overview]
Message-ID: <CAFC_yuTh-0ATckyTq1TsnkgD+FrPRGr+GxDjd1P6MezD8FQuXw@mail.gmail.com> (raw)
In-Reply-To: <32bb05e7-9d7b-47d8-8729-dd7b42281839-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 4948 bytes --]

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 — usually
Pandoc+LaTeX — produced PDF whenever I can, but for some reason some 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:

<https://help.libreoffice.org/Writer/Outline_Numbering_1>

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 <https://github.com/jgm/pandoc/issues/4697> 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-like-it-has-been-typeset-in-latex?rq=1
>

This answer has some links to actual templates:

<https://tex.stackexchange.com/a/8394/93534>

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-LibreOffice-(and-Word)
>

Den tors 22 aug. 2019 15:04K4zuki <k.yamamoto.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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-unnumberedheadings.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
> <https://groups.google.com/d/msgid/pandoc-discuss/32bb05e7-9d7b-47d8-8729-dd7b42281839%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAFC_yuTh-0ATckyTq1TsnkgD%2BFrPRGr%2BGxDjd1P6MezD8FQuXw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 7148 bytes --]

      parent reply	other threads:[~2019-08-22 13:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 12:24 'Nick Bart' via pandoc-discuss
2019-08-22 13:04 ` K4zuki
     [not found]   ` <32bb05e7-9d7b-47d8-8729-dd7b42281839-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-08-22 13:44     ` BP Jonsson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFC_yuTh-0ATckyTq1TsnkgD+FrPRGr+GxDjd1P6MezD8FQuXw@mail.gmail.com \
    --to=bpjonsson-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).