0
点赞
收藏
分享

微信扫一扫

LaTeX插入图像

流计算Alink 2022-04-13 阅读 77
经验分享

宏 包:\usepackage{graphicx}

语 法:\includegraphics[<选项>]{<文件名>}     (文件名后缀可加可不加)

格 式:EPS,PDF,PNG,JPEG,BMP

目 录:\graphicspath{{figures/}} % 指定文件搜索路径为当前目录下的figures目录

更多用法可在cmd.exe中输入texdoc graphicsx打开graphicx文档进行查看

  • 直接插入图像
    % 导言区
    \documentclass{article}
    \usepackage{ctex}
    
    % 插入图像
    \usepackage{graphicx}
    
    % 指定图像文件的搜索路径
    \graphicspath{{figures/}}  % 图片在当前目录下的figures目录
    
    % 正文区
    \begin{document}
        \LaTeX{}中的插图:
    
        \includegraphics{ra1}
        \includegraphics{ra2}
        \includegraphics{ra3}
    
    \end{document}

     直接插入图像通常会由于图片过大不能正常排版,可以通过设置\includegraphics[<选项>]{<文件名>}中选项进行调整

  • 设置缩放因子scale

        缩放因子为0.3
    
        \includegraphics[scale=0.3]{ra1}
        \includegraphics[scale=0.3]{ra2}
        \includegraphics[scale=0.3]{ra3}

  • 固定高度height 和固定宽度width

        固定高度为2cm
    
        \includegraphics[height=2cm]{ra1}
        \includegraphics[height=2cm]{ra2}
        \includegraphics[height=2cm]{ra3}
    
        固定宽度为2cm
    
        \includegraphics[width=2cm]{ra1}
        \includegraphics[width=2cm]{ra2}
        \includegraphics[width=2cm]{ra3}

  •  指定相对版型高度\宽度倍数

        0.1相对高度
    
        \includegraphics[height=0.1\textheight]{ra1}
        \includegraphics[height=0.1\textheight]{ra2}
        \includegraphics[height=0.1\textheight]{ra3}
    
        0.2相对宽度
    
        \includegraphics[width=0.2\textwidth]{ra1}
        \includegraphics[width=0.2\textwidth]{ra2}
        \includegraphics[width=0.2\textwidth]{ra3}
    

  • 同时指定多个参数,例如旋转角度和宽度,多个参数之间用,分隔
  • 度数为正逆时针旋转,度数为负顺时针旋转
    旋转-45,45,以及0.2相对宽度

    \includegraphics[angle=-45,width=0.2\textwidth]{ra1}
    \includegraphics[width=0.2\textwidth]{ra2}
    \includegraphics[angle=45,width=0.2\textwidth]{ra3}

 

 

举报

相关推荐

0 条评论