public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* How to add a (visible) image caption in DOCX for pandoc transformations?
@ 2020-08-13 20:09 Philipp Zumstein
       [not found] ` <601f7c12-1b83-43df-97ca-4288126ac4e4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Philipp Zumstein @ 2020-08-13 20:09 UTC (permalink / raw)
  To: pandoc-discuss


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

I would like to create some DOCX document which will then translate to 
Markdown containing an image with its caption (in the square bracket), i.e. 
the result after the pandoc transformation DOCX -> MD should look something 
like this

![Abb. 1: title](ip-logo.png){ #image1 }

I tried to add the caption "Abb. 1: title" in Word on a newline after the 
image and choosed the style "Image Caption", but that did not work. Also if 
I use the Word functionality to add a caption to the image, that was again 
only parsed as an additional line of text. The only thing which works is to 
format the image in Word and add some alternative (hidden) text.

Is there a more visible way to achieve the above markdown line from a word 
document? How should I use the styles "Image Caption" or "Captioned Image" 
in Word correctly such that pandoc will do something with them? Is it 
normal that I don't see these styles in the native ATX output?

I am using a German version of Word on a windows machine with pandoc 
version 2.10.1.

Thank you very much for any hint!
Philipp

-- 
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/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
       [not found] ` <601f7c12-1b83-43df-97ca-4288126ac4e4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2020-08-13 20:22   ` Leonard Rosenthol
       [not found]     ` <CALu=v3Jic+xJzRqZqKc68bgq9+hJu4ggT8QVYywREoNjxJJ9Tw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2020-08-13 20:23   ` Denis Maier
  1 sibling, 1 reply; 13+ messages in thread
From: Leonard Rosenthol @ 2020-08-13 20:22 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

AFAICT from a quick read of the DocX Reader - if you set the caption in
w/ord using its "Insert Caption" choice, that will come over into the
Markdown.

Leonard

On Thu, Aug 13, 2020 at 4:09 PM Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> I would like to create some DOCX document which will then translate to
> Markdown containing an image with its caption (in the square bracket), i.e.
> the result after the pandoc transformation DOCX -> MD should look something
> like this
>
> ![Abb. 1: title](ip-logo.png){ #image1 }
>
> I tried to add the caption "Abb. 1: title" in Word on a newline after the
> image and choosed the style "Image Caption", but that did not work. Also if
> I use the Word functionality to add a caption to the image, that was again
> only parsed as an additional line of text. The only thing which works is to
> format the image in Word and add some alternative (hidden) text.
>
> Is there a more visible way to achieve the above markdown line from a word
> document? How should I use the styles "Image Caption" or "Captioned Image"
> in Word correctly such that pandoc will do something with them? Is it
> normal that I don't see these styles in the native ATX output?
>
> I am using a German version of Word on a windows machine with pandoc
> version 2.10.1.
>
> Thank you very much for any hint!
> Philipp
>
> --
> 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/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%40mail.gmail.com.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
       [not found] ` <601f7c12-1b83-43df-97ca-4288126ac4e4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2020-08-13 20:22   ` Leonard Rosenthol
@ 2020-08-13 20:23   ` Denis Maier
       [not found]     ` <a2555e89-5f0b-b0cd-2d52-bec1c9290168-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
  1 sibling, 1 reply; 13+ messages in thread
From: Denis Maier @ 2020-08-13 20:23 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Hi,
not really a hint, but have you tried doing the conversion in the 
opposite direction? How does the DOCX look like when you use the 
expected result as input?
Best,
Denis

Am 13.08.2020 um 22:09 schrieb Philipp Zumstein:
> I would like to create some DOCX document which will then translate to 
> Markdown containing an image with its caption (in the square bracket), 
> i.e. the result after the pandoc transformation DOCX -> MD should look 
> something like this
>
> ![Abb. 1: title](ip-logo.png){ #image1 }
>
> I tried to add the caption "Abb. 1: title" in Word on a newline after 
> the image and choosed the style "Image Caption", but that did not 
> work. Also if I use the Word functionality to add a caption to the 
> image, that was again only parsed as an additional line of text. The 
> only thing which works is to format the image in Word and add some 
> alternative (hidden) text.
>
> Is there a more visible way to achieve the above markdown line from a 
> word document? How should I use the styles "Image Caption" or 
> "Captioned Image" in Word correctly such that pandoc will do something 
> with them? Is it normal that I don't see these styles in the native 
> ATX output?
>
> I am using a German version of Word on a windows machine with pandoc 
> version 2.10.1.
>
> Thank you very much for any hint!
> Philipp
> -- 
> 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 
> <mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com 
> <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/a2555e89-5f0b-b0cd-2d52-bec1c9290168%40mailbox.org.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
       [not found]     ` <CALu=v3Jic+xJzRqZqKc68bgq9+hJu4ggT8QVYywREoNjxJJ9Tw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-08-13 20:43       ` Philipp Zumstein
       [not found]         ` <CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Philipp Zumstein @ 2020-08-13 20:43 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

I right click on the image and choose "Beschriftung einfügen..." in Word.
However, this is then transformed to a separate line in MD:

```
![](media/image1.png){width="1.3888888888888888in" height="1.375in"}

Abbildung : title
```

Is this working for you?

Is there possibly a difference if I do that in a German localized Word?

Thank you and best regards,
Philipp


Am Do., 13. Aug. 2020 um 22:22 Uhr schrieb Leonard Rosenthol <
leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:

> AFAICT from a quick read of the DocX Reader - if you set the caption in
> w/ord using its "Insert Caption" choice, that will come over into the
> Markdown.
>
> Leonard
>
> On Thu, Aug 13, 2020 at 4:09 PM Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> wrote:
>
>> I would like to create some DOCX document which will then translate to
>> Markdown containing an image with its caption (in the square bracket), i.e.
>> the result after the pandoc transformation DOCX -> MD should look something
>> like this
>>
>> ![Abb. 1: title](ip-logo.png){ #image1 }
>>
>> I tried to add the caption "Abb. 1: title" in Word on a newline after the
>> image and choosed the style "Image Caption", but that did not work. Also if
>> I use the Word functionality to add a caption to the image, that was again
>> only parsed as an additional line of text. The only thing which works is to
>> format the image in Word and add some alternative (hidden) text.
>>
>> Is there a more visible way to achieve the above markdown line from a
>> word document? How should I use the styles "Image Caption" or "Captioned
>> Image" in Word correctly such that pandoc will do something with them? Is
>> it normal that I don't see these styles in the native ATX output?
>>
>> I am using a German version of Word on a windows machine with pandoc
>> version 2.10.1.
>>
>> Thank you very much for any hint!
>> Philipp
>>
>> --
>> 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/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/Pm6_hoJ2Zao/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/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%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/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%40mail.gmail.com.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
       [not found]     ` <a2555e89-5f0b-b0cd-2d52-bec1c9290168-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
@ 2020-08-13 20:49       ` Philipp Zumstein
  0 siblings, 0 replies; 13+ messages in thread
From: Philipp Zumstein @ 2020-08-13 20:49 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

 Yeah, I already tried, but it was not as expected. When I transform from
MD to DOCX a picture with an invisible alt tag AND a visible line below of
the style Image Caption with the caption text is created. Then, if I
transform this back again to MD, the result is as follows

```
![Abb. 1: title](media/rId20.png){width="1.3888888888888888in"
height="1.375in"}

Abb. 1: title
```

That is doubling the information from the start... Moreover the relevant
information (between the square brackets) comes from the invisible
information in Word which is not what I want.

Thank you and best regards,
Philipp

Am Do., 13. Aug. 2020 um 22:23 Uhr schrieb Denis Maier <
denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>:

> Hi,
> not really a hint, but have you tried doing the conversion in the opposite
> direction? How does the DOCX look like when you use the expected result as
> input?
> Best,
> Denis
>
> Am 13.08.2020 um 22:09 schrieb Philipp Zumstein:
>
> I would like to create some DOCX document which will then translate to
> Markdown containing an image with its caption (in the square bracket), i.e.
> the result after the pandoc transformation DOCX -> MD should look something
> like this
>
> ![Abb. 1: title](ip-logo.png){ #image1 }
>
> I tried to add the caption "Abb. 1: title" in Word on a newline after the
> image and choosed the style "Image Caption", but that did not work. Also if
> I use the Word functionality to add a caption to the image, that was again
> only parsed as an additional line of text. The only thing which works is to
> format the image in Word and add some alternative (hidden) text.
>
> Is there a more visible way to achieve the above markdown line from a word
> document? How should I use the styles "Image Caption" or "Captioned Image"
> in Word correctly such that pandoc will do something with them? Is it
> normal that I don't see these styles in the native ATX output?
>
> I am using a German version of Word on a windows machine with pandoc
> version 2.10.1.
>
> Thank you very much for any hint!
> Philipp
> --
> 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/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/Pm6_hoJ2Zao/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/a2555e89-5f0b-b0cd-2d52-bec1c9290168%40mailbox.org
> <https://groups.google.com/d/msgid/pandoc-discuss/a2555e89-5f0b-b0cd-2d52-bec1c9290168%40mailbox.org?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/CAAjpKCTc-mcPYoqe7D779VMWkVchANLn7wJhneMv4PNr3a2xKg%40mail.gmail.com.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
       [not found]         ` <CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-08-13 20:59           ` Denis Maier
       [not found]             ` <fa0d0129-89db-209c-3d4b-0f54fbc34dc3-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Denis Maier @ 2020-08-13 20:59 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Just for the record. I've just tried, and roundtripping doesn't work.

That's the input document:

```

hallo.

![Abb. 1: title](texworks.png){ #image1 }
```

Converting to docx produces an image with a caption (style is "image 
caption"). Converting the untouched document back to md gives me:

```hallo.

![Abb. 1: title](media/rId20.png){width="3.5555555555555554in"
height="3.5555555555555554in"}

Abb. 1: title
```

But, I also have a German localized Word...
Some time ago there was an issue that styles weren't picked up properly 
if localized styles were used. But that doesn't seem to be the case here 
as I have not saved the docx with word. The styles as produced by pandoc 
should still be there.

Best,
Denis


> I right click on the image and choose "Beschriftung einfügen..." in 
> Word. However, this is then transformed to a separate line in MD:
>
> ```
> ![](media/image1.png){width="1.3888888888888888in" height="1.375in"}
>
> Abbildung : title
> ```
>
> Is this working for you?
>
> Is there possibly a difference if I do that in a German localized Word?
> Thank you and best regards,
> Philipp
>
>
> Am Do., 13. Aug. 2020 um 22:22 Uhr schrieb Leonard Rosenthol 
> <leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org <mailto:leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>>:
>
>     AFAICT from a quick read of the DocX Reader - if you set the
>     caption in w/ord using its "Insert Caption" choice, that will come
>     over into the Markdown.
>
>     Leonard
>
>     On Thu, Aug 13, 2020 at 4:09 PM Philipp Zumstein
>     <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <mailto:zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> wrote:
>
>         I would like to create some DOCX document which will then
>         translate to Markdown containing an image with its caption (in
>         the square bracket), i.e. the result after the pandoc
>         transformation DOCX -> MD should look something like this
>
>         ![Abb. 1: title](ip-logo.png){ #image1 }
>
>         I tried to add the caption "Abb. 1: title" in Word on a
>         newline after the image and choosed the style "Image Caption",
>         but that did not work. Also if I use the Word functionality to
>         add a caption to the image, that was again only parsed as an
>         additional line of text. The only thing which works is to
>         format the image in Word and add some alternative (hidden) text.
>
>         Is there a more visible way to achieve the above markdown line
>         from a word document? How should I use the styles "Image
>         Caption" or "Captioned Image" in Word correctly such that
>         pandoc will do something with them? Is it normal that I don't
>         see these styles in the native ATX output?
>
>         I am using a German version of Word on a windows machine with
>         pandoc version 2.10.1.
>
>         Thank you very much for any hint!
>         Philipp
>         -- 
>         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
>         <mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
>         To view this discussion on the web visit
>         https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com
>         <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/Pm6_hoJ2Zao/unsubscribe.
>     To unsubscribe from this group and all its topics, send an email
>     to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>     <mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
>     To view this discussion on the web visit
>     https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%40mail.gmail.com
>     <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
> <mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%40mail.gmail.com 
> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%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/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
       [not found]             ` <fa0d0129-89db-209c-3d4b-0f54fbc34dc3-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
@ 2020-08-13 22:25               ` Leonard Rosenthol
       [not found]                 ` <CALu=v3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Leonard Rosenthol @ 2020-08-13 22:25 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

The Image1 doesn't go into the DocX file - but the title (Abb. 1) does as
the caption.

And going back to markdown, it comes back in the right spot.

What are you trying to do with the {#image1}

Leonard

Leonard


On Thu, Aug 13, 2020 at 4:59 PM Denis Maier <denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
wrote:

> Just for the record. I've just tried, and roundtripping doesn't work.
>
> That's the input document:
>
> ```
>
> hallo.
>
> ![Abb. 1: title](texworks.png){ #image1 }
> ```
>
> Converting to docx produces an image with a caption (style is "image
> caption"). Converting the untouched document back to md gives me:
>
> ```hallo.
>
> ![Abb. 1: title](media/rId20.png){width="3.5555555555555554in"
> height="3.5555555555555554in"}
>
> Abb. 1: title
> ```
>
> But, I also have a German localized Word...
> Some time ago there was an issue that styles weren't picked up properly if
> localized styles were used. But that doesn't seem to be the case here as I
> have not saved the docx with word. The styles as produced by pandoc should
> still be there.
>
> Best,
> Denis
>
>
> I right click on the image and choose "Beschriftung einfügen..." in Word.
> However, this is then transformed to a separate line in MD:
>
> ```
> ![](media/image1.png){width="1.3888888888888888in" height="1.375in"}
>
> Abbildung : title
> ```
>
> Is this working for you?
>
> Is there possibly a difference if I do that in a German localized Word?
>
> Thank you and best regards,
> Philipp
>
>
> Am Do., 13. Aug. 2020 um 22:22 Uhr schrieb Leonard Rosenthol <
> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>
>> AFAICT from a quick read of the DocX Reader - if you set the caption in
>> w/ord using its "Insert Caption" choice, that will come over into the
>> Markdown.
>>
>> Leonard
>>
>> On Thu, Aug 13, 2020 at 4:09 PM Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> wrote:
>>
>>> I would like to create some DOCX document which will then translate to
>>> Markdown containing an image with its caption (in the square bracket), i.e.
>>> the result after the pandoc transformation DOCX -> MD should look something
>>> like this
>>>
>>> ![Abb. 1: title](ip-logo.png){ #image1 }
>>>
>>> I tried to add the caption "Abb. 1: title" in Word on a newline after
>>> the image and choosed the style "Image Caption", but that did not work.
>>> Also if I use the Word functionality to add a caption to the image, that
>>> was again only parsed as an additional line of text. The only thing which
>>> works is to format the image in Word and add some alternative (hidden) text.
>>>
>>> Is there a more visible way to achieve the above markdown line from a
>>> word document? How should I use the styles "Image Caption" or "Captioned
>>> Image" in Word correctly such that pandoc will do something with them? Is
>>> it normal that I don't see these styles in the native ATX output?
>>>
>>> I am using a German version of Word on a windows machine with pandoc
>>> version 2.10.1.
>>>
>>> Thank you very much for any hint!
>>> Philipp
>>> --
>>> 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/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/Pm6_hoJ2Zao/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/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%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/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%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/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org
> <https://groups.google.com/d/msgid/pandoc-discuss/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org?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/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%40mail.gmail.com.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
       [not found]                 ` <CALu=v3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-08-14 21:20                   ` Philipp Zumstein
       [not found]                     ` <CAAjpKCR8ROFDn8pmGoh=HWMLGyuVq7L=GVx4X9nG+eTmKv4KgQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Philipp Zumstein @ 2020-08-14 21:20 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Okay, it works for you w/o problems. Do I guess correctly that you have
Word in an English localization? If I try to open the different parts of
the word document then I see in the document.xml that the caption is saved
in a XML-tag of the form
```
<w:pStyle w:val="Beschriftung"/>
```
Is this handled in the DOCX-reader? Can you point me to the place which is
responsible for reading the image caption in the code of the docx reader?

Oh, the things in the curly braces is only the id of the image, such that
you can point to it like [see](#image1). But that is negligible for my
problem here.

Best regards,
Philipp

Am Fr., 14. Aug. 2020 um 20:16 Uhr schrieb Leonard Rosenthol <
leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:

> The Image1 doesn't go into the DocX file - but the title (Abb. 1) does as
> the caption.
>
> And going back to markdown, it comes back in the right spot.
>
> What are you trying to do with the {#image1}
>
> Leonard
>
> Leonard
>
>
> On Thu, Aug 13, 2020 at 4:59 PM Denis Maier <denis.maier.lists-cl+VPiYnx/3F2uMehF1BdA@public.gmane.orgg>
> wrote:
>
>> Just for the record. I've just tried, and roundtripping doesn't work.
>>
>> That's the input document:
>>
>> ```
>>
>> hallo.
>>
>> ![Abb. 1: title](texworks.png){ #image1 }
>> ```
>>
>> Converting to docx produces an image with a caption (style is "image
>> caption"). Converting the untouched document back to md gives me:
>>
>> ```hallo.
>>
>> ![Abb. 1: title](media/rId20.png){width="3.5555555555555554in"
>> height="3.5555555555555554in"}
>>
>> Abb. 1: title
>> ```
>>
>> But, I also have a German localized Word...
>> Some time ago there was an issue that styles weren't picked up properly
>> if localized styles were used. But that doesn't seem to be the case here as
>> I have not saved the docx with word. The styles as produced by pandoc
>> should still be there.
>>
>> Best,
>> Denis
>>
>>
>> I right click on the image and choose "Beschriftung einfügen..." in Word.
>> However, this is then transformed to a separate line in MD:
>>
>> ```
>> ![](media/image1.png){width="1.3888888888888888in" height="1.375in"}
>>
>> Abbildung : title
>> ```
>>
>> Is this working for you?
>>
>> Is there possibly a difference if I do that in a German localized Word?
>>
>> Thank you and best regards,
>> Philipp
>>
>>
>> Am Do., 13. Aug. 2020 um 22:22 Uhr schrieb Leonard Rosenthol <
>> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>>
>>> AFAICT from a quick read of the DocX Reader - if you set the caption in
>>> w/ord using its "Insert Caption" choice, that will come over into the
>>> Markdown.
>>>
>>> Leonard
>>>
>>> On Thu, Aug 13, 2020 at 4:09 PM Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>> wrote:
>>>
>>>> I would like to create some DOCX document which will then translate to
>>>> Markdown containing an image with its caption (in the square bracket), i.e.
>>>> the result after the pandoc transformation DOCX -> MD should look something
>>>> like this
>>>>
>>>> ![Abb. 1: title](ip-logo.png){ #image1 }
>>>>
>>>> I tried to add the caption "Abb. 1: title" in Word on a newline after
>>>> the image and choosed the style "Image Caption", but that did not work.
>>>> Also if I use the Word functionality to add a caption to the image, that
>>>> was again only parsed as an additional line of text. The only thing which
>>>> works is to format the image in Word and add some alternative (hidden) text.
>>>>
>>>> Is there a more visible way to achieve the above markdown line from a
>>>> word document? How should I use the styles "Image Caption" or "Captioned
>>>> Image" in Word correctly such that pandoc will do something with them? Is
>>>> it normal that I don't see these styles in the native ATX output?
>>>>
>>>> I am using a German version of Word on a windows machine with pandoc
>>>> version 2.10.1.
>>>>
>>>> Thank you very much for any hint!
>>>> Philipp
>>>> --
>>>> 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/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/Pm6_hoJ2Zao/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/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%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/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%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/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org
>> <https://groups.google.com/d/msgid/pandoc-discuss/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org?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/Pm6_hoJ2Zao/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/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%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/CAAjpKCR8ROFDn8pmGoh%3DHWMLGyuVq7L%3DGVx4X9nG%2BeTmKv4KgQ%40mail.gmail.com.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
       [not found]                     ` <CAAjpKCR8ROFDn8pmGoh=HWMLGyuVq7L=GVx4X9nG+eTmKv4KgQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-08-15  9:25                       ` Philipp Zumstein
       [not found]                         ` <CAAjpKCSks1XoOZDm=JtN05p3yt0JJVbnRkdVe+widioOmtncyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Philipp Zumstein @ 2020-08-15  9:25 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Maybe, the problem is larger. Let me try to explain what I found out:

I used a test DOCX from the repo with an image:
https://github.com/jgm/pandoc/blob/master/test/docx/golden/image.docx

1) DOCX -> MD: Besides the caption in the square brackets (alt text) I also
see an extra line following the image with the caption text.
2) DOCX -> MD -> PDF: In the PDF output the images are in a figure float
and have a caption with the label "Figure" and automatically numbered,
which is what I want. But each caption occurs additionally in a separate
line in the text, which I don't want. This is a follow-up problem of what I
describe under 1)
3) DOCX -> LATEX/PDF: The images are not in any figure float and the
caption text is just the next line and can therefore be splitted from the
image. That is not what I want.

Isn't this a general problem how images with captions are transformed with
pandoc?

I do the workflow 2) but have currently to manually delete the extra lines
in the MD document resp. copy them into the brackets.


Am Fr., 14. Aug. 2020 um 23:20 Uhr schrieb Philipp Zumstein <
zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:

> Okay, it works for you w/o problems. Do I guess correctly that you have
> Word in an English localization? If I try to open the different parts of
> the word document then I see in the document.xml that the caption is saved
> in a XML-tag of the form
> ```
> <w:pStyle w:val="Beschriftung"/>
> ```
> Is this handled in the DOCX-reader? Can you point me to the place which is
> responsible for reading the image caption in the code of the docx reader?
>
> Oh, the things in the curly braces is only the id of the image, such that
> you can point to it like [see](#image1). But that is negligible for my
> problem here.
>
> Best regards,
> Philipp
>
> Am Fr., 14. Aug. 2020 um 20:16 Uhr schrieb Leonard Rosenthol <
> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>
>> The Image1 doesn't go into the DocX file - but the title (Abb. 1) does as
>> the caption.
>>
>> And going back to markdown, it comes back in the right spot.
>>
>> What are you trying to do with the {#image1}
>>
>> Leonard
>>
>> Leonard
>>
>>
>> On Thu, Aug 13, 2020 at 4:59 PM Denis Maier <
>> denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org> wrote:
>>
>>> Just for the record. I've just tried, and roundtripping doesn't work.
>>>
>>> That's the input document:
>>>
>>> ```
>>>
>>> hallo.
>>>
>>> ![Abb. 1: title](texworks.png){ #image1 }
>>> ```
>>>
>>> Converting to docx produces an image with a caption (style is "image
>>> caption"). Converting the untouched document back to md gives me:
>>>
>>> ```hallo.
>>>
>>> ![Abb. 1: title](media/rId20.png){width="3.5555555555555554in"
>>> height="3.5555555555555554in"}
>>>
>>> Abb. 1: title
>>> ```
>>>
>>> But, I also have a German localized Word...
>>> Some time ago there was an issue that styles weren't picked up properly
>>> if localized styles were used. But that doesn't seem to be the case here as
>>> I have not saved the docx with word. The styles as produced by pandoc
>>> should still be there.
>>>
>>> Best,
>>> Denis
>>>
>>>
>>> I right click on the image and choose "Beschriftung einfügen..." in
>>> Word. However, this is then transformed to a separate line in MD:
>>>
>>> ```
>>> ![](media/image1.png){width="1.3888888888888888in" height="1.375in"}
>>>
>>> Abbildung : title
>>> ```
>>>
>>> Is this working for you?
>>>
>>> Is there possibly a difference if I do that in a German localized Word?
>>>
>>> Thank you and best regards,
>>> Philipp
>>>
>>>
>>> Am Do., 13. Aug. 2020 um 22:22 Uhr schrieb Leonard Rosenthol <
>>> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>>>
>>>> AFAICT from a quick read of the DocX Reader - if you set the caption in
>>>> w/ord using its "Insert Caption" choice, that will come over into the
>>>> Markdown.
>>>>
>>>> Leonard
>>>>
>>>> On Thu, Aug 13, 2020 at 4:09 PM Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>> wrote:
>>>>
>>>>> I would like to create some DOCX document which will then translate to
>>>>> Markdown containing an image with its caption (in the square bracket), i.e.
>>>>> the result after the pandoc transformation DOCX -> MD should look something
>>>>> like this
>>>>>
>>>>> ![Abb. 1: title](ip-logo.png){ #image1 }
>>>>>
>>>>> I tried to add the caption "Abb. 1: title" in Word on a newline after
>>>>> the image and choosed the style "Image Caption", but that did not work.
>>>>> Also if I use the Word functionality to add a caption to the image, that
>>>>> was again only parsed as an additional line of text. The only thing which
>>>>> works is to format the image in Word and add some alternative (hidden) text.
>>>>>
>>>>> Is there a more visible way to achieve the above markdown line from a
>>>>> word document? How should I use the styles "Image Caption" or "Captioned
>>>>> Image" in Word correctly such that pandoc will do something with them? Is
>>>>> it normal that I don't see these styles in the native ATX output?
>>>>>
>>>>> I am using a German version of Word on a windows machine with pandoc
>>>>> version 2.10.1.
>>>>>
>>>>> Thank you very much for any hint!
>>>>> Philipp
>>>>> --
>>>>> 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/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/Pm6_hoJ2Zao/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/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%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/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%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/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org
>>> <https://groups.google.com/d/msgid/pandoc-discuss/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org?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/Pm6_hoJ2Zao/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/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%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/CAAjpKCSks1XoOZDm%3DJtN05p3yt0JJVbnRkdVe%2BwidioOmtncyw%40mail.gmail.com.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
       [not found]                         ` <CAAjpKCSks1XoOZDm=JtN05p3yt0JJVbnRkdVe+widioOmtncyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-08-15  9:57                           ` Dmitriy Krasilnikov
  2020-08-15 13:54                           ` BPJ
  1 sibling, 0 replies; 13+ messages in thread
From: Dmitriy Krasilnikov @ 2020-08-15  9:57 UTC (permalink / raw)
  To: Finn Mathisen

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

Let me explain my understanding how MS Word works.

There is no internal structure in a Word document, so Word cannot discern
if this is a caption or a regular text under the image. In Word, caption is
not "inside" the image block, and is in no way connected to the image
structurally. It just follows the image.

A caption is just a paragraph with a style applied. A caption for an image
can be under an image and above the table, or vice versa.

Pandoc has an internal caption field in an image object, but its
internalness is lost when this object is expanded into Word xml, and
becomes two sequential paragraphs.

So, if you want to turn Word "captions" back into objects with captions,
you will have to parse the pandoc elements tree with your own filter, and
merge the adjacent strings into objects with captions.

сб, 15 авг. 2020 г., 12:26 Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:

> Maybe, the problem is larger. Let me try to explain what I found out:
>
> I used a test DOCX from the repo with an image:
> https://github.com/jgm/pandoc/blob/master/test/docx/golden/image.docx
>
> 1) DOCX -> MD: Besides the caption in the square brackets (alt text) I
> also see an extra line following the image with the caption text.
> 2) DOCX -> MD -> PDF: In the PDF output the images are in a figure float
> and have a caption with the label "Figure" and automatically numbered,
> which is what I want. But each caption occurs additionally in a separate
> line in the text, which I don't want. This is a follow-up problem of what I
> describe under 1)
> 3) DOCX -> LATEX/PDF: The images are not in any figure float and the
> caption text is just the next line and can therefore be splitted from the
> image. That is not what I want.
>
> Isn't this a general problem how images with captions are transformed with
> pandoc?
>
> I do the workflow 2) but have currently to manually delete the extra lines
> in the MD document resp. copy them into the brackets.
>
>
> Am Fr., 14. Aug. 2020 um 23:20 Uhr schrieb Philipp Zumstein <
> zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>
>> Okay, it works for you w/o problems. Do I guess correctly that you have
>> Word in an English localization? If I try to open the different parts of
>> the word document then I see in the document.xml that the caption is saved
>> in a XML-tag of the form
>> ```
>> <w:pStyle w:val="Beschriftung"/>
>> ```
>> Is this handled in the DOCX-reader? Can you point me to the place which
>> is responsible for reading the image caption in the code of the docx reader?
>>
>> Oh, the things in the curly braces is only the id of the image, such that
>> you can point to it like [see](#image1). But that is negligible for my
>> problem here.
>>
>> Best regards,
>> Philipp
>>
>> Am Fr., 14. Aug. 2020 um 20:16 Uhr schrieb Leonard Rosenthol <
>> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>>
>>> The Image1 doesn't go into the DocX file - but the title (Abb. 1) does
>>> as the caption.
>>>
>>> And going back to markdown, it comes back in the right spot.
>>>
>>> What are you trying to do with the {#image1}
>>>
>>> Leonard
>>>
>>> Leonard
>>>
>>>
>>> On Thu, Aug 13, 2020 at 4:59 PM Denis Maier <
>>> denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org> wrote:
>>>
>>>> Just for the record. I've just tried, and roundtripping doesn't work.
>>>>
>>>> That's the input document:
>>>>
>>>> ```
>>>>
>>>> hallo.
>>>>
>>>> ![Abb. 1: title](texworks.png){ #image1 }
>>>> ```
>>>>
>>>> Converting to docx produces an image with a caption (style is "image
>>>> caption"). Converting the untouched document back to md gives me:
>>>>
>>>> ```hallo.
>>>>
>>>> ![Abb. 1: title](media/rId20.png){width="3.5555555555555554in"
>>>> height="3.5555555555555554in"}
>>>>
>>>> Abb. 1: title
>>>> ```
>>>>
>>>> But, I also have a German localized Word...
>>>> Some time ago there was an issue that styles weren't picked up properly
>>>> if localized styles were used. But that doesn't seem to be the case here as
>>>> I have not saved the docx with word. The styles as produced by pandoc
>>>> should still be there.
>>>>
>>>> Best,
>>>> Denis
>>>>
>>>>
>>>> I right click on the image and choose "Beschriftung einfügen..." in
>>>> Word. However, this is then transformed to a separate line in MD:
>>>>
>>>> ```
>>>> ![](media/image1.png){width="1.3888888888888888in" height="1.375in"}
>>>>
>>>> Abbildung : title
>>>> ```
>>>>
>>>> Is this working for you?
>>>>
>>>> Is there possibly a difference if I do that in a German localized Word?
>>>>
>>>> Thank you and best regards,
>>>> Philipp
>>>>
>>>>
>>>> Am Do., 13. Aug. 2020 um 22:22 Uhr schrieb Leonard Rosenthol <
>>>> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>>>>
>>>>> AFAICT from a quick read of the DocX Reader - if you set the caption
>>>>> in w/ord using its "Insert Caption" choice, that will come over into the
>>>>> Markdown.
>>>>>
>>>>> Leonard
>>>>>
>>>>> On Thu, Aug 13, 2020 at 4:09 PM Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>> wrote:
>>>>>
>>>>>> I would like to create some DOCX document which will then translate
>>>>>> to Markdown containing an image with its caption (in the square bracket),
>>>>>> i.e. the result after the pandoc transformation DOCX -> MD should look
>>>>>> something like this
>>>>>>
>>>>>> ![Abb. 1: title](ip-logo.png){ #image1 }
>>>>>>
>>>>>> I tried to add the caption "Abb. 1: title" in Word on a newline after
>>>>>> the image and choosed the style "Image Caption", but that did not work.
>>>>>> Also if I use the Word functionality to add a caption to the image, that
>>>>>> was again only parsed as an additional line of text. The only thing which
>>>>>> works is to format the image in Word and add some alternative (hidden) text.
>>>>>>
>>>>>> Is there a more visible way to achieve the above markdown line from a
>>>>>> word document? How should I use the styles "Image Caption" or "Captioned
>>>>>> Image" in Word correctly such that pandoc will do something with them? Is
>>>>>> it normal that I don't see these styles in the native ATX output?
>>>>>>
>>>>>> I am using a German version of Word on a windows machine with pandoc
>>>>>> version 2.10.1.
>>>>>>
>>>>>> Thank you very much for any hint!
>>>>>> Philipp
>>>>>> --
>>>>>> 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/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/Pm6_hoJ2Zao/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/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%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/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%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/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org?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/Pm6_hoJ2Zao/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/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%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/CAAjpKCSks1XoOZDm%3DJtN05p3yt0JJVbnRkdVe%2BwidioOmtncyw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCSks1XoOZDm%3DJtN05p3yt0JJVbnRkdVe%2BwidioOmtncyw%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/CALZUCcDR-q1_uoxCBxNaHpAq3HLw2erW8gqcYLmJ7Sm%3D-WqVyg%40mail.gmail.com.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
       [not found]                         ` <CAAjpKCSks1XoOZDm=JtN05p3yt0JJVbnRkdVe+widioOmtncyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2020-08-15  9:57                           ` Dmitriy Krasilnikov
@ 2020-08-15 13:54                           ` BPJ
  2020-08-15 16:20                             ` Philipp Zumstein
  1 sibling, 1 reply; 13+ messages in thread
From: BPJ @ 2020-08-15 13:54 UTC (permalink / raw)
  To: pandoc-discuss

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

#2 should be possible to fix with a filter, i.e. remove the first paragraph
after an image if its stringified text is equal to the stringified text of
the image caption.


-- 
Better --help|less than helpless

Den lör 15 aug. 2020 11:26Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> Maybe, the problem is larger. Let me try to explain what I found out:
>
> I used a test DOCX from the repo with an image:
> https://github.com/jgm/pandoc/blob/master/test/docx/golden/image.docx
>
> 1) DOCX -> MD: Besides the caption in the square brackets (alt text) I
> also see an extra line following the image with the caption text.
> 2) DOCX -> MD -> PDF: In the PDF output the images are in a figure float
> and have a caption with the label "Figure" and automatically numbered,
> which is what I want. But each caption occurs additionally in a separate
> line in the text, which I don't want. This is a follow-up problem of what I
> describe under 1)
> 3) DOCX -> LATEX/PDF: The images are not in any figure float and the
> caption text is just the next line and can therefore be splitted from the
> image. That is not what I want.
>
> Isn't this a general problem how images with captions are transformed with
> pandoc?
>
> I do the workflow 2) but have currently to manually delete the extra lines
> in the MD document resp. copy them into the brackets.
>
>
> Am Fr., 14. Aug. 2020 um 23:20 Uhr schrieb Philipp Zumstein <
> zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>
>> Okay, it works for you w/o problems. Do I guess correctly that you have
>> Word in an English localization? If I try to open the different parts of
>> the word document then I see in the document.xml that the caption is saved
>> in a XML-tag of the form
>> ```
>> <w:pStyle w:val="Beschriftung"/>
>> ```
>> Is this handled in the DOCX-reader? Can you point me to the place which
>> is responsible for reading the image caption in the code of the docx reader?
>>
>> Oh, the things in the curly braces is only the id of the image, such that
>> you can point to it like [see](#image1). But that is negligible for my
>> problem here.
>>
>> Best regards,
>> Philipp
>>
>> Am Fr., 14. Aug. 2020 um 20:16 Uhr schrieb Leonard Rosenthol <
>> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>>
>>> The Image1 doesn't go into the DocX file - but the title (Abb. 1) does
>>> as the caption.
>>>
>>> And going back to markdown, it comes back in the right spot.
>>>
>>> What are you trying to do with the {#image1}
>>>
>>> Leonard
>>>
>>> Leonard
>>>
>>>
>>> On Thu, Aug 13, 2020 at 4:59 PM Denis Maier <
>>> denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org> wrote:
>>>
>>>> Just for the record. I've just tried, and roundtripping doesn't work.
>>>>
>>>> That's the input document:
>>>>
>>>> ```
>>>>
>>>> hallo.
>>>>
>>>> ![Abb. 1: title](texworks.png){ #image1 }
>>>> ```
>>>>
>>>> Converting to docx produces an image with a caption (style is "image
>>>> caption"). Converting the untouched document back to md gives me:
>>>>
>>>> ```hallo.
>>>>
>>>> ![Abb. 1: title](media/rId20.png){width="3.5555555555555554in"
>>>> height="3.5555555555555554in"}
>>>>
>>>> Abb. 1: title
>>>> ```
>>>>
>>>> But, I also have a German localized Word...
>>>> Some time ago there was an issue that styles weren't picked up properly
>>>> if localized styles were used. But that doesn't seem to be the case here as
>>>> I have not saved the docx with word. The styles as produced by pandoc
>>>> should still be there.
>>>>
>>>> Best,
>>>> Denis
>>>>
>>>>
>>>> I right click on the image and choose "Beschriftung einfügen..." in
>>>> Word. However, this is then transformed to a separate line in MD:
>>>>
>>>> ```
>>>> ![](media/image1.png){width="1.3888888888888888in" height="1.375in"}
>>>>
>>>> Abbildung : title
>>>> ```
>>>>
>>>> Is this working for you?
>>>>
>>>> Is there possibly a difference if I do that in a German localized Word?
>>>>
>>>> Thank you and best regards,
>>>> Philipp
>>>>
>>>>
>>>> Am Do., 13. Aug. 2020 um 22:22 Uhr schrieb Leonard Rosenthol <
>>>> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>>>>
>>>>> AFAICT from a quick read of the DocX Reader - if you set the caption
>>>>> in w/ord using its "Insert Caption" choice, that will come over into the
>>>>> Markdown.
>>>>>
>>>>> Leonard
>>>>>
>>>>> On Thu, Aug 13, 2020 at 4:09 PM Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>> wrote:
>>>>>
>>>>>> I would like to create some DOCX document which will then translate
>>>>>> to Markdown containing an image with its caption (in the square bracket),
>>>>>> i.e. the result after the pandoc transformation DOCX -> MD should look
>>>>>> something like this
>>>>>>
>>>>>> ![Abb. 1: title](ip-logo.png){ #image1 }
>>>>>>
>>>>>> I tried to add the caption "Abb. 1: title" in Word on a newline after
>>>>>> the image and choosed the style "Image Caption", but that did not work.
>>>>>> Also if I use the Word functionality to add a caption to the image, that
>>>>>> was again only parsed as an additional line of text. The only thing which
>>>>>> works is to format the image in Word and add some alternative (hidden) text.
>>>>>>
>>>>>> Is there a more visible way to achieve the above markdown line from a
>>>>>> word document? How should I use the styles "Image Caption" or "Captioned
>>>>>> Image" in Word correctly such that pandoc will do something with them? Is
>>>>>> it normal that I don't see these styles in the native ATX output?
>>>>>>
>>>>>> I am using a German version of Word on a windows machine with pandoc
>>>>>> version 2.10.1.
>>>>>>
>>>>>> Thank you very much for any hint!
>>>>>> Philipp
>>>>>> --
>>>>>> 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/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/Pm6_hoJ2Zao/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/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%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/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%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/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org?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/Pm6_hoJ2Zao/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/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%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/CAAjpKCSks1XoOZDm%3DJtN05p3yt0JJVbnRkdVe%2BwidioOmtncyw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCSks1XoOZDm%3DJtN05p3yt0JJVbnRkdVe%2BwidioOmtncyw%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/CADAJKhBaLpj8kFSW4nPxN_R6b3hp3%2BfQCQ3hJ_NOH4n1B10G%3DA%40mail.gmail.com.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
  2020-08-15 13:54                           ` BPJ
@ 2020-08-15 16:20                             ` Philipp Zumstein
       [not found]                               ` <CAAjpKCSUwiw6sFXAfxoAmiME6L2nYtPym03PcWACY_tK9BxKCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Philipp Zumstein @ 2020-08-15 16:20 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Yes, that works! Thank you for the tipp with the Lua filter. That was still
quite tricky (at least for me) to figure out how two consecutive elements
could be processed, but I succeeded.

The Lua filter I came up with in the end is accessible at
https://gist.github.com/zuphilip/4819d8333a9670bb2b6a07a7d7b93f8e and can
be freely reused or adapted.

Best regards,
Philipp

Am Sa., 15. Aug. 2020 um 15:55 Uhr schrieb BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org>:

> #2 should be possible to fix with a filter, i.e. remove the first
> paragraph after an image if its stringified text is equal to the
> stringified text of the image caption.
>
>
> --
> Better --help|less than helpless
>
> Den lör 15 aug. 2020 11:26Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>
>> Maybe, the problem is larger. Let me try to explain what I found out:
>>
>> I used a test DOCX from the repo with an image:
>> https://github.com/jgm/pandoc/blob/master/test/docx/golden/image.docx
>>
>> 1) DOCX -> MD: Besides the caption in the square brackets (alt text) I
>> also see an extra line following the image with the caption text.
>> 2) DOCX -> MD -> PDF: In the PDF output the images are in a figure float
>> and have a caption with the label "Figure" and automatically numbered,
>> which is what I want. But each caption occurs additionally in a separate
>> line in the text, which I don't want. This is a follow-up problem of what I
>> describe under 1)
>> 3) DOCX -> LATEX/PDF: The images are not in any figure float and the
>> caption text is just the next line and can therefore be splitted from the
>> image. That is not what I want.
>>
>> Isn't this a general problem how images with captions are transformed
>> with pandoc?
>>
>> I do the workflow 2) but have currently to manually delete the extra
>> lines in the MD document resp. copy them into the brackets.
>>
>>
>> Am Fr., 14. Aug. 2020 um 23:20 Uhr schrieb Philipp Zumstein <
>> zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>>
>>> Okay, it works for you w/o problems. Do I guess correctly that you have
>>> Word in an English localization? If I try to open the different parts of
>>> the word document then I see in the document.xml that the caption is saved
>>> in a XML-tag of the form
>>> ```
>>> <w:pStyle w:val="Beschriftung"/>
>>> ```
>>> Is this handled in the DOCX-reader? Can you point me to the place which
>>> is responsible for reading the image caption in the code of the docx reader?
>>>
>>> Oh, the things in the curly braces is only the id of the image, such
>>> that you can point to it like [see](#image1). But that is negligible for my
>>> problem here.
>>>
>>> Best regards,
>>> Philipp
>>>
>>> Am Fr., 14. Aug. 2020 um 20:16 Uhr schrieb Leonard Rosenthol <
>>> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>>>
>>>> The Image1 doesn't go into the DocX file - but the title (Abb. 1) does
>>>> as the caption.
>>>>
>>>> And going back to markdown, it comes back in the right spot.
>>>>
>>>> What are you trying to do with the {#image1}
>>>>
>>>> Leonard
>>>>
>>>> Leonard
>>>>
>>>>
>>>> On Thu, Aug 13, 2020 at 4:59 PM Denis Maier <
>>>> denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org> wrote:
>>>>
>>>>> Just for the record. I've just tried, and roundtripping doesn't work.
>>>>>
>>>>> That's the input document:
>>>>>
>>>>> ```
>>>>>
>>>>> hallo.
>>>>>
>>>>> ![Abb. 1: title](texworks.png){ #image1 }
>>>>> ```
>>>>>
>>>>> Converting to docx produces an image with a caption (style is "image
>>>>> caption"). Converting the untouched document back to md gives me:
>>>>>
>>>>> ```hallo.
>>>>>
>>>>> ![Abb. 1: title](media/rId20.png){width="3.5555555555555554in"
>>>>> height="3.5555555555555554in"}
>>>>>
>>>>> Abb. 1: title
>>>>> ```
>>>>>
>>>>> But, I also have a German localized Word...
>>>>> Some time ago there was an issue that styles weren't picked up
>>>>> properly if localized styles were used. But that doesn't seem to be the
>>>>> case here as I have not saved the docx with word. The styles as produced by
>>>>> pandoc should still be there.
>>>>>
>>>>> Best,
>>>>> Denis
>>>>>
>>>>>
>>>>> I right click on the image and choose "Beschriftung einfügen..." in
>>>>> Word. However, this is then transformed to a separate line in MD:
>>>>>
>>>>> ```
>>>>> ![](media/image1.png){width="1.3888888888888888in" height="1.375in"}
>>>>>
>>>>> Abbildung : title
>>>>> ```
>>>>>
>>>>> Is this working for you?
>>>>>
>>>>> Is there possibly a difference if I do that in a German localized Word?
>>>>>
>>>>> Thank you and best regards,
>>>>> Philipp
>>>>>
>>>>>
>>>>> Am Do., 13. Aug. 2020 um 22:22 Uhr schrieb Leonard Rosenthol <
>>>>> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>>>>>
>>>>>> AFAICT from a quick read of the DocX Reader - if you set the caption
>>>>>> in w/ord using its "Insert Caption" choice, that will come over into the
>>>>>> Markdown.
>>>>>>
>>>>>> Leonard
>>>>>>
>>>>>> On Thu, Aug 13, 2020 at 4:09 PM Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>> wrote:
>>>>>>
>>>>>>> I would like to create some DOCX document which will then translate
>>>>>>> to Markdown containing an image with its caption (in the square bracket),
>>>>>>> i.e. the result after the pandoc transformation DOCX -> MD should look
>>>>>>> something like this
>>>>>>>
>>>>>>> ![Abb. 1: title](ip-logo.png){ #image1 }
>>>>>>>
>>>>>>> I tried to add the caption "Abb. 1: title" in Word on a newline
>>>>>>> after the image and choosed the style "Image Caption", but that did not
>>>>>>> work. Also if I use the Word functionality to add a caption to the image,
>>>>>>> that was again only parsed as an additional line of text. The only thing
>>>>>>> which works is to format the image in Word and add some alternative
>>>>>>> (hidden) text.
>>>>>>>
>>>>>>> Is there a more visible way to achieve the above markdown line from
>>>>>>> a word document? How should I use the styles "Image Caption" or "Captioned
>>>>>>> Image" in Word correctly such that pandoc will do something with them? Is
>>>>>>> it normal that I don't see these styles in the native ATX output?
>>>>>>>
>>>>>>> I am using a German version of Word on a windows machine with pandoc
>>>>>>> version 2.10.1.
>>>>>>>
>>>>>>> Thank you very much for any hint!
>>>>>>> Philipp
>>>>>>> --
>>>>>>> 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/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/Pm6_hoJ2Zao/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/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%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/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%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/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org?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/Pm6_hoJ2Zao/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/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%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/CAAjpKCSks1XoOZDm%3DJtN05p3yt0JJVbnRkdVe%2BwidioOmtncyw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCSks1XoOZDm%3DJtN05p3yt0JJVbnRkdVe%2BwidioOmtncyw%40mail.gmail.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/Pm6_hoJ2Zao/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/CADAJKhBaLpj8kFSW4nPxN_R6b3hp3%2BfQCQ3hJ_NOH4n1B10G%3DA%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBaLpj8kFSW4nPxN_R6b3hp3%2BfQCQ3hJ_NOH4n1B10G%3DA%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/CAAjpKCSUwiw6sFXAfxoAmiME6L2nYtPym03PcWACY_tK9BxKCw%40mail.gmail.com.

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

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

* Re: How to add a (visible) image caption in DOCX for pandoc transformations?
       [not found]                               ` <CAAjpKCSUwiw6sFXAfxoAmiME6L2nYtPym03PcWACY_tK9BxKCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-08-15 16:40                                 ` BPJ
  0 siblings, 0 replies; 13+ messages in thread
From: BPJ @ 2020-08-15 16:40 UTC (permalink / raw)
  To: pandoc-discuss

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

I'm glad it worked! I should have mentioned the Blocks callback. Sorry
about that!

-- 
Better --help|less than helpless

Den lör 15 aug. 2020 18:21Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> Yes, that works! Thank you for the tipp with the Lua filter. That was
> still quite tricky (at least for me) to figure out how two consecutive
> elements could be processed, but I succeeded.
>
> The Lua filter I came up with in the end is accessible at
> https://gist.github.com/zuphilip/4819d8333a9670bb2b6a07a7d7b93f8e and can
> be freely reused or adapted.
>
> Best regards,
> Philipp
>
> Am Sa., 15. Aug. 2020 um 15:55 Uhr schrieb BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org>:
>
>> #2 should be possible to fix with a filter, i.e. remove the first
>> paragraph after an image if its stringified text is equal to the
>> stringified text of the image caption.
>>
>>
>> --
>> Better --help|less than helpless
>>
>> Den lör 15 aug. 2020 11:26Philipp Zumstein <zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>>
>>> Maybe, the problem is larger. Let me try to explain what I found out:
>>>
>>> I used a test DOCX from the repo with an image:
>>> https://github.com/jgm/pandoc/blob/master/test/docx/golden/image.docx
>>>
>>> 1) DOCX -> MD: Besides the caption in the square brackets (alt text) I
>>> also see an extra line following the image with the caption text.
>>> 2) DOCX -> MD -> PDF: In the PDF output the images are in a figure float
>>> and have a caption with the label "Figure" and automatically numbered,
>>> which is what I want. But each caption occurs additionally in a separate
>>> line in the text, which I don't want. This is a follow-up problem of what I
>>> describe under 1)
>>> 3) DOCX -> LATEX/PDF: The images are not in any figure float and the
>>> caption text is just the next line and can therefore be splitted from the
>>> image. That is not what I want.
>>>
>>> Isn't this a general problem how images with captions are transformed
>>> with pandoc?
>>>
>>> I do the workflow 2) but have currently to manually delete the extra
>>> lines in the MD document resp. copy them into the brackets.
>>>
>>>
>>> Am Fr., 14. Aug. 2020 um 23:20 Uhr schrieb Philipp Zumstein <
>>> zuphilip-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>>>
>>>> Okay, it works for you w/o problems. Do I guess correctly that you have
>>>> Word in an English localization? If I try to open the different parts of
>>>> the word document then I see in the document.xml that the caption is saved
>>>> in a XML-tag of the form
>>>> ```
>>>> <w:pStyle w:val="Beschriftung"/>
>>>> ```
>>>> Is this handled in the DOCX-reader? Can you point me to the place which
>>>> is responsible for reading the image caption in the code of the docx reader?
>>>>
>>>> Oh, the things in the curly braces is only the id of the image, such
>>>> that you can point to it like [see](#image1). But that is negligible for my
>>>> problem here.
>>>>
>>>> Best regards,
>>>> Philipp
>>>>
>>>> Am Fr., 14. Aug. 2020 um 20:16 Uhr schrieb Leonard Rosenthol <
>>>> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>>>>
>>>>> The Image1 doesn't go into the DocX file - but the title (Abb. 1) does
>>>>> as the caption.
>>>>>
>>>>> And going back to markdown, it comes back in the right spot.
>>>>>
>>>>> What are you trying to do with the {#image1}
>>>>>
>>>>> Leonard
>>>>>
>>>>> Leonard
>>>>>
>>>>>
>>>>> On Thu, Aug 13, 2020 at 4:59 PM Denis Maier <
>>>>> denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org> wrote:
>>>>>
>>>>>> Just for the record. I've just tried, and roundtripping doesn't work.
>>>>>>
>>>>>> That's the input document:
>>>>>>
>>>>>> ```
>>>>>>
>>>>>> hallo.
>>>>>>
>>>>>> ![Abb. 1: title](texworks.png){ #image1 }
>>>>>> ```
>>>>>>
>>>>>> Converting to docx produces an image with a caption (style is "image
>>>>>> caption"). Converting the untouched document back to md gives me:
>>>>>>
>>>>>> ```hallo.
>>>>>>
>>>>>> ![Abb. 1: title](media/rId20.png){width="3.5555555555555554in"
>>>>>> height="3.5555555555555554in"}
>>>>>>
>>>>>> Abb. 1: title
>>>>>> ```
>>>>>>
>>>>>> But, I also have a German localized Word...
>>>>>> Some time ago there was an issue that styles weren't picked up
>>>>>> properly if localized styles were used. But that doesn't seem to be the
>>>>>> case here as I have not saved the docx with word. The styles as produced by
>>>>>> pandoc should still be there.
>>>>>>
>>>>>> Best,
>>>>>> Denis
>>>>>>
>>>>>>
>>>>>> I right click on the image and choose "Beschriftung einfügen..." in
>>>>>> Word. However, this is then transformed to a separate line in MD:
>>>>>>
>>>>>> ```
>>>>>> ![](media/image1.png){width="1.3888888888888888in" height="1.375in"}
>>>>>>
>>>>>> Abbildung : title
>>>>>> ```
>>>>>>
>>>>>> Is this working for you?
>>>>>>
>>>>>> Is there possibly a difference if I do that in a German localized
>>>>>> Word?
>>>>>>
>>>>>> Thank you and best regards,
>>>>>> Philipp
>>>>>>
>>>>>>
>>>>>> Am Do., 13. Aug. 2020 um 22:22 Uhr schrieb Leonard Rosenthol <
>>>>>> leonardr-bM6h3K5UM15l57MIdRCFDg@public.gmane.org>:
>>>>>>
>>>>>>> AFAICT from a quick read of the DocX Reader - if you set the caption
>>>>>>> in w/ord using its "Insert Caption" choice, that will come over into the
>>>>>>> Markdown.
>>>>>>>
>>>>>>> Leonard
>>>>>>>
>>>>>>> On Thu, Aug 13, 2020 at 4:09 PM Philipp Zumstein <zuphilip-Re5JQEeQqe8@public.gmane.orgm>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> I would like to create some DOCX document which will then translate
>>>>>>>> to Markdown containing an image with its caption (in the square bracket),
>>>>>>>> i.e. the result after the pandoc transformation DOCX -> MD should look
>>>>>>>> something like this
>>>>>>>>
>>>>>>>> ![Abb. 1: title](ip-logo.png){ #image1 }
>>>>>>>>
>>>>>>>> I tried to add the caption "Abb. 1: title" in Word on a newline
>>>>>>>> after the image and choosed the style "Image Caption", but that did not
>>>>>>>> work. Also if I use the Word functionality to add a caption to the image,
>>>>>>>> that was again only parsed as an additional line of text. The only thing
>>>>>>>> which works is to format the image in Word and add some alternative
>>>>>>>> (hidden) text.
>>>>>>>>
>>>>>>>> Is there a more visible way to achieve the above markdown line from
>>>>>>>> a word document? How should I use the styles "Image Caption" or "Captioned
>>>>>>>> Image" in Word correctly such that pandoc will do something with them? Is
>>>>>>>> it normal that I don't see these styles in the native ATX output?
>>>>>>>>
>>>>>>>> I am using a German version of Word on a windows machine with
>>>>>>>> pandoc version 2.10.1.
>>>>>>>>
>>>>>>>> Thank you very much for any hint!
>>>>>>>> Philipp
>>>>>>>> --
>>>>>>>> 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/601f7c12-1b83-43df-97ca-4288126ac4e4n%40googlegroups.com
>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/601f7c12-1b83-43df-97ca-4288126ac4e4n%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/Pm6_hoJ2Zao/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/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%40mail.gmail.com
>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3Jic%2BxJzRqZqKc68bgq9%2BhJu4ggT8QVYywREoNjxJJ9Tw%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/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og%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/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/fa0d0129-89db-209c-3d4b-0f54fbc34dc3%40mailbox.org?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/Pm6_hoJ2Zao/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/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CALu%3Dv3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag%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/CAAjpKCSks1XoOZDm%3DJtN05p3yt0JJVbnRkdVe%2BwidioOmtncyw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCSks1XoOZDm%3DJtN05p3yt0JJVbnRkdVe%2BwidioOmtncyw%40mail.gmail.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/Pm6_hoJ2Zao/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/CADAJKhBaLpj8kFSW4nPxN_R6b3hp3%2BfQCQ3hJ_NOH4n1B10G%3DA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBaLpj8kFSW4nPxN_R6b3hp3%2BfQCQ3hJ_NOH4n1B10G%3DA%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/CAAjpKCSUwiw6sFXAfxoAmiME6L2nYtPym03PcWACY_tK9BxKCw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CAAjpKCSUwiw6sFXAfxoAmiME6L2nYtPym03PcWACY_tK9BxKCw%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/CADAJKhCjv5B8%2Bq8mf-RrXUCc0%2BvMVqmf6vO87cABebv%2BP--EzQ%40mail.gmail.com.

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

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

end of thread, other threads:[~2020-08-15 16:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13 20:09 How to add a (visible) image caption in DOCX for pandoc transformations? Philipp Zumstein
     [not found] ` <601f7c12-1b83-43df-97ca-4288126ac4e4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-08-13 20:22   ` Leonard Rosenthol
     [not found]     ` <CALu=v3Jic+xJzRqZqKc68bgq9+hJu4ggT8QVYywREoNjxJJ9Tw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-08-13 20:43       ` Philipp Zumstein
     [not found]         ` <CAAjpKCQxWSdbcYLQ0hEDNM-G0RZEzaST0a6QPBd40aJGtHs1og-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-08-13 20:59           ` Denis Maier
     [not found]             ` <fa0d0129-89db-209c-3d4b-0f54fbc34dc3-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
2020-08-13 22:25               ` Leonard Rosenthol
     [not found]                 ` <CALu=v3KF2OLWfzNVFuConLm07t6cT-WHW0McykWoX3Rk1oLgag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-08-14 21:20                   ` Philipp Zumstein
     [not found]                     ` <CAAjpKCR8ROFDn8pmGoh=HWMLGyuVq7L=GVx4X9nG+eTmKv4KgQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-08-15  9:25                       ` Philipp Zumstein
     [not found]                         ` <CAAjpKCSks1XoOZDm=JtN05p3yt0JJVbnRkdVe+widioOmtncyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-08-15  9:57                           ` Dmitriy Krasilnikov
2020-08-15 13:54                           ` BPJ
2020-08-15 16:20                             ` Philipp Zumstein
     [not found]                               ` <CAAjpKCSUwiw6sFXAfxoAmiME6L2nYtPym03PcWACY_tK9BxKCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-08-15 16:40                                 ` BPJ
2020-08-13 20:23   ` Denis Maier
     [not found]     ` <a2555e89-5f0b-b0cd-2d52-bec1c9290168-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
2020-08-13 20:49       ` Philipp Zumstein

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