Hi Eelco,

I created a LUA-Filter that uses the Align-Classes and provides for docx the correct alignment. Maybe it helps for adjusting and using for odt.

Regards,
Günter



if FORMAT ~= "docx" then
  print("Only docx target -- not: ", FORMAT)
  print("... ending")
  return
end


function Image (img)

  align = 'left'
  for k, v in pairs(img.classes) do
    --print('-->', k, v)
    if v == 'center' then
      align = 'center'
    elseif v == 'right' then
      align = 'right'
    end
  end

  ret_img = {
  pandoc.RawInline('openxml', string.format('<w:pPr><w:jc w:val="%s"/></w:pPr>', align)),
  img

  }

  return ret_img
end


Eelco Vriezekolk schrieb am Dienstag, 7. Februar 2023 um 22:05:00 UTC+1:
Hmm, that's a disappointment. Please have my vote for addition of
styles-support in ODT. In my experience, the use of styles in
OpenDocument is superior to that in Miicrosoft Word.
But for now, I will make do with Word and docx.

Thanks for the clarification!

On 07/02/2023 17:53, John MacFarlane wrote:
> I don't think there's an easy way to do this in ODT. custom-style works for docx but not odt.
> You could probably use a filter that emits raw opendocument XML, but I don't have time to walk through that now.
>
>> On Feb 7, 2023, at 8:12 AM, Eelco Vriezekolk <ee...-GsmfYmMHemE@public.gmane.org> wrote:
>>
>> Hello,
>>
>> From Markdown I want to create a manual in various formats, including HTML and ODT (OpenDocument).
>> My manual contains images. Most are figures (in their own paragraph), but others should appear inside a paragraph, with text flowing around it. For HTML this works:
>>
>> <Screenshot 2023-02-07 at 17.07.25.png>
>>
>> The .float-class is defined in a CSS-stylesheet, and works fine:
>>
>>
>>
>> However, I cannot get this to work right in the ODT output. I define a 'float' graphics style in the reference file, but it is not being picked up in the ODT-output. No amount of experimenting and searching the web have helped so far.
>> I can get *all* figures to be right-aligned, but that is not what I want. I want to be able to indicate that some selected images appear inline.
>>
>> Can this be done? How?
>>
>>
>>
>> --
>> 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...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/d6ae917b-a037-4e03-a442-a050fdb7d368n%40googlegroups.com.
>> <Screenshot 2023-02-07 at 17.07.25.png>

--
Eelco Vriezekolk

--
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/2a798e1d-13d6-4a1d-a348-cda27ce363a4n%40googlegroups.com.