I've filed an issue here: https://github.com/jgm/pandoc/issues/4843
Example files and details to replicate the issue are included.
On Saturday, August 18, 2018 at 8:38:07 AM UTC+8, kronicd wrote:
>
> Yes,
>
> I understand what you're saying here. I will try to explain the issue that
> I'm coming up against better here.
>
> When I use the DIV form eg:
>
like/this
means things
>
> The style from the reference doc is used, however when I use the span form:
>
> like/this means things
>
> Pandoc will then define a new style, with a duplicate name, techfont does
> exist in the reference document. So in the reference document the following
> style exists and is retained when DIVs are used:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> However, when I use span elements in the source document, the following is
> added to the styles of the output document:
>
>
>
>
>
>
>
> So in the output document, the "Highlight" style exists multiples times
> when I use span tags rather than div tags, as a result the originally
> defined style in the reference document ends up being overridden.
>
> Is this a bug or intended behaviour?
>
> Cheers
>
> On Friday, August 17, 2018 at 5:44:12 PM UTC+8, BP Jonsson wrote:
>>
>> Well that is what `custom-style=NAME` does: it causes the docx writer to
>> define a new named style — a paragraph style for divs and an character
>> style for spans — and apply that style to the contents of the div or span.
>> Initially the definition of the style is no different from the default
>> paragraph or character style, unless an appropriate style of that name was
>> already defined in your reference-doc in which case that style is used. You
>> are supposed to open the docx file Pandoc created in your "word processor"
>> program (typically Word or LibreOffice) and use its facilities for creating
>> and modifying named styles to modify the newly created style to suit your
>> needs. The appearance of text tagged with that style will then change
>> accordingly. On subsequent Pandoc runs you can use the modified docx file
>> as your --reference-doc and get the modified style(s) applied automatically
>> to new docx files.
>>
>> Den fre 17 aug 2018 08:30kronicd skrev:
>>
>>> Thanks for that, I've now updated the input to:
>>>
>>> Testing testing
>>>
>>>
>>> asdasdasd this should be tech font idk
>>> asdasdasd
>>>
>>>
>>> should be for code block.
>>>
>>>
>>> like/this means things
>>>
>>>
>>> Testing testing
>>>
>>>
>>> The commandline remains
>>>
>>> cat test.md| pandoc --reference-doc='Client.docx' --output testabcd.docx
>>>
>>> and now my output shows as
>>>
>>> [image: Screen Shot 2018-08-17 at 2.22.49 pm.png]
>>>
>>> The output is quite interesting, on further examination it appears that
>>> a new style has been defined in the office xml, unpacking the docx and
>>> reviewing styles shows the following:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> >> >
>>>
>>>
>>>
>>>
>>>
>>> >> />
>>>
>>>
>>>
>>>
>>> ... snip ...
>>>
>>>
>>>
>>> *>> w:type="character"> >> w:val="BodyTextChar"/> *
>>>
>>> The portion in bold above shows new style information which was inserted
>>> in styles.xml, this was not present within the original reference document.
>>> Is this a bug or am I misusing a commandline param somewhere?
>>>
>>> On Friday, August 17, 2018 at 2:06:36 PM UTC+8, ousia wrote:
>>>>
>>>> On 08/17/2018 07:33 AM, kronicd wrote:
>>>> > Hi,
>>>> > [...]
>>>> > Is there a way to fix this so that the styles appear inline, rather
>>>> than
>>>> > adding an additional line break before and after?
>>>> Use spans (such as `[awa]{.class #id}` in Markdown syntax) instead of
>>>> divisions.
>>>>
>>>> Divisions are block elements, so they give you a line before and after.
>>>> Spans are for inline elements.
>>>>
>>>> I hope it helps,
>>>>
>>>> Pablo
>>>> --
>>>> http://www.ousia.tk
>>>>
>>> --
>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/pandoc-discuss/d838a232-83f3-46f2-b528-62d206e53fcc%40googlegroups.com
>>>
>>> .
>>> 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/82852739-6613-4fe1-a502-2445e1ebaf28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.