public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Setting bold font to semibold font in generated docx
@ 2022-01-19  4:59 Nandakumar Chandrasekhar
       [not found] ` <c041b5d2-b11f-409b-8f45-815263626111n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Nandakumar Chandrasekhar @ 2022-01-19  4:59 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1114 bytes --]

Dear Folks,

I am converting a markdown document to DOCX using a customized reference 
doc initially procured from Pandoc according to the documentation here.

I am able to set the bold font-weight to semibold for the title and heading 
fields.

However, I do not see. a way of setting all bolded text in paragraphs and 
bulleted lists to semibold.

It looks like I need to set the strong style to semibold to achieve this 
but Pandoc does not support styling that element as far as I can tell.

Are there any workarounds available are will this feature be supported in 
the future? 

I would prefer to not have to do any manual post-processing after Pandoc 
generates the document.

Thanks in advance.

-- 
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/c041b5d2-b11f-409b-8f45-815263626111n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1564 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting bold font to semibold font in generated docx
       [not found] ` <c041b5d2-b11f-409b-8f45-815263626111n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-01-19 18:17   ` BPJ
       [not found]     ` <CADAJKhAtEK5=yBm9U51O6jRsUJBVufaXr6nVPafMH+85Hao1gg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: BPJ @ 2022-01-19 18:17 UTC (permalink / raw)
  To: pandoc-discuss

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

AFAIK you can't change automatic styles but you can use a Lua filter to
replace Pandoc's Strong elements with Span elements with a custom named
style.

``````lua
function Strong (elem)
  return pandoc.Span(elem.content, { ['custom-style'] = 'Semibold' })
end
``````

Now define a named character style 'Semibold' in your reference doc and run
pandoc with that reference doc and this filter.

Den ons 19 jan. 2022 06:00Nandakumar Chandrasekhar <navanitachora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
skrev:

> Dear Folks,
>
> I am converting a markdown document to DOCX using a customized reference
> doc initially procured from Pandoc according to the documentation here.
>
> I am able to set the bold font-weight to semibold for the title and
> heading fields.
>
> However, I do not see. a way of setting all bolded text in paragraphs and
> bulleted lists to semibold.
>
> It looks like I need to set the strong style to semibold to achieve this
> but Pandoc does not support styling that element as far as I can tell.
>
> Are there any workarounds available are will this feature be supported in
> the future?
>
> I would prefer to not have to do any manual post-processing after Pandoc
> generates the document.
>
> Thanks in advance.
>
> --
> 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/c041b5d2-b11f-409b-8f45-815263626111n%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/c041b5d2-b11f-409b-8f45-815263626111n%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/CADAJKhAtEK5%3DyBm9U51O6jRsUJBVufaXr6nVPafMH%2B85Hao1gg%40mail.gmail.com.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting bold font to semibold font in generated docx
       [not found]     ` <CADAJKhAtEK5=yBm9U51O6jRsUJBVufaXr6nVPafMH+85Hao1gg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2022-01-20  3:23       ` Nandakumar Chandrasekhar
       [not found]         ` <CAMhuDe-oo_sh4V3gwqmAp3DwhdX4+pROyXt-sZJo_ciRivvbcw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Nandakumar Chandrasekhar @ 2022-01-20  3:23 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Thanks for the code snippet @BPJ.

I do not have too much experience building my own Pandoc filter but
definitely a way forward and a reason to learn Lua. :-)

Cheers.

On Wed, Jan 19, 2022 at 11:47 PM BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org> wrote:

> AFAIK you can't change automatic styles but you can use a Lua filter to
> replace Pandoc's Strong elements with Span elements with a custom named
> style.
>
> ``````lua
> function Strong (elem)
>   return pandoc.Span(elem.content, { ['custom-style'] = 'Semibold' })
> end
> ``````
>
> Now define a named character style 'Semibold' in your reference doc and
> run pandoc with that reference doc and this filter.
>
> Den ons 19 jan. 2022 06:00Nandakumar Chandrasekhar <
> navanitachora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>
>> Dear Folks,
>>
>> I am converting a markdown document to DOCX using a customized reference
>> doc initially procured from Pandoc according to the documentation here.
>>
>> I am able to set the bold font-weight to semibold for the title and
>> heading fields.
>>
>> However, I do not see. a way of setting all bolded text in paragraphs and
>> bulleted lists to semibold.
>>
>> It looks like I need to set the strong style to semibold to achieve this
>> but Pandoc does not support styling that element as far as I can tell.
>>
>> Are there any workarounds available are will this feature be supported in
>> the future?
>>
>> I would prefer to not have to do any manual post-processing after Pandoc
>> generates the document.
>>
>> Thanks in advance.
>>
>> --
>> 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/c041b5d2-b11f-409b-8f45-815263626111n%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/c041b5d2-b11f-409b-8f45-815263626111n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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/7fAcgbAgnXc/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CADAJKhAtEK5%3DyBm9U51O6jRsUJBVufaXr6nVPafMH%2B85Hao1gg%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAtEK5%3DyBm9U51O6jRsUJBVufaXr6nVPafMH%2B85Hao1gg%40mail.gmail.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/CAMhuDe-oo_sh4V3gwqmAp3DwhdX4%2BpROyXt-sZJo_ciRivvbcw%40mail.gmail.com.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting bold font to semibold font in generated docx
       [not found]         ` <CAMhuDe-oo_sh4V3gwqmAp3DwhdX4+pROyXt-sZJo_ciRivvbcw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2022-01-20  4:18           ` Nandakumar Chandrasekhar
  2022-01-20  6:36           ` BPJ
  1 sibling, 0 replies; 5+ messages in thread
From: Nandakumar Chandrasekhar @ 2022-01-20  4:18 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

@BPJ I tried out you code snippet as lua filter and it works!

Thank you so much.

Would it be possible to add this filter to the list of Pandoc filters and
what would be the process to contribute? I do intend to keep this evolving
while I learn Lua.

On Thu, Jan 20, 2022 at 8:53 AM Nandakumar Chandrasekhar <
navanitachora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Thanks for the code snippet @BPJ.
>
> I do not have too much experience building my own Pandoc filter but
> definitely a way forward and a reason to learn Lua. :-)
>
> Cheers.
>
> On Wed, Jan 19, 2022 at 11:47 PM BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org> wrote:
>
>> AFAIK you can't change automatic styles but you can use a Lua filter to
>> replace Pandoc's Strong elements with Span elements with a custom named
>> style.
>>
>> ``````lua
>> function Strong (elem)
>>   return pandoc.Span(elem.content, { ['custom-style'] = 'Semibold' })
>> end
>> ``````
>>
>> Now define a named character style 'Semibold' in your reference doc and
>> run pandoc with that reference doc and this filter.
>>
>> Den ons 19 jan. 2022 06:00Nandakumar Chandrasekhar <
>> navanitachora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>>
>>> Dear Folks,
>>>
>>> I am converting a markdown document to DOCX using a customized reference
>>> doc initially procured from Pandoc according to the documentation here.
>>>
>>> I am able to set the bold font-weight to semibold for the title and
>>> heading fields.
>>>
>>> However, I do not see. a way of setting all bolded text in paragraphs
>>> and bulleted lists to semibold.
>>>
>>> It looks like I need to set the strong style to semibold to achieve
>>> this but Pandoc does not support styling that element as far as I can tell.
>>>
>>> Are there any workarounds available are will this feature be supported
>>> in the future?
>>>
>>> I would prefer to not have to do any manual post-processing after Pandoc
>>> generates the document.
>>>
>>> Thanks in advance.
>>>
>>> --
>>> 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/c041b5d2-b11f-409b-8f45-815263626111n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/c041b5d2-b11f-409b-8f45-815263626111n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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/7fAcgbAgnXc/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/CADAJKhAtEK5%3DyBm9U51O6jRsUJBVufaXr6nVPafMH%2B85Hao1gg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAtEK5%3DyBm9U51O6jRsUJBVufaXr6nVPafMH%2B85Hao1gg%40mail.gmail.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/CAMhuDe_pKthL%3D%2BXH6FA9gBE_rFCRdMxE3tLDPUtcbjKRVtdU7g%40mail.gmail.com.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting bold font to semibold font in generated docx
       [not found]         ` <CAMhuDe-oo_sh4V3gwqmAp3DwhdX4+pROyXt-sZJo_ciRivvbcw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2022-01-20  4:18           ` Nandakumar Chandrasekhar
@ 2022-01-20  6:36           ` BPJ
  1 sibling, 0 replies; 5+ messages in thread
From: BPJ @ 2022-01-20  6:36 UTC (permalink / raw)
  To: pandoc-discuss

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

I hope it works with bold italics too. If not it might need quite some
adjustment, but I think that the automatic italics will mix with the named
semibold.

Den tors 20 jan. 2022 04:24Nandakumar Chandrasekhar <navanitachora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
skrev:

> Thanks for the code snippet @BPJ.
>
> I do not have too much experience building my own Pandoc filter but
> definitely a way forward and a reason to learn Lua. :-)
>
> Cheers.
>
> On Wed, Jan 19, 2022 at 11:47 PM BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org> wrote:
>
>> AFAIK you can't change automatic styles but you can use a Lua filter to
>> replace Pandoc's Strong elements with Span elements with a custom named
>> style.
>>
>> ``````lua
>> function Strong (elem)
>>   return pandoc.Span(elem.content, { ['custom-style'] = 'Semibold' })
>> end
>> ``````
>>
>> Now define a named character style 'Semibold' in your reference doc and
>> run pandoc with that reference doc and this filter.
>>
>> Den ons 19 jan. 2022 06:00Nandakumar Chandrasekhar <
>> navanitachora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>>
>>> Dear Folks,
>>>
>>> I am converting a markdown document to DOCX using a customized reference
>>> doc initially procured from Pandoc according to the documentation here.
>>>
>>> I am able to set the bold font-weight to semibold for the title and
>>> heading fields.
>>>
>>> However, I do not see. a way of setting all bolded text in paragraphs
>>> and bulleted lists to semibold.
>>>
>>> It looks like I need to set the strong style to semibold to achieve
>>> this but Pandoc does not support styling that element as far as I can tell.
>>>
>>> Are there any workarounds available are will this feature be supported
>>> in the future?
>>>
>>> I would prefer to not have to do any manual post-processing after Pandoc
>>> generates the document.
>>>
>>> Thanks in advance.
>>>
>>> --
>>> 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/c041b5d2-b11f-409b-8f45-815263626111n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/c041b5d2-b11f-409b-8f45-815263626111n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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/7fAcgbAgnXc/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/CADAJKhAtEK5%3DyBm9U51O6jRsUJBVufaXr6nVPafMH%2B85Hao1gg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAtEK5%3DyBm9U51O6jRsUJBVufaXr6nVPafMH%2B85Hao1gg%40mail.gmail.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/CAMhuDe-oo_sh4V3gwqmAp3DwhdX4%2BpROyXt-sZJo_ciRivvbcw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CAMhuDe-oo_sh4V3gwqmAp3DwhdX4%2BpROyXt-sZJo_ciRivvbcw%40mail.gmail.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/CADAJKhAzSk%2Bq8h41YTnFuSAhCkj4eNion3vK_nq65BwyiJuw4g%40mail.gmail.com.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-20  6:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19  4:59 Setting bold font to semibold font in generated docx Nandakumar Chandrasekhar
     [not found] ` <c041b5d2-b11f-409b-8f45-815263626111n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-01-19 18:17   ` BPJ
     [not found]     ` <CADAJKhAtEK5=yBm9U51O6jRsUJBVufaXr6nVPafMH+85Hao1gg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-01-20  3:23       ` Nandakumar Chandrasekhar
     [not found]         ` <CAMhuDe-oo_sh4V3gwqmAp3DwhdX4+pROyXt-sZJo_ciRivvbcw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-01-20  4:18           ` Nandakumar Chandrasekhar
2022-01-20  6:36           ` BPJ

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).