-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question: exporting word specific tags #2542
Comments
+++ Amin Meyghani [Nov 16 15 19:46 ]:
Currently, no. But in principle it should be possible to |
Awesome ! Any pointers on how to get that work ? Would it be something like this:
Thanks! |
I can implement it (it would be direct md -> docx). It's just a matter of +++ Amin Meyghani [Nov 16 15 20:13 ]:
|
As proposed by massifrg on pandoc-discuss, this issue could be extended to:
btw, do the styles really need to be defined in the reference word file or ICML template to trigger the rendering of those spans/divs as styles? Seems like a lot of work parsing those... Maybe a prefix like |
+++ Mauro Bieg [Dec 31 15 09:38 ]:
I want to avoid generating environments and commands that |
I have written several fairly simple filters, both bespoke and more general, which insert raw latex before and/or after spans or divs based on classes or custom attributes. (An example) Since that, as @jgm said, requires that the inserted commands/environments are or get defined somewhere it is probably better to leave that to filters so that the user is in full control, since they must include the necessary macro definitions at the same time. Too much 'automagic' with such things will be troublesome. |
I'm trying to pass the "style-..." classes to ICML with a filter that injects RawInlines into ICML. <span class="style-foo">custom style</span> becomes (pandoc --filter myfilter.pl -f markdown -t icml) <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/foo">
<Content>custom style</Content>
</CharacterStyleRange> I'm not following jgm's rule of not defining styles that are not present in the target document, because it's a custom filter for personal and exploratory purposes (for now). Anyway that was enough to stumble upon a problem: nested character styles. <span class="style-foo">custom <span class="style-bar">style</span></span> In HTML you can nest a <span> inside another <span>, multiple times. In ICML you can't nest a <CharacterStyleRange> inside another <CharacterStyleRange>. That is true for DOCX too, where you can't nest a <w:r> inside another <w:r>. In ODT you can nest a nest a <text:span> inside another <text:span>, but you won't be able to do it with AOO Writer or LO Writer. You can do it by editing the XML directly, and you obtain what you would expect: the styles merge when they are applied together. Perhaps when you reopen it in LO Writer one of the <text:span> would be considered the character style and the others would be transformed into local modifications. Before passing custom styles to target documents, there's a problem of "flattening" the character styles' depth to one level, and there's not a unique (and perhaps neither a good) way to do it. Anyway I'm trying to write that filter, because my documents are in HTML and passing styles to InDesign is a great feature. I'll let you know. That could be a contribution useful for a more general solution. |
I think that's right, I'll close this. |
@massifrg Would you like to share your filter? I would really appreciate it. |
To clarify:
Also I'm not clear there is any support for docx => ICML export of specific tags atm (or is there)? |
I think the issue tracking custom styles for more writer is #2106 |
Is it possible to export documents with cues for word styles ? For example, let's say in my reference
docx
file there is a style calledcool style
. Is there a way to add some cues in the markdown file so that when it is exported it gets the correct styles ? Something like:file.md
Thanks !
The text was updated successfully, but these errors were encountered: