Hmmm...

Something isn't working.

This is my Input:

# Testing highlights

==highlight==

==highlight==

This is the text portion of the content.xml output:

<office:body>
<office:text>
<text:h text:style-name="Heading_20_1" text:outline-level="1"><text:bookmark-start text:name="testing-highlights" />Testing highlights<text:bookmark-end text:name="testing-highlights" /></text:h>
<text:p text:style-name="First_20_paragraph">highlight</text:p>
<text:p text:style-name="Text_20_body">highlight</text:p>
<text:p text:style-name="Text_20_body"></text:p>
</office:text>
</office:body>

I will need to dig in to understand what's (not) happening.

When I export with PDF it works. I use Typora which seems to have its own PDF export engine that recognizes the highlighting.

I have to install a complete LaTeX package to test the PDF output from a vanilla Pandoc export. For now, though, it looks like the LUA file isn't taken into consideration.

L

On Monday, November 14, 2022 at 2:50:13 AM UTC-5 Albert Krewinkel wrote:
Hi Laurent,

Laurent Duperval <ldup...@gmail.com> writes:

> I'm using the highlight.lua approach from here (https://
> gist.github.com/tarleb/a0646da1834318d4f71a780edaf9f870) and it works
> when exporting to PDF but not when exporting to ODT or DOCX. I'm not
> sure why. I would relly like a way to make this work reliably with
> ODT.

This depends on the pandoc writers for each format. As noted in my
original message, support for other formats requires more work.

The additional work to get support for ODT and docx is rather minimal
though: change lines 27-29 to

local function markup_inlines (inlines)
local attr = {class='mark', ['custom-style']='Highlighted'}
return pandoc.Span(inlines, attr)
end

The text can then be style via the 'Highlighted' character style.

--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/a6a7faa7-3c96-4661-a907-9ba357a41d04n%40googlegroups.com.