public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* transform  md to tex when svg in md
@ 2021-07-21  6:09 dualer
       [not found] ` <4c8415e0-b8b7-4d79-b7a2-78c4dff2cac7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: dualer @ 2021-07-21  6:09 UTC (permalink / raw)
  To: pandoc-discuss


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

For example, I have a svg picture in markdown document:

```
This is a svg picture[a red circle]:

<svg id="svg" viewbox="41.308467864990234,13.39846420288086,124.96306610107422,124.96306610107422" style="height:124.96306610107422"><circle cx="103.79" cy="75.88" fill="red" stroke="#6190e8" stroke-width="2" r="52.481531989834274" d="M 51.30846801016573 75.88 a 52.481531989834274 52.481531989834274 0 1 0 104.96306397966855 0a 52.481531989834274 52.481531989834274 0 1 0 -104.96306397966855 0 Z"></circle></svg>  

```
How to use pandoc to transform it to latex format? Does some packages need 
to to be added?

-- 
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/4c8415e0-b8b7-4d79-b7a2-78c4dff2cac7n%40googlegroups.com.

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

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

* Re: transform  md to tex when svg in md
       [not found] ` <4c8415e0-b8b7-4d79-b7a2-78c4dff2cac7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-07-21  7:45   ` Joost Kremers
       [not found]     ` <8735s8umwr.fsf-97jfqw80gc6171pxa8y+qA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Joost Kremers @ 2021-07-21  7:45 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw; +Cc: dualer


On Tue, Jul 20 2021, dualer wrote:
> For example, I have a svg picture in markdown document:
>
> ```
> This is a svg picture[a red circle]:
>
> <svg id="svg"
> viewbox="41.308467864990234,13.39846420288086,124.96306610107422,124.96306610107422"
> style="height:124.96306610107422"><circle cx="103.79" cy="75.88" fill="red"
> stroke="#6190e8" stroke-width="2" r="52.481531989834274" d="M 51.30846801016573
> 75.88 a 52.481531989834274 52.481531989834274 0 1 0 104.96306397966855 0a
> 52.481531989834274 52.481531989834274 0 1 0 -104.96306397966855 0
> Z"></circle></svg>
>
> ```
> How to use pandoc to transform it to latex format? Does some packages need 
> to to be added?

AFAIK LaTeX does not support svg by default or even through the graphicx
package. There is a LaTeX package that makes it possible to include svg images
in LaTeX files: <https://ctan.org/pkg/svg?lang=en>. It requires Inkscape to be
installed to convert the files to something LaTeX can understand.

That being said, you'll still need to deal with getting the right LaTeX code
from the Markdown input file. Unfortunately, I can't help you there.

-- 
Joost Kremers
Life has its moments


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

* Re: transform  md to tex when svg in md
       [not found]     ` <8735s8umwr.fsf-97jfqw80gc6171pxa8y+qA@public.gmane.org>
@ 2021-07-21 17:20       ` John MacFarlane
       [not found]         ` <m27dhj4m8d.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2021-07-21 17:20 UTC (permalink / raw)
  To: Joost Kremers, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw; +Cc: dualer


Pandoc can handle markdown + svg images -> pdf via tex;
it does this by using an external program to convert the
svg to png.

Going directly to tex, you'll just get includegraphics
with the svg file, which won't work without a special
package, as Joost notes.

Inline svg (what you have here) is another matter.
Pandoc will parse this as raw HTML, which won't be transmitted
at all to LaTeX.

We could think about parsing it instead as an image
with a data: URI...if you'd like to suggest this as
an enhancement on our issue tracker, go ahead.

Joost Kremers <joostkremers-97jfqw80gc6171pxa8y+qA@public.gmane.org> writes:

> On Tue, Jul 20 2021, dualer wrote:
>> For example, I have a svg picture in markdown document:
>>
>> ```
>> This is a svg picture[a red circle]:
>>
>> <svg id="svg"
>> viewbox="41.308467864990234,13.39846420288086,124.96306610107422,124.96306610107422"
>> style="height:124.96306610107422"><circle cx="103.79" cy="75.88" fill="red"
>> stroke="#6190e8" stroke-width="2" r="52.481531989834274" d="M 51.30846801016573
>> 75.88 a 52.481531989834274 52.481531989834274 0 1 0 104.96306397966855 0a
>> 52.481531989834274 52.481531989834274 0 1 0 -104.96306397966855 0
>> Z"></circle></svg>
>>
>> ```
>> How to use pandoc to transform it to latex format? Does some packages need 
>> to to be added?
>
> AFAIK LaTeX does not support svg by default or even through the graphicx
> package. There is a LaTeX package that makes it possible to include svg images
> in LaTeX files: <https://ctan.org/pkg/svg?lang=en>. It requires Inkscape to be
> installed to convert the files to something LaTeX can understand.
>
> That being said, you'll still need to deal with getting the right LaTeX code
> from the Markdown input file. Unfortunately, I can't help you there.
>
> -- 
> Joost Kremers
> Life has its moments
>
> -- 
> 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/8735s8umwr.fsf%40fastmail.fm.


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

* Re: transform md to tex when svg in md
       [not found]         ` <m27dhj4m8d.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
@ 2021-07-22  3:22           ` dualer
  0 siblings, 0 replies; 4+ messages in thread
From: dualer @ 2021-07-22  3:22 UTC (permalink / raw)
  To: pandoc-discuss


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

Ok, I have opened an issue there. Thanks for your suggestion.

在2021年7月22日星期四 UTC+8 上午1:21:05<John MacFarlane> 写道:

>
> Pandoc can handle markdown + svg images -> pdf via tex; 
> it does this by using an external program to convert the 
> svg to png. 
>
> Going directly to tex, you'll just get includegraphics 
> with the svg file, which won't work without a special 
> package, as Joost notes. 
>
> Inline svg (what you have here) is another matter. 
> Pandoc will parse this as raw HTML, which won't be transmitted 
> at all to LaTeX. 
>
> We could think about parsing it instead as an image 
> with a data: URI...if you'd like to suggest this as 
> an enhancement on our issue tracker, go ahead. 
>
> Joost Kremers <joostk...-97jfqw80gc6171pxa8y+qA@public.gmane.org> writes: 
>
> > On Tue, Jul 20 2021, dualer wrote: 
> >> For example, I have a svg picture in markdown document: 
> >> 
> >> ``` 
> >> This is a svg picture[a red circle]: 
> >> 
> >> <svg id="svg" 
> >> 
> viewbox="41.308467864990234,13.39846420288086,124.96306610107422,124.96306610107422" 
>
> >> style="height:124.96306610107422"><circle cx="103.79" cy="75.88" 
> fill="red" 
> >> stroke="#6190e8" stroke-width="2" r="52.481531989834274" d="M 
> 51.30846801016573 
> >> 75.88 a 52.481531989834274 52.481531989834274 0 1 0 104.96306397966855 
> 0a 
> >> 52.481531989834274 52.481531989834274 0 1 0 -104.96306397966855 0 
> >> Z"></circle></svg> 
> >> 
> >> ``` 
> >> How to use pandoc to transform it to latex format? Does some packages 
> need 
> >> to to be added? 
> > 
> > AFAIK LaTeX does not support svg by default or even through the graphicx 
> > package. There is a LaTeX package that makes it possible to include svg 
> images 
> > in LaTeX files: <https://ctan.org/pkg/svg?lang=en>. It requires 
> Inkscape to be 
> > installed to convert the files to something LaTeX can understand. 
> > 
> > That being said, you'll still need to deal with getting the right LaTeX 
> code 
> > from the Markdown input file. Unfortunately, I can't help you there. 
> > 
> > -- 
> > Joost Kremers 
> > Life has its moments 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "pandoc-discuss" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/8735s8umwr.fsf%40fastmail.fm. 
>
>

-- 
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/255e85b3-06f5-4e8a-8c36-5587734e4c16n%40googlegroups.com.

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

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

end of thread, other threads:[~2021-07-22  3:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21  6:09 transform md to tex when svg in md dualer
     [not found] ` <4c8415e0-b8b7-4d79-b7a2-78c4dff2cac7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-07-21  7:45   ` Joost Kremers
     [not found]     ` <8735s8umwr.fsf-97jfqw80gc6171pxa8y+qA@public.gmane.org>
2021-07-21 17:20       ` John MacFarlane
     [not found]         ` <m27dhj4m8d.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-22  3:22           ` dualer

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