LaTeX中显示图像

目录

插入图片

假设现在有张图片,路径为./images/universe.jpg,希望导入到文档中,代码如下。

\documentclass{article}
\usepackage{graphicx} % 插入图片必要的宏包
\graphicspath{ {./images/} } %主目录下包含图片的路径

\begin{document}
The universe is immense and it seems to be homogeneous, 
in a large scale, everywhere we look at.

\includegraphics{universe} % 插入图片(输入图片前缀名)

\end{document}

在这里插入图片描述
补充
1.可以使用绝对路径。

\graphicspath{ {c:/user/images/} }

2.可以同时使用两个包含图片的文件夹

\graphicspath{ {./images1/}{./images2/} }

图片添加注解标签和引用

\documentclass{article}
\usepackage{graphicx}
\graphicspath{ {images/} }
 
\begin{document}

\begin{figure}[h]
    \centering
    \includegraphics[width=0.25\textwidth]{mesh}
    \caption{a nice plot}
    \label{fig:mesh1}
\end{figure}
 
As you can see in the figure \ref{fig:mesh1}, the 
function grows near 0. Also, in the page \pageref{fig:mesh1} 
is the same example.

\end{document}

在这里插入图片描述

之后,还会补充一些关于插入图片的用法。现在发现latex真的很方便,通过labelref对应,引用的Figure编号和页码都自动设置。

参考

1.Overleat-Inserting_Images

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值