准备一本包含 70 张图片的书,只放入前 60 幅。使用 graphicx。
调用文件:
\addphoto{IMG_6977.jpg}
\addphoto{IMG_4494.jpg}
\addphoto{m - 159.jpg}
\addphoto{IMG_0853.jpg}
\addphoto{IMG_3386.jpg}
\addphoto{m - 40.jpg}
\addphoto{IMG_3529.jpg}
\addphoto{IMG_7007.jpg}. <- Error occurs before this file (#61), no photos past here
\addphoto{m - 138.jpg}
\addphoto{IMG_0815.jpg}
\addphoto{m - 74.jpg}
.tex 文件顶部:
% Designed to run under "pdfLaTeX + BibTeX + MakeIndex" option in TeXworks
\documentclass[openright,twoside,12pt]{book}
% Page Setup:
\usepackage[
paperwidth=8.5in,
paperheight=8.5in,
bindingoffset=0.2in,
left=1.25in,
right=1.25in,
top=1.25in,
bottom=1.11in,
includefoot
]{geometry}
\usepackage{graphicx}
\usepackage[usenames]{xcolor}
% Header/Footer Page Numbering and color:
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\setlength{\footskip}{45pt}
\fancyfoot[C]{\textcolor{gray}{\thepage}}
\pagestyle{fancy}
% Path to graphics files (add if not in same subdirectory as master .tex file:
\graphicspath{ {images/} }
%\renewcommand{\floatpagefraction}{0.1}
% Insert Graphic on a single page with vspace and scaling:
\newcommand{\addphoto}[1]{
\begin{figure}
\vspace*{-.8cm}
\centering
\includegraphics[width=6.in]{#1}
\end{figure}
}
答案1
如果你需要有关错误消息的帮助,你应该说出错误是什么。如果是关于too many floats
你可以使用
\extrafloats{100}
允许更多但更好的方法是根本不使用浮点数。
这里没有必要使用,figure
因为你不想让图片浮动。替换
\begin{figure}
\vspace*{-.8cm}
\centering
经过
\begin{center}
和
\end{figure}
经过
\end{center}