重新列举练习

重新列举练习

我想重新编号下面的练习,将数字 1. 改为 9.,将数字 2. 改为 12.,将数字 3. 改为 15。我该如何进行?

\documentclass{article}

\usepackage[brazil]{babel}
\usepackage[utf8]{inputenc}
%\UseRawInputEncoding
\usepackage[T1]{fontenc}
\usepackage{Sweave}
\usepackage[fixlanguage]{babelbib}
%\usepackage[pdftex]{color}
\usepackage{dsfont}
\usepackage{esvect}
\usepackage[labelfont=bf]{caption}
\usepackage{float}
\usepackage{tasks}
\usepackage{color, colortbl}
\usepackage{xcolor}
\colorlet{lightcyan}{cyan!40!white}
\usepackage{chngcntr}
\usepackage{stackengine}
\usepackage{ragged2e}%para justificar o texto dentro de algum ambiente
\definecolor{Gray}{gray}{0.9}
\definecolor{LightCyan}{rgb}{0.88,1,1}

\newlength{\longestlabel}
\settowidth{\longestlabel}{\bfseries viii.}

\setcounter{secnumdepth}{0} \setlength{\topmargin}{0cm}
\setlength{\headsep}{-0.3cm} \setlength{\textwidth}{17.5cm}
\setlength{\textheight}{23cm} \setlength{\oddsidemargin}{-0.8cm}
\setlength{\evensidemargin}{0cm} \setlength{\footskip}{-1.5cm}

\usepackage[lastexercise,answerdelayed]{exercise}
\renewcommand{\ExerciseName}{Exercícios}
\renewcommand{\ExerciseHeader}{\noindent\def\stackalignment{l}% code from https://tex.stackexchange.com/a/195118/101651
    \stackunder[0pt]{\colorbox{cyan}{\textcolor{white}{\textbf{\large\ExerciseName}}}}{\textcolor{lightcyan}{\rule{\linewidth}{2pt}}}\medskip}

\begin{document}



\vspace*{-2cm}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\medskip

\begin{center}

\underline{\underline{{\large{\sc Soluções da Lista}}}}

\bigskip

{\large {\bf Prof. xxxxxx}}
%\bigskip
%
%%{\sc Data: $19/06/2018$}
\end{center}

\begin{Exercise}

\Question O fabricante de certa...

\Question A duração das lâmpadas produzidas por...

\Question O custo de produção de certo artigo...

\end{Exercise}

\end{document}

答案1

您可以创建自己的ManualExercise环境:

在此处输入图片描述

\documentclass{article}

\usepackage[lastexercise,answerdelayed]{exercise}
\renewcommand{\ExerciseName}{Exercises}
\renewcommand{\ExerciseHeader}{Exercises}

% Partial code taken from http://mirrors.ctan.org/macros/latex/contrib/exercise/exercise.dtx
\newenvironment{ManualExercise}
  {\begin{list}{}{\leftmargin \QuestionIndent
    \partopsep0pt \parsep\parskip \topsep\QuestionBefore
    \itemsep\QuestionBefore \labelwidth2em
    \labelsep.33em
    \usecounter{Question}}}
  {\end{list}}

\begin{document}

\begin{Exercise}
  \Question Lorem ipsum \ldots
  \Question Lorem ipsum \ldots
  \Question Lorem ipsum \ldots
\end{Exercise}

\begin{Exercise}
  \begin{ManualExercise}
    \item[9.~] Lorem ipsum \ldots
    \item[12.~] Lorem ipsum \ldots
    \item[15.~] Lorem ipsum \ldots
  \end{ManualExercise}
\end{Exercise}

\end{document}

原因Exercise在于exercise设置常规列表,但检查它是列表中的第一个\Question还是后续的\Question。基于此条件,创建自己的列表比更新列表以满足您的要求要容易得多。

列表参数与环境的参数相同Exercise,取自exercise.dtx

相关内容