
exercise
--- 패키지를 사용하여 --- 환경을 사용하여 연습 목록을 만들고 싶습니다 ExerciseList
. 출력은 아래 예와 같아야 합니다.
연습문제는 일반 목록 환경에서처럼 숫자가 왼쪽에 표시된 것처럼 들여쓰기됩니다. 패키지 내에서 이 작업을 수행할 수 있습니까 exercise
?
편집하다:@cfr을 기쁘게 하기 위해 나는 이 문제를 해결하기 위한 내 자신의 시도를 게시합니다. 코드가 심하게 충돌합니다.
\documentclass[openright,book]{memoir}
%Dansk sprog:
\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\usepackage[T1]{fontenc}
\renewcommand{\danishhyphenmins}{22}
%\OnehalfSpacing %hvis der oenskes halvanden linjeafstand
%Pakker
\usepackage[noDcommand]{kpfonts} % the kpfonts font
\usepackage{%
amsmath,graphicx,enumerate,amstext,geometry,array,xfrac,bm,mathtools,siunitx,
%tikz, pgfplots
etoolbox, xparse, %til subexc
fixltx2e, %fikser et par bugs i LaTeX-kernen
microtype, %smaa fiks, der goer tekst lettere at laese
varioref,
}
\usepackage{exercise}
\renewcommand\ExerciseListName{} % I don't want any word like "exercise" anywhere
\renewcommand\ExerciseHeaderTitle{\Exercisetitle}
\renewcommand{\ExerciseListHeader}{\ExerciseHeaderDifficulty%
\item[\ExerciseHeaderNB]\ExerciseHeaderTitle\ %
\ExerciseHeaderOrigin\ignorespaces}
\renewenvironment{ExerciseList}{\enumerate[1]\beginExerciseListEnv}{\endExerciseListEnv\endenumerate}
\begin{document}
\begin{ExerciseList}
\Exercise What is this?
\Exercise What is that
\Question What in the world?
\subQuestion What is this?
\ExeText We define $x = y$.
\end{ExerciseList}
\end{document}
답변1
댓글에서 exsheets
그러한 레이아웃에 대한 솔루션이 여기에서 환영되었으므로... 사용법은 패키지와 상당히 다릅니다 exercise
...
솔루션에는 다음과 같은 여러 단계가 포함됩니다.
와 의 도움으로 환경 주위에 KOMA-Script
addmargin
환경을 래핑합니다 . 그러면 지정된 여백( 아래 예)만큼 들여쓰기된 질문 본문을 가져옵니다. 환경 은 패키지 에서 제공되므로 다른 클래스에서도 사용할 수 있습니다.question
etoolbox
\AtBeginEnvironment
\AtEndEnvironment
3em
addmargin
scrextend
환경 에서 설정한 것과 동일한 여백 ( 아래 예)을 사용하여 텍스트 여백에 맞춰 질문 번호를 배치하는
margin-nr
매뉴얼에 설명된 인스턴스에서 영감을 받은 새 제목 인스턴스를 선언합니다.exsheets
addmargin
3em
새 인스턴스를 사용하도록 설정
exsheets
하고 섹션 내 번호 매기기에 대한 몇 가지 옵션을 추가합니다.
아래 코드의 문서는 다음과 같습니다.
\documentclass{article}
\usepackage{scrextend}% not needed with a KOMA-Script class, provides the
% `addmargin' environment
\usepackage[load-headings]{exsheets}
\DeclareInstance{exsheets-heading}{mylist}{default}{
runin = true ,
attach = {
main[l,vc]number[l,vc](-3em,0pt) ; % 3em = indent of question body
main[r,vc]points[l,vc](\linewidth+\marginparsep,0pt)
}
}
\SetupExSheets{
headings = mylist , % use the new headings instance
headings-format = \normalfont ,
counter-format = se.qu ,
counter-within = section
}
\usepackage{etoolbox}
% 3em = indent of question body :
\AtBeginEnvironment{question}{\addmargin[3em]{0em}}
\AtEndEnvironment{question}{\endaddmargin}
\usepackage{lipsum}
\begin{document}
\setcounter{section}{10}
\section*{Exercises}
\subsection*{Exercises to section \thesection}
\begin{question}
\lipsum[4]
\end{question}
\begin{question}
\lipsum[6]
\end{question}
\begin{question}
\lipsum[10]
\end{question}
\end{document}