完整代码在这里
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb,amsfonts, enumitem, fancyhdr, color, comment, graphicx, environ,subcaption}
\pagestyle{fancy}
\setlength{\headheight}{65pt}
\newenvironment{problem}[2][Problem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{sol}
{\emph{Solution:}
}
{
\qed
}
\specialcomment{com}{ \color{blue} \textbf{Comment:} }{\color{black}} %for instructor comments while grading
\NewEnviron{probscore}{\marginpar{ \color{blue} \tiny Problem Score: \BODY \color{black} }}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lhead{Student} %replace with your name
\rhead{MAT 4170 \\ Aug 30 2019 \\ HW 1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{problem}{1}
How do we know there are only six symmetries of the equilateral triangle? Prove that can be there no more.
\end{problem}
\begin{sol}
\\
\begin{figure}[t]
\centering
\includegraphics[height=8cm]{equilateraltrianglesymmetries.jpg}
\caption{Our minimal list of six symmetries of a triangle (Is it a maximal list as well?)}
\label{fig:my_label}
\end{figure}
First, note the following six distinct symmetries of our equilateral triangle in Figure 1. From this we can observe that there are \textit{at least} 6 symmetries. Now, assume that we have a seventh symmetry that maps our original triangle ABC, to some new configuration of points A, B, and C. Note that there are only six possible permutations of three distinct objects (a result obtained from combinatorial counting). Hence, any seventh symmetry obtained must be by definition one of our original six symmetries.
\end{sol}
\\
\\
\begin{problem}{2}
What happens if you combine two of the six symmetries? Is the combination a new symmetry or equivalent to one of the original six? Prove your conjecture.
\end{problem}
\begin{sol}
Let $T_1, T_2$ be some distinct transformations of the plane. By definition, a symmetry is a 1-1 transformation (i.e. an isometry) that maps a geometric figure to itself. Since transformations are a special class of function $f: \mathbb{R}^2 \mapsto \mathbb{R}^2$, the composition of two symmetries of functions are also symmetries, by extension from the notion that compositions of isometries are also isometries.
\begin{figure}[t]
\centering
\begin{subfigure}[t]{0.3\linewidth}
\includegraphics[width=\linewidth]{ABC.jpg}
\caption{Original figure}
\end{subfigure}
\begin{subfigure}[t]{0.3\linewidth}
\includegraphics[width=\linewidth]{BAC.jpg}
\caption{Rotate 120 degrees CW}
\end{subfigure}
\begin{subfigure}[t]{0.3\linewidth}
\includegraphics[width=\linewidth]{BCA.jpg}
\caption{One vertical flip}
\end{subfigure}
\caption{The two operations here produced one of the original six, specifically the $4^{th}$ symmetry in Figure 1.}
\label{fig:coffee3}
\end{figure}
\end{sol}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
有问题的部分在这里:当我希望它立即跟随我对相应问题的解决方案时,它不断弹出在一个全新页面的中心。
\begin{sol}
Let $T_1, T_2$ be some distinct transformations of the plane. By definition, a symmetry is a 1-1 transformation (i.e. an isometry) that maps a geometric figure to itself. Since transformations are a special class of function $f: \mathbb{R}^2 \mapsto \mathbb{R}^2$, the composition of two symmetries of functions are also symmetries, by extension from the notion that compositions of isometries are also isometries.
\begin{figure}[t]
\centering
\begin{subfigure}[t]{0.3\linewidth}
\includegraphics[width=\linewidth]{ABC.jpg}
\caption{Original figure}
\end{subfigure}
\begin{subfigure}[t]{0.3\linewidth}
\includegraphics[width=\linewidth]{BAC.jpg}
\caption{Rotate 120 degrees CW}
\end{subfigure}
\begin{subfigure}[t]{0.3\linewidth}
\includegraphics[width=\linewidth]{BCA.jpg}
\caption{One vertical flip}
\end{subfigure}
\caption{The two operations here produced one of the original six, specifically the $4^{th}$ symmetry in Figure 1.}
\label{fig:coffee3}
\end{figure}
\end{sol}
答案1
我假设您实际上不希望图像从代码中提到的位置浮动。 根据这个假设,我提出了以下代码:
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb,amsfonts, enumitem, fancyhdr, color, comment, environ,subcaption}
\usepackage[demo]{graphicx} % Remove demo option in your real document.
\usepackage{caption} % Added for the captionsetup command
\pagestyle{fancy}
\setlength{\headheight}{65pt}
\newenvironment{problem}[2][Problem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{sol}
{\emph{Solution:}
}
{
\qed
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lhead{Student} %replace with your name
\rhead{MAT 4170 \\ Aug 30 2019 \\ HW 1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{problem}{1}
How do we know there are only six symmetries of the equilateral triangle? Prove that can be there no more.
\end{problem}
\begin{sol}
\noindent\begin{minipage}{\textwidth}
\centering
\captionsetup{type=figure}
\setlength\belowcaptionskip{10pt}
\includegraphics[height=8cm]{equilateraltrianglesymmetries.jpg}
\caption{Our minimal list of six symmetries of a triangle (Is it a maximal list as well?)}
\label{fig:my_label}
\end{minipage}
First, note the following six distinct symmetries of our equilateral triangle in Figure 1. From this we can observe that there are \textit{at least} 6 symmetries. Now, assume that we have a seventh symmetry that maps our original triangle ABC, to some new configuration of points A, B, and C. Note that there are only six possible permutations of three distinct objects (a result obtained from combinatorial counting). Hence, any seventh symmetry obtained must be by definition one of our original six symmetries.
\end{sol}
\bigskip
\begin{problem}{2}
What happens if you combine two of the six symmetries? Is the combination a new symmetry or equivalent to one of the original six? Prove your conjecture.
\end{problem}
\begin{sol}
Let $T_1, T_2$ be some distinct transformations of the plane. By definition, a symmetry is a 1-1 transformation (i.e. an isometry) that maps a geometric figure to itself. Since transformations are a special class of function $f: \mathbb{R}^2 \mapsto \mathbb{R}^2$, the composition of two symmetries of functions are also symmetries, by extension from the notion that compositions of isometries are also isometries.
\noindent
\begin{minipage}{\textwidth}
\centering
\captionsetup{type=figure}
\begin{subfigure}[t]{0.3\linewidth}
\includegraphics[width=\linewidth]{ABC.jpg}
\caption{Original figure}
\end{subfigure}
\begin{subfigure}[t]{0.3\linewidth}
\includegraphics[width=\linewidth]{BAC.jpg}
\caption{Rotate 120 degrees CW}
\end{subfigure}
\begin{subfigure}[t]{0.3\linewidth}
\includegraphics[width=\linewidth]{BCA.jpg}
\caption{One vertical flip}
\end{subfigure}
\caption{The two operations here produced one of the original six, specifically the $4^{th}$ symmetry in Figure 1.}
\label{fig:coffee3}
\end{minipage}
\end{sol}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
附注:为了避免手动编号问题,您可以定义并使用新的计数器,如下所示:
\newcounter{myproblem}
\setcounter{myproblem}{1}
\newenvironment{problem}[1][Problem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries \themyproblem.}\stepcounter{myproblem}]}{\end{trivlist}}