我读数学书:如何写练习和答案 然后问自己:获得这样的布局的最佳方法是什么
使用xsim
。
梅威瑟:
\documentclass[ngerman,paper=A5]{scrreprt}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{babel}
\usepackage{multicol}
\setlength{\multicolsep}{2.0pt plus 2.0pt minus 1.5pt}% 50%/3 of original values
\usepackage[]{xsim}
\DeclareExerciseEnvironmentTemplate{basic}
{\par\noindent\textsf{\IfInsideSolutionTF{\bfseries\footnotesize L}{\bfseries\footnotesize A}\GetExerciseProperty{counter}} }
{\par}
\xsimsetup{
exercise/template = basic ,
solution/template = basic ,
exercise/the-counter = \arabic{exercise}. ,
print-solutions/headings = false,
%print-solutions/section = true
}
\begin{document}
\chapter{Various Tasks}
\section{Equations}
\begin{exercise}
$(x+2)(x+3)+x^2+7y+y^2+(y-3)^2=11$
\end{exercise}
\begin{solution}
no solution
\end{solution}
\begin{multicols}{2}
\begin{exercise}
$x+2=5$
\end{exercise}
\begin{solution}
$x=3$
\end{solution}
\begin{exercise}
$x+1=5$
\end{exercise}
\begin{solution}
$x=4$
\end{solution}
\end{multicols}
%\setcounter{exercise}{22}
\section{Term Simplifications}
\begin{exercise}
$\dfrac{1}{a}+a$
\end{exercise}
\begin{solution}
$\dfrac{a^2+1}{a}$
\end{solution}
\chapter*{Solutions}
%\printsolutions
\minisec{Solutions 1.1, page 1}
\begin{multicols}{2}
\printsolutions[chapter=1,section=1]
\end{multicols}
\minisec{Solutions 1.2, Page 1}
\printsolutions[chapter=1,section=2]
\end{document}
答案1
我只需使用\label
s 然后\ref
和\pageref
它们:
\section{Equations}\label{sec:equations}
...
\minisec{Solutions~\ref{sec:equations}, page~\pageref{sec:equations}}
...
完整代码:
\documentclass[ngerman,paper=A5]{scrreprt}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{babel}
\usepackage{multicol}
\setlength{\multicolsep}{2.0pt plus 2.0pt minus 1.5pt}% 50%/3 of original values
\usepackage[]{xsim}
\DeclareExerciseEnvironmentTemplate{basic}
{%
\par\noindent
\textsf{%
\IfInsideSolutionTF
{\bfseries\footnotesize L}
{\bfseries\footnotesize A}\GetExerciseProperty{counter}} %
}%
{\par}
\xsimsetup{
exercise/template = basic ,
solution/template = basic ,
exercise/the-counter = \arabic{exercise}. ,
print-solutions/headings = false
}
\begin{document}
\chapter{Various Tasks}
\section{Equations}\label{sec:equations}
\begin{exercise}
$(x+2)(x+3)+x^2+7y+y^2+(y-3)^2=11$
\end{exercise}
\begin{solution}
no solution
\end{solution}
\begin{multicols}{2}
\begin{exercise}
$x+2=5$
\end{exercise}
\begin{solution}
$x=3$
\end{solution}
\begin{exercise}
$x+1=5$
\end{exercise}
\begin{solution}
$x=4$
\end{solution}
\end{multicols}
\section{Term Simplifications}\label{sec:term-simplifications}
\begin{exercise}
$\dfrac{1}{a}+a$
\end{exercise}
\begin{solution}
$\dfrac{a^2+1}{a}$
\end{solution}
\chapter*{Solutions}
\minisec{Solutions~\ref{sec:equations}, page~\pageref{sec:equations}}
\begin{multicols}{2}
\printsolutions[chapter=1,section=1]
\end{multicols}
\minisec{Solutions~\ref{sec:term-simplifications}, page~\pageref{sec:term-simplifications}}
\printsolutions[chapter=1,section=2]
\end{document}