pandox怎么用_如何使用pandoc引用Markdown中的图形?

I'm currently writing a document in markdown and I'd like to make a reference to an image from my text.

this is my text, I want a reference to my image1 [here]. blablabla

![image1](img/image1.png)

I want to do that reference because after converting my markdown to pdf, images get placed in one or two pages after and the document doesn't make any sense.

UPDATE:

I've tried Ryan's answer in that post and I can't make it working.

Apparently the code :

[image]: image.png "Image Title"

![Alt text][image]

A reference to the [image](#image).

should produce:

\begin{figure}[htbp]

\centering

\includegraphics[keepaspectratio,width=\textwidth,height=0.75\textheight]{i mage.png}

\caption{Alt text}

\label{image}

\end{figure}

A reference to the image (\autoref{image}).

instead, I obtain:

\begin{figure}[htbp]

\centering

\includegraphics{image.png}

\caption{Alt text}

\end{figure}

A reference to the \href{\#image}{image}.

I've noticed two problems :

\label{image} doesn't appear : no reference is created.

(\autoref{image}) becomes \href{\#image}{image} : no cross reference is detected.

And then, when I convert that to pdf it obviously doesn't link to the image. There's a link, but it doesn't link to anything.

Any help would be much appreciated!!

解决方案

In pandoc you can even do:

![This is the caption\label{mylabel}](/url/of/image.png)

See figure \ref{mylabel}.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值