使用答案包,我尝试将练习的字体从斜体更改为非斜体。我正在寻找一种不需要我在每个练习中添加内容的解决方案。
\documentclass[12pt]{article}
\usepackage{answers}
\Newassociation{sol}{Solution}{ans}
\newtheorem{ex}{}
\begin{document}
\Opensolutionfile{ans}[1.1.1ans]
\section*{1.1.1 Check Your Understanding}
\begin{ex}
Evaluate 1+1
\begin{sol}
2
\end{sol}
\end{ex}
\begin{ex}
What are the x-intercepts of f(x)?
\begin{sol}
0
\end{sol}
\end{ex}
\subsection*{Challenge}
\begin{ex}
What is the square root of -1?
\begin{sol}
$i$
\end{sol}
\end{ex}
\Closesolutionfile{ans}
\subsection*{Answers}
\input{1.1.1ans}
\end{document}
答案1
改变环境定理的默认定义。
\newcommand{\theorStyle}{\itshape}
您将使用Try\large
或获得默认输出 \bfseries
以查看其如何工作。
\documentclass[12pt]{article}
\usepackage{xcolor}
\usepackage{answers}
\Newassociation{sol}{Solution}{ans}
\newtheorem{ex}{}
% *************************** added <<<<<<<<<<<<<<<<<<<<
\newcommand{\theorStyle}{\normalfont}% choose the style<<<<<<<<<<
\makeatletter
\def\@begintheorem#1#2{\trivlist%
\item[\hskip \labelsep{\bfseries #1\ #2}]\theorStyle}
\makeatother
\begin{document}
\Opensolutionfile{ans}[1.1.1ans]
\section*{1.1.1 Check Your Understanding}
\begin{ex}
Evaluate 1+1
\begin{sol}
2
\end{sol}
\end{ex}
\begin{ex}
What are the x-intercepts of f(x)?
\begin{sol}
0
\end{sol}
\end{ex}
\subsection*{Challenge}
\begin{ex}
What is the square root of -1?
\begin{sol}
$i$
\end{sol}
\end{ex}
\Closesolutionfile{ans}
\subsection*{Answers}
\input{1.1.1ans}
\end{document}