我使用 hyperref 修复了我的问题,发布者:CarLaTeX Visit任务环境和答案包发生冲突。我得到了我想要的,如何让答案键在水平方向,而不是垂直方向。
答案部分
\documentclass[10pt]{article}
\usepackage{answers}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage{multicol}
\usepackage{pgf,tikz,pgfplots}
\usepackage{tasks}
\usepackage{tikz}
\usepackage{amsmath,amssymb}
\usepackage{enumitem}
\usepackage{varwidth}
\usetikzlibrary{calc}
\setlength{\columnsep}{0.8cm}
\setlength{\columnseprule}{0.2pt}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=10mm,
right=10mm,
top=15mm,
}
\newcommand{\mybox}[4][\textwidth-\pgfkeysvalueof{/pgf/inner xsep}-2mm]{%
\begin{figure}[!h]
\centering
\begin{tikzpicture}
\node[line width=.5mm, rounded corners, draw=#2, inner ysep=10pt, text width=#1, outer sep=0] (one) {\vspace*{15pt}\\\begin{varwidth}{\textwidth}#4\end{varwidth}};
\node[text=white,anchor=north east,align=center, minimum height=20pt] (two) at (one.north east) {#3 \hspace*{.5mm}};
\path[fill=#2]
(one.north west|-two.west) --
($(two.west)+(-1.5cm,0)$)
to[out=0,in=180] (two.south west) --
(two.south east) [rounded corners] --
(one.north east) --
(one.north west) [sharp corners] -- cycle;
\node[text=white,anchor=north east,align=center, minimum height=20pt, text height=2ex] (three) at (one.north east) {#3 \hspace*{.5mm}};
\end{tikzpicture}
\end{figure}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% NEW %%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{hyperref}
\hypersetup{colorlinks=true,
linkcolor=black}
\usepackage[answerdelayed]{exercise}
\renewcommand{\ExerciseListHeader}{\textbf{\color{black}\refAnswer{\ExerciseLabel}.}~}
\renewcommand{\AnswerListHeader}{\textbf{\color{black}\ExerciseHeaderNB.}~}
\newcommand{\itemi}{\Exercise[label={\the\value{Exercise}}]\setlength{\parskip}{1em}}
\newcommand{\myansw}{\Answer[ref=\ExerciseLabel]}
\begin{document}
\begin{center}
\mybox{gray!70!black}{\Large{Test 1}}{
\hspace*{7.5cm}
Topic 1: linear equations
}
\end{center}
\begin{multicols*}{2}
\begin{ExerciseList}
%%%%%1%%%%%%%
\itemi If the ratio of two
\begin{tasks}[counter-format = {(tsk[A])},label-offset = {0.8em},item-indent={-0.1cm},label-format = {\bfseries}](5)
\task $36^\circ$
\task $44^\circ$
\task $48^\circ$
\task $52^\circ$
\task $60^\circ$
\end{tasks}
\myansw C
%%%%%%%%%%%%%Q2%%%%%%%%%%%%%
\itemi If the angle
\begin{tasks}[counter-format = {(tsk[A])},label-offset = {0.8em},item-indent={-0.1cm},label-format = {\bfseries}](5)
\task $130^\circ$
\task $125^\circ$
\task $120^\circ$
\task $115^\circ$
\task $110^\circ$
\end{tasks}
\myansw E
%%%%%%%%%%%%%Q3%%%%%%%%%%%%%
\itemi 1+1=?
\begin{tasks}[counter-format = {(tsk[A])},label-offset = {0.8em},item-indent={-0.1cm},label-format = {\bfseries}](5)
\task 50
\task 60
\task 70
\task 80
\task 90
\end{tasks}
\myansw C
\end{ExerciseList}
\end{multicols*}
\clearpage
\section*{Answers!}\vspace{-1em}
\shipoutAnswer
\end{document}