我如何才能将问题和 TikZ 图形对齐?

我如何才能将问题和 TikZ 图形对齐?
\documentclass[10pt]{exam}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\pagestyle{empty}
\newcommand{\degre}{\ensuremath{^\circ}}
\begin{document}
\definecolor{qqwuqq}{rgb}{0,0.39,0}
\definecolor{xdxdff}{rgb}{0.49,0.49,1}
\begin{questions}
\question Find the value of $AC$ in the following diagram.
\begin{figure}[htb]
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(-5,-1) rectangle (1,5);
\draw[color=qqwuqq,fill=qqwuqq,fill opacity=0.1] (0,0.59) -- (-0.59,0.59) -- (-0.59,0) -- (0,0) -- cycle; 
\draw (0,0)-- (0,4);
\draw (0,4)-- (-3.84,0);
\draw (0,0)-- (-3.84,0);
\draw [shift={(-3.84,0)}] plot[domain=0:0.81,variable=\t]({1*0.97*cos(\t r)+0*0.97*sin(\t r)},{0*0.97*cos(\t r)+1*0.97*sin(\t r)});
\draw (-2.82,1.02) node[anchor=north west] {$ \theta $};
\draw (-2.65,2.91) node[anchor=north west] {$ 85 m $};
\begin{scriptsize}
\fill [color=xdxdff] (0,0) circle (1.5pt);
\draw[color=xdxdff] (0.34,-0.21) node {$B$};
\fill [color=xdxdff] (0,4) circle (1.5pt);
\draw[color=xdxdff] (0.22,4.36) node {$C$};
\fill [color=xdxdff] (-3.84,0) circle (1.5pt);
\draw[color=xdxdff] (-3.93,-0.29) node {$A$};
\draw[color=qqwuqq] (-0.7,0.85) node {$90\textrm{\degre}$};
\end{scriptsize}
\end{tikzpicture}
\caption{\thequestion}\end{figure}
\begin{choices}
\choice fkjj
\choice dji
\choice djfij
\choice jnfiejk
\end{choices}

\end{questions}

\end{document}

在上面的代码中我得到了这个输出。 在此处输入图片描述

但我希望图表必须出现在问题旁边。即问题的右侧,而选项必须位于左侧。或者实际上,选项和图表必须仅占据 4 行空间。请帮我做到这一点。

答案1

基本上有以下几件事要做:

  • 删除figure环境,因为图片不应该浮动
  • 使用baseline选项,这样句子就不会与图像底部对齐,而是与顶部对齐。你甚至可以进一步移动,例如这里:

    \question Find the value of $AC$ in the following diagram.
    \begin{tikzpicture}[...,
           baseline={([yshift={-0.75cm}]current bounding box.north)}]
    ...
    

相关内容