
솔루션 환경 내에서 세트를 스케치하고 싶지만 시도하면 다음 오류 메시지가 표시됩니다.
LaTeX Error: Float(s) lost.
이 문제를 어떻게 해결합니까? 내 코드의 일부는 다음과 같습니다.
\documentclass[a4paper,11pt]{exam} % A4 paper and 11pt font size
\usepackage[english]{babel} % English language
\usepackage{tikz} % Tikz package for sketching
\usepackage{amsmath,amsfonts,amsthm,amssymb} %% American Mathematical Society packages
\newcommand{\x}{\mathbf{x}}
\begin{document}
\begin{question}
\question Let $\mathbf 0 = (0,0)$. Sketch the set $\{\x \in \mathbb R^2 d_m(\mathbf 0, x )\le 1\} $.
\begin{solution}
\begin{figure}
\centering
\begin{tikzpicture} [scale =3]
\draw[thick, ->] (-1.5,0) -- (1.5,0);
\draw[thick, ->] (0,-1.5) -- (0,1.5)
\draw (-1,-1) rectangle (1,1);
\end{tikzpicture}
\caption*{$d_m(\mathbb 0, \x) \le 1$
\end{figure}
\end{solution}
\end{questions}
답변1
figure
당신은 환경을 원하지 않지만 minipage
:
\documentclass[a4paper,11pt]{exam} % A4 paper and 11pt font size
\usepackage[english]{babel} % English language
\usepackage{tikz} % Tikz package for sketching
\usepackage{amsmath,amsfonts,amsthm,amssymb} %% American Mathematical Society packages
\newcommand{\x}{\mathbf{x}}
\printanswers
\begin{document}
\begin{questions}
\question
Let $\mathbf{0} = (0,0)$. Sketch the set
$\{\x \in \mathbb{R}^2 : d_m(\mathbf{0}, \x)\le 1\}$.
\begin{solution}
\begin{minipage}{\linewidth}
\centering
\begin{tikzpicture} [scale =3]
\draw[thick, ->] (-1.5,0) -- (1.5,0);
\draw[thick, ->] (0,-1.5) -- (0,1.5);
\draw (-1,-1) rectangle (1,1);
\end{tikzpicture}
\end{minipage}
\end{solution}
\end{questions}
\end{document}
타이핑 등을 훈련하면 \mathbf{0}
더 행복해질 것입니다.