以网格样式对齐图像

以网格样式对齐图像

我试图在 LaTeX 中将图像以网格状格式对齐,并已这样做:

\documentclass[a4paper,11pt,fleqn,titlepage]{article}
\usepackage[margin=2.5cm]{geometry}                % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                   % ... or a4paper or a5paper or ... 
%\geometry{landscape}                % Activate for for rotated page geometry
\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{ulem}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{epstopdf}
\usepackage{longtable}
\usepackage{color}
\usepackage{showframe}
\usepackage{subfigure}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

\begin{document}

\newpage

\begin{figure}[!ht]
\centering
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-4.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-5.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-6.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-7.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-8.eps}}}
\vspace{1cm}
\centering
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-9.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-10.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-11.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-12.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-13.eps}}}
\vspace{1cm}
\centering
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-14.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-15.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-16.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-17.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-18.eps}}}
\vspace{1cm}
\centering
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-19.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-20.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-21.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-22.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-23.eps}}}
\vspace{1cm}
\centering
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-24.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-25.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-26.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-27.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-28.eps}}}
\vspace{1cm}
\centering
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-29.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-30.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-31.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-32.eps}}}
\hspace{0cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\includegraphics[trim=5cm 8cm 6cm 8cm, clip=true, scale=0.25]{Polyhedra/Polyhedron-33.eps}}}
\end{figure}

\newpage
\end{document}

对于前两行图像(每行有五行),这对我来说很有效,但是当到达第三行图像时,图像之间的垂直空间会增加,我不知道为什么。

有没有办法让我的图像对齐以便:

  1. 整个图形垂直顶部对齐,并且水平居中对齐到新页面。

  2. subfigures每行有五个。

  3. 它们subfigures在图中水平居中对齐。

  4. subfigures每行都按顶部垂直对齐。

  5. subfigures同一行之间的间距以及行与行之间的间距均相等。

如果您想象一张纸,纸中央有网格图案,网格中每个方格中央都有图像,这就是我想要的。我感觉我要么非常接近,要么就是做错了什么!任何帮助都将不胜感激。

注意:我只放置了方框来查看图像的开始和结束位置,这些方框应被删除。

答案1

您希望每个段落前面都有一个空白行,\vspace以便空格出现在该点,当前它们都被设置为\vspace段落内的单个段落,具有已定义的(但通常是不想要的)行为

此外,除非您有不需要的单独字幕,否则subfigure您可以直接使用\includegraphics


在制作示例时,请尝试通过删除未使用的包和不依赖不可用的图像来使其最小化,例如:

\documentclass[a4paper,11pt,fleqn,titlepage]{article}
\usepackage[margin=2.5cm]{geometry}                % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                   % ... or a4paper or a5paper or ... 
%\geometry{landscape}                % Activate for for rotated page geometry
\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{subfigure}


\begin{document}

\newpage

\begin{figure}[!ht]
\centering
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}

\vspace{1cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}

\vspace{1cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}

\vspace{1cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}

\vspace{1cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}

\vspace{1cm}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\subfigure{\setlength\fboxsep{0pt}\setlength\fboxrule{0.5pt}
\fbox{\rule{2.5cm}{2cm}}}
\end{figure}

\newpage
\end{document}

在此处输入图片描述

相关内容