枚举和图像顺序的问题

枚举和图像顺序的问题

我偶尔会使用 LaTeX,但枚举时遇到了问题。问题在于图像相对于数字的排序。我在下面附上了问题的屏幕截图。问题 1 通过在 \item 后添加句点来解决。这可以强制将图像置于问题编号之后。下面是问题 2 和问题 3,显示了在 \item 后没有任何字符和有 \phantom{} 时的情况。如您所见,我不希望问题编号位于图像之后。

我好像找不到讨论这个问题的帖子。非常感谢!

编辑:这是代码。如果有人能告诉我如何发布它,因为我在其他帖子中看到了代码,我会非常感激!

\documentclass[10pt,letterpaper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=1in, right=1in, top=0.5in, bottom=1in]{geometry}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{epstopdf}
\usepackage{enumerate}
\usepackage{multicol}
\usepackage{float}



\setcounter{tocdepth}{4}



\begin{document}

Find the area of the following shapes
\begin{enumerate}[(1)]
\item .
%
\begin{figure}[H]
   \centering
   \includegraphics[width=1.5in]{circle.png} 
\end{figure}
%
\item 
%
\begin{figure}[H]
   \centering
   \includegraphics[width=2.5in]{triangle.png} 
\end{figure}
%
\item  \phantom{}
%
\begin{figure}[H]
   \centering
   \includegraphics[width=2.5in]{trapezoid.png} 
\end{figure}
%
\end{enumerate}
\end{document} 

在此处输入图片描述

答案1

不是使用figure环境:

\documentclass{article}
\usepackage{enumerate}
\usepackage{graphicx}
\newcommand\ItemImage[2][]{%
    \hfill\raisebox{\dimexpr-\height+\baselineskip}{\includegraphics[#1]{#2}}\hfill~}
\begin{document}        
Some text before

\begin{enumerate}[(1)]
    \item \ItemImage[height=1cm]{tiger}
    \item \ItemImage[height=2cm]{tiger}
    \item \ItemImage[height=3cm]{tiger}
\end{enumerate}
\end{document}

在此处输入图片描述

答案2

\documentclass[12pt]{article}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\begin{figure}[htp]
\centering  
\definecolor{ttqqqq}{rgb}{0.2,0.,0.}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(2.6266003997210037,2.514396631043019) rectangle (8.533772650288498,7.661239780052299);
\draw [color=ttqqqq] (5.609429951987758,5.10731382353633) circle (2.0743686540158026cm);
\draw [color=ttqqqq] (3.536912047343563,5.194920031607253)-- (7.681947856631956,5.019707615465408);
\draw (6.194298491647906,5.789660453139834) node[anchor=north west] {$8 cm$};
\begin{scriptsize}
\draw [fill=ttqqqq] (5.609429951987758,5.10731382353633) circle (1.0pt);
\draw[color=ttqqqq] (5.667916805953773,5.555713037275775) node {$A$};
\draw [fill=ttqqqq] (3.536912047343563,5.194920031607253) circle (1.0pt);
\draw[color=ttqqqq] (3.19197332139248,5.302270003423046) node {$C$};
\draw [fill=ttqqqq] (7.681947856631956,5.019707615465408) circle (1.5pt);
\draw[color=ttqqqq] (7.812434784707649,5.302270003423046) node {$D$};
\end{scriptsize}
\end{tikzpicture}
\caption{Name of figure}
\end{figure}
\end{document}

相关内容