为什么我的乳胶枚举给我一个很大的差距?
我正在乳胶进行考试,但是由于某种原因,图像和下一个文本之间的空白空间很大。
\documentclass{article}%
\usepackage{tikz}%
\usepackage{enumitem}%
%
%
%
\begin{document}%
\begin{enumerate}
\item{What is the bitstring of this $4\times 4$ pixel image?\newline
\phantom{abcdefg}\begin{tikzpicture}[scale=.7]
\path[fill=gray] (0,0) -- (1,0) -- (1,1) -- (0,1) -- (0,0);
\path[fill=gray] (0,2) -- (1,2) -- (1,3) -- (0,3) -- (0,2);
\path[fill=gray] (3,2) -- (4,2) -- (4,3) -- (3,3) -- (3,2);
\path[fill=gray] (2,2) -- (3,2) -- (3,3) -- (2,3) -- (2,2);
\path[fill=gray] (1,2) -- (2,2) -- (2,3) -- (1,3) -- (1,2);
\path[fill=gray] (2,1) -- (3,1) -- (3,2) -- (2,2) -- (2,1);
\path[fill=gray] (2,3) -- (3,3) -- (3,4) -- (2,4) -- (2,3);
\path[fill=gray] (3,3) -- (4,3) -- (4,4) -- (3,4) -- (3,3);
\path[fill=gray] (2,0) -- (3,0) -- (3,1) -- (2,1) -- (2,0);
\foreach \i in {0,...,4}{
\draw [thin,black] (\i,0) -- (\i,4) node [above] at (\i,-10){};
\draw [thin,black] (0,\i) -- (4,\i) node [above] at (\i,-10){};}
\end{tikzpicture}\begin{enumerate}
\item{$0011$ $1111$ $0010$ $1010$}
\item{$0011$ $1111$ $0010$ $1010$}
\item{$0011$ $1111$ $0010$ $1010$}
\item{$0011$ $1111$ $0010$ $1010$}
\item{$0011$ $1111$ $0010$ $1010$}
\end{enumerate}}
\end{enumerate}
\end{document}
I'm making an exam in LaTex, but for some reason there's a large empty space between the image and the next text in my enumerate environment.
\documentclass{article}%
\usepackage{tikz}%
\usepackage{enumitem}%
%
%
%
\begin{document}%
\begin{enumerate}
\item{What is the bitstring of this $4\times 4$ pixel image?\newline
\phantom{abcdefg}\begin{tikzpicture}[scale=.7]
\path[fill=gray] (0,0) -- (1,0) -- (1,1) -- (0,1) -- (0,0);
\path[fill=gray] (0,2) -- (1,2) -- (1,3) -- (0,3) -- (0,2);
\path[fill=gray] (3,2) -- (4,2) -- (4,3) -- (3,3) -- (3,2);
\path[fill=gray] (2,2) -- (3,2) -- (3,3) -- (2,3) -- (2,2);
\path[fill=gray] (1,2) -- (2,2) -- (2,3) -- (1,3) -- (1,2);
\path[fill=gray] (2,1) -- (3,1) -- (3,2) -- (2,2) -- (2,1);
\path[fill=gray] (2,3) -- (3,3) -- (3,4) -- (2,4) -- (2,3);
\path[fill=gray] (3,3) -- (4,3) -- (4,4) -- (3,4) -- (3,3);
\path[fill=gray] (2,0) -- (3,0) -- (3,1) -- (2,1) -- (2,0);
\foreach \i in {0,...,4}{
\draw [thin,black] (\i,0) -- (\i,4) node [above] at (\i,-10){};
\draw [thin,black] (0,\i) -- (4,\i) node [above] at (\i,-10){};}
\end{tikzpicture}\begin{enumerate}
\item{$0011$ $1111$ $0010$ $1010$}
\item{$0011$ $1111$ $0010$ $1010$}
\item{$0011$ $1111$ $0010$ $1010$}
\item{$0011$ $1111$ $0010$ $1010$}
\item{$0011$ $1111$ $0010$ $1010$}
\end{enumerate}}
\end{enumerate}
\end{document}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
空间是如此之大,因为您的foreach循环中的空节点离图片很远。由于这些节点无论如何都是空的,因此您可以将它们删除并获取所需的边界框:
The space is so big, because your empty nodes in the foreach loop are so far away from your picture. As these nodes are anyway empty, you can remove them and get the desired bounding box: