public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Alan <alan.mcl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: docx writer: using styles from reference document
Date: Mon, 27 May 2019 08:06:40 +0200	[thread overview]
Message-ID: <CABQ_dt9jbn1avtHeq3cJpCe3fGbfAWTJFRdG5oukGPKxRcPr7Q@mail.gmail.com> (raw)
In-Reply-To: <52a0ab63-6bb8-4d35-9736-c6a654fc5982-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

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

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ín Martín <agusmba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Hi Alan.
>
> I have gone through some of the issues you're experiencing.
>
> We also get an official "corporate" word template, which unfortunately has
> 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 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 (using standard style
> names, and taking advantage of what Word offers). If I get flack for doing
> 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 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 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 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, 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 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ín.
>
>
> 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 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 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 <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.  (You'd need to figure out exactly
>>> > what openxml code to insert as raw openxml.)
>>>
>>> The openxml is:
>>>
>>>     <w:p><w:r><w:br w:type="page" /></w:r></w:p>
>>>
>>> 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
> <https://groups.google.com/d/msgid/pandoc-discuss/52a0ab63-6bb8-4d35-9736-c6a654fc5982%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 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.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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

  parent reply	other threads:[~2019-05-27  6:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-06 15:15 Alan McLachlan
     [not found] ` <0c37bc1d-ea10-4945-98a8-b169997ac437-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-05-06 15:36   ` Jesse Rosenthal
     [not found]     ` <87v9ynr3wc.fsf-4GNroTWusrE@public.gmane.org>
2019-05-06 15:41       ` Alan
     [not found]         ` <CABQ_dt8PD7jtvWt-8w92nLqK-hiusUVxR=P-JfnYEJembQ2XPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-05-10 14:29           ` Alan
     [not found]             ` <CABQ_dt9Ee-2dtNgPm7D_jJxhReAzk1Gg2tjVvn2Jah96jSif4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-05-20 13:06               ` Alan
     [not found]                 ` <CABQ_dt_VkYEL5ED8i8Wo7GUeNA-Kgwyzjpzw2V=vdWYt1+kCLg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-05-20 13:09                   ` Brandon Keith Biggs
     [not found]                     ` <CAKAWQkXpaypSpUU62p=Fr_bhyLhLuAKMQ18MOy2TzTu6LmV3jg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-05-20 13:40                       ` Alan
2019-05-20 16:40                   ` John MacFarlane
     [not found]                     ` <yh480ksgt95bb0.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-05-20 17:17                       ` Jesse Rosenthal
     [not found]                         ` <87y331f3jz.fsf-4GNroTWusrE@public.gmane.org>
2019-05-21 14:26                           ` Alan
     [not found]                             ` <CABQ_dt-d1KyE2U4_Hgfbx4=2tMtUaHO-5SfrnqJs8HLFEtTG4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-05-23 12:49                               ` Agustín Martín
     [not found]                                 ` <52a0ab63-6bb8-4d35-9736-c6a654fc5982-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-05-27  6:06                                   ` Alan [this message]
     [not found]                                     ` <CABQ_dt9jbn1avtHeq3cJpCe3fGbfAWTJFRdG5oukGPKxRcPr7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-06-16 18:55                                       ` Neil Piper

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=CABQ_dt9jbn1avtHeq3cJpCe3fGbfAWTJFRdG5oukGPKxRcPr7Q@mail.gmail.com \
    --to=alan.mcl-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).