如何使用pandoc引用Markdown中的图形? [英] How do I make a reference to a figure in markdown using pandoc?

查看:398
本文介绍了如何使用pandoc引用Markdown中的图形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在用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)

我想参考一下,因为在将markdown转换为pdf后,图像在之后放置了一两页,文档没有任何意义.

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.

更新:

我在 Ryan的答案 .google.com/group/pandoc-discuss/browse_thread/thread/33118abe7348d3c7/4a42442657a96414?#4a42442657a96414>该帖子,我无法使其正常运行. 显然是代码:

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

应产生:

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

相反,我获得:

\begin{figure}[htbp]
\centering
\includegraphics{image.png}
\caption{Alt text}
\end{figure}

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

我注意到了两个问题:

  • \label{image}未出现:未创建引用.
  • (\autoref{image})变为\href{\#image}{image}:未检测到交叉引用.
  • \label{image} doesn't appear : no reference is created.
  • (\autoref{image}) becomes \href{\#image}{image} : no cross reference is detected.

然后,当我将其转换为pdf时,显然不会链接至图像.有一个链接,但没有任何链接.

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.

任何帮助将不胜感激!

推荐答案

在pandoc中,您甚至可以执行以下操作:

In pandoc you can even do:

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

这篇关于如何使用pandoc引用Markdown中的图形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆