LaTeX杂货铺

2018-11-19  本文已影响0人  5john家安

本页内容为本人在使用LaTex写文档过程中遇到的问题及解决

1.用xelatex编译引擎编译latex源码文件时,如果引入的是截图,会报如下no BoundingBox错误
LaTeX Error: Cannot determine size of graphic in ./image/0.5.png (no BoundingBox).

解决:使用bb这个参数,如下示例

\includegraphics[bb= 0 0 500 400, width=3.5cm]{./image/test.png}
2.双栏排版时图片太大,超过边线,且使用scale、bb、width等参数无效

解决:用inkscape软件将图片做成eps等矢量图,再用photoshop打开矢量图,改变图片大小,再导出成png等图片文件(或可先试一下直接用画图板调整图片大小

3.实现多张图片并排显示

解决:使用subfig宏包,在figure环境中使用\subfigure[]{}命令,示例如下
注意:要引入图片如果是截图,可使用本页第1条方案;接着发现显示有大小不一等异常,可按本页第2条方案处理成大小一样

\begin{figure}[h]
  \centering
  \subfigure[t=0.2s]{ 
    \includegraphics[bb= 0 0 500 400, width=3.5cm]{./image/0.2.png}
  }
  \subfigure[t=0.5s]{
    \includegraphics[bb= 0 0 500 400, width=3.5cm]{./image/0.5.png}
  }
  
  \subfigure[t=1.0s]{
    \includegraphics[bb= 0 0 500 400, width=3.5cm]{./image/1.0.png}
  }
  \subfigure[t=1.5s]{
    \includegraphics[bb= 0 0 500 400, width=3.5cm]{./image/1.5.png}
  }
  \caption{PF粒子分布}
  \label{fig:PFdistribution}
  \end{figure}
image.png
4.发现使用subfigure以及bb和scale参数并排显示截图时间距太大了

解决:自己计算使用scale或width等参数后图片大小,使得bb(boundingbox的缩写)的后两个数为调整后图片的的大小
示例:原图大小1600x1350,使用scale参数为0.2,所以引入的图片的大小为320x270,所以bb=0 0 320 270

\begin{figure}[h]
  \centering
  \subfigure[t=0.2s]{ 
    \includegraphics[bb= 0 0 320 270, scale=0.2]{./image/0.2.png}
  } 
  \hspace{-1ex}
\vspace{-1ex}
  \subfigure[t=0.5s]{
    \includegraphics[bb= 0 0 320 270, scale=0.2]{./image/0.5.png}
  }
  \hspace{-1ex}
\vspace{-1ex}
  \subfigure[t=1.0s]{
    \includegraphics[bb= 0 0 320 270, scale=0.2]{./image/1.0.png}
  }
  \hspace{-1ex}
  \vspace{-1ex}
  \subfigure[t=1.5s]{
    \includegraphics[bb= 0 0 320 270, scale=0.2]{./image/1.5.png}
  }
  \caption{PF粒子分布}
  \label{fig:PFdistribution}
  \end{figure}
image.png
5.既然bb(boundingbox的缩写)和实际引入的图片的大小吻合了,发现图片间间距需要调整

解决:在两\subfigure间使用 \vspace{0.0in}\hspace{0.1in}两命令调整间距,可以是负数

image.png
上一篇 下一篇

猜你喜欢

热点阅读