public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* docx writer and localized style names
@ 2013-05-31 17:21 Till A. Heilmann
       [not found] ` <f071415e-424c-4f87-b473-9b7f864c7ba3-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Till A. Heilmann @ 2013-05-31 17:21 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

When I write a docx file with pandoc, some of the text elements in the 
resulting Word document show up with the localized names of the styles 
(because of my German Office), namely: 

- "Standard" (instead of "Normal"),
- "Titel" (instead of "Title") and 
- "Datum" (instead of "Date") 

Most other text elements' styles have the 'original' American-English 
names, though, for instance: 

- "Heading 1" … (instead of localized "Überschrift 1" …) 
- "Block Quote" (instead of localized "Blocktext") 
- "Footnote Reference" (instead of localized "Fußnotenzeichen") 

I'd prefer a consistent behavior here, preferably the localized style names 
(which would make it easier to adapt pandoc-generated Word files to 
pre-existing custom styles in personal templates). 

Now, I don't know about the pandoc writer modules, but in VBA you can refer 
to Word styles in two ways: Either you use a literal string to give the 
style's (localized) name, or you use the element of class WdBuiltinStyle. 
So, for example, you can say either 

ActiveDocument.Styles("Body Text") 

or 

ActiveDocument.Styles(wdStyleBodyText) 

The second option is the better one, since it works in all localized 
versions of Office. Can we do something similar in pandoc's docx writer 
module? 

Thanks, 
Till

-- 
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/f071415e-424c-4f87-b473-9b7f864c7ba3%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.



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

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

* Re: docx writer and localized style names
       [not found] ` <f071415e-424c-4f87-b473-9b7f864c7ba3-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2013-05-31 19:19   ` John MacFarlane
  2015-02-21 18:22   ` nkalvi
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: John MacFarlane @ 2013-05-31 19:19 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Pandoc doesn't do any localization, and it doesn't call any
MS libraries -- everything is done by hand with hard-coded (English)
style names.  So it must be Word that is changing the style names
after loading the file...

+++ Till A. Heilmann [May 31 13 10:21 ]:
>    When I write a docx file with pandoc, some of the text elements in the
>    resulting Word document show up with the localized names of the styles
>    (because of my German Office), namely:
>    - "Standard" (instead of "Normal"),
>    - "Titel" (instead of "Title") and
>    - "Datum" (instead of "Date")
>    Most other text elements' styles have the 'original' American-English
>    names, though, for instance:
>    - "Heading 1" (instead of localized "berschrift 1" )
>    - "Block Quote" (instead of localized "Blocktext")
>    - "Footnote Reference" (instead of localized "Funotenzeichen")
>    I'd prefer a consistent behavior here, preferably the localized style
>    names (which would make it easier to adapt pandoc-generated Word files
>    to pre-existing custom styles in personal templates).
>    Now, I don't know about the pandoc writer modules, but in VBA you can
>    refer to Word styles in two ways: Either you use a literal string to
>    give the style's (localized) name, or you use the element of class
>    WdBuiltinStyle. So, for example, you can say either
>    ActiveDocument.Styles("Body Text")
>    or
>    ActiveDocument.Styles(wdStyleBodyText)
>    The second option is the better one, since it works in all localized
>    versions of Office. Can we do something similar in pandoc's docx writer
>    module?
>    Thanks,
>    Till
> 
>    --
>    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
>    [1]https://groups.google.com/d/msgid/pandoc-discuss/f071415e-424c-4f87-
>    b473-9b7f864c7ba3%40googlegroups.com?hl=en-US.
>    For more options, visit [2]https://groups.google.com/groups/opt_out.
> 
> References
> 
>    1. https://groups.google.com/d/msgid/pandoc-discuss/f071415e-424c-4f87-b473-9b7f864c7ba3%40googlegroups.com?hl=en-US
>    2. https://groups.google.com/groups/opt_out


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

* Re: docx writer and localized style names
       [not found] ` <f071415e-424c-4f87-b473-9b7f864c7ba3-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2013-05-31 19:19   ` John MacFarlane
@ 2015-02-21 18:22   ` nkalvi
  2015-02-22  0:01   ` nkalvi
  2015-02-24  1:05   ` nkalvi
  3 siblings, 0 replies; 5+ messages in thread
From: nkalvi @ 2015-02-21 18:22 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

You may want to follow this:
https://github.com/jgm/pandoc/issues/1933#issuecomment-75368645


On Friday, May 31, 2013 at 1:21:24 PM UTC-4, Till A. Heilmann wrote:
>
> When I write a docx file with pandoc, some of the text elements in the 
> resulting Word document show up with the localized names of the styles 
> (because of my German Office), namely: 
>
> - "Standard" (instead of "Normal"),
> - "Titel" (instead of "Title") and 
> - "Datum" (instead of "Date") 
>
> Most other text elements' styles have the 'original' American-English 
> names, though, for instance: 
>
> - "Heading 1" … (instead of localized "Überschrift 1" …) 
> - "Block Quote" (instead of localized "Blocktext") 
> - "Footnote Reference" (instead of localized "Fußnotenzeichen") 
>
> I'd prefer a consistent behavior here, preferably the localized style 
> names (which would make it easier to adapt pandoc-generated Word files to 
> pre-existing custom styles in personal templates). 
>
> Now, I don't know about the pandoc writer modules, but in VBA you can 
> refer to Word styles in two ways: Either you use a literal string to give 
> the style's (localized) name, or you use the element of class 
> WdBuiltinStyle. So, for example, you can say either 
>
> ActiveDocument.Styles("Body Text") 
>
> or 
>
> ActiveDocument.Styles(wdStyleBodyText) 
>
> The second option is the better one, since it works in all localized 
> versions of Office. Can we do something similar in pandoc's docx writer 
> module? 
>
> Thanks, 
> Till
>

-- 
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/2fc2a9e4-593c-41a4-819d-eff97726b54e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: docx writer and localized style names
       [not found] ` <f071415e-424c-4f87-b473-9b7f864c7ba3-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2013-05-31 19:19   ` John MacFarlane
  2015-02-21 18:22   ` nkalvi
@ 2015-02-22  0:01   ` nkalvi
  2015-02-24  1:05   ` nkalvi
  3 siblings, 0 replies; 5+ messages in thread
From: nkalvi @ 2015-02-22  0:01 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

By the way, while a solution for Pandoc is being worked out, you may want 
to try this work-around:


   1. Save reference document (it needs to be output from Pandoc if you're 
   modifying Pandoc's own styles) as template.
   2. Apply this template (choosing to automatically apply styles) to the 
   one produced by Pandoc.

Unfortunately this does require that you have Word installed and invoked 
for each (pan)doc requiring customization. I'm not sure whether applying 
template can be automated.

On Friday, May 31, 2013 at 1:21:24 PM UTC-4, Till A. Heilmann wrote:
>
> When I write a docx file with pandoc, some of the text elements in the 
> resulting Word document show up with the localized names of the styles 
> (because of my German Office), namely: 
>
> - "Standard" (instead of "Normal"),
> - "Titel" (instead of "Title") and 
> - "Datum" (instead of "Date") 
>
> Most other text elements' styles have the 'original' American-English 
> names, though, for instance: 
>
> - "Heading 1" … (instead of localized "Überschrift 1" …) 
> - "Block Quote" (instead of localized "Blocktext") 
> - "Footnote Reference" (instead of localized "Fußnotenzeichen") 
>
> I'd prefer a consistent behavior here, preferably the localized style 
> names (which would make it easier to adapt pandoc-generated Word files to 
> pre-existing custom styles in personal templates). 
>
> Now, I don't know about the pandoc writer modules, but in VBA you can 
> refer to Word styles in two ways: Either you use a literal string to give 
> the style's (localized) name, or you use the element of class 
> WdBuiltinStyle. So, for example, you can say either 
>
> ActiveDocument.Styles("Body Text") 
>
> or 
>
> ActiveDocument.Styles(wdStyleBodyText) 
>
> The second option is the better one, since it works in all localized 
> versions of Office. Can we do something similar in pandoc's docx writer 
> module? 
>
> Thanks, 
> Till
>

-- 
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/b6f60b00-abc8-4427-ae06-c41b3003bb3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: docx writer and localized style names
       [not found] ` <f071415e-424c-4f87-b473-9b7f864c7ba3-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
                     ` (2 preceding siblings ...)
  2015-02-22  0:01   ` nkalvi
@ 2015-02-24  1:05   ` nkalvi
  3 siblings, 0 replies; 5+ messages in thread
From: nkalvi @ 2015-02-24  1:05 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

I've added a feature request here - please add your input if possible.

https://groups.google.com/forum/#!topic/pandoc-discuss/oLhedoPmMIs

-- 
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/7fe54114-936c-4f63-a7cf-b54d4499ebe4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

end of thread, other threads:[~2015-02-24  1:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-31 17:21 docx writer and localized style names Till A. Heilmann
     [not found] ` <f071415e-424c-4f87-b473-9b7f864c7ba3-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2013-05-31 19:19   ` John MacFarlane
2015-02-21 18:22   ` nkalvi
2015-02-22  0:01   ` nkalvi
2015-02-24  1:05   ` nkalvi

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