% \iffalse meta-comment % % Copyright (C) 2020 by zhaofeng-shu33 <616545598@qq.com> % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. % % \fi % %\iffalse %<*internal> \begingroup \input docstrip.tex \askforoverwritefalse \showprogress \keepsilent \preamble This is a generated file. Copyright (C) \the\year by zhaofeng-shu33 <616545598@qq.com> This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. To produce the documentation run the original source files ending with `.dtx' through LaTeX. \endpreamble \nopostamble \generate{ \file{dtx-style.sty}{\from{\jobname.dtx}{dtx-style}} \file{iidef.sty}{\from{\jobname.dtx}{sty}} } \ifToplevel{% \Msg{***********************************************************} \Msg{*} \Msg{* To produce the documentation run the files ending with} \Msg{* `.dtx' through XeLaTeX.} \Msg{*} \Msg{* Happy TeXing!} \Msg{***********************************************************}} \endgroup %</internal> %<*driver> \ProvidesFile{thucoursework.dtx}[2020/09/09 2.6 Tsinghua University Coursework Template] \documentclass{ltxdoc} \usepackage{dtx-style} \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} \DocInput{\jobname.dtx} \end{document} %</driver> % \fi % \DoNotIndex{\NeedsTeXFormat,\ProvidesClass,\RequirePackage} % \DoNotIndex{\renewcommand,\underline,\newcommand,\def} % \DoNotIndex{\setlist,\hfill,\hrule,\vspace} % \DoNotIndex{\begin,\end,\DeclareStringOption} % \DoNotIndex{\fancypagestyle,\fancyhead,\pagestyle,\thispagestyle} % \DoNotIndex{\protect,\mathpalette,\rlap,\mathrel,\mkern} % \GetFileInfo{\jobname.dtx} %^^A theses changes are moved from update.md %^^A \changes{hversioni}{hdatei}{htexti} % \def\xiangxiang{\textit{Xiangxiang}} % \def\zhaofeng{\textit{zhaofeng-shu33}} % \changes{v1.1}{2017/09/26}{[\xiangxiang] Add mathcal and eucal package.} % \changes{v1.1}{2017/09/26}{[\xiangxiang] Add aligned equations in \texttt{iihw.tex}.} % \changes{v1.2}{2017/10/09}{[\xiangxiang] Add example for figures in \texttt{iihw.tex}} % \changes{v1.2}{2017/10/09}{[\xiangxiang] Add example fro input matlab codes in \texttt{iihw.tex}} % \changes{v1.2}{2017/10/09}{[\xiangxiang] No need to set counter style manually} % \changes{v1.3}{2017/10/12}{[\xiangxiang] Add example for vector and random vectors(underline) in \texttt{iihw.tex}} % \changes{v1.4}{2017/10/30}{[\xiangxiang] Add an example of hypothesis testing in \texttt{iihw.tex}} % \def\indexname{索引} % \def\glossaryname{修改记录} % \IndexPrologue{\section{\indexname}} % \GlossaryPrologue{\section{\glossaryname}} % \title{\bfseries\color{violet}\thucoursework:清åŽå¤§å¦è¯¾ç¨‹ä½œä¸šæ¨¡æ¿\thanks{本文档在 \textit{xueruini} çš„ \href{https://github.com/xueruini/thuthesis}{\enspace \textsc{Thu}\-\textsc{Thesis}} 手册基础上进行改动}} % \author{{\fangsong 赵丰\thanks{师兄å¾ç¥¥ç¥¥ç»´æŠ¤åˆ°v1.4}}\\[5pt]\texttt{616545598@qq.com}} % \date{v\fileversion\ (\filedate)} % \maketitle\thispagestyle{empty} % % % \begin{abstract}\noindent % æ¤å®åŒ…æ—¨åœ¨å»ºç«‹ä¸€ä¸ªç®€å•æ˜“用的清åŽå¤§å¦è¯¾ç¨‹ä½œä¸šæ¨¡æ¿ï¼Œä½œä¸šä¸»è¦é’ˆå¯¹ç†è®ºç‰©ç†ã€æ•°å¦ã€ä¿¡æ¯ç§‘å¦ã€é€šä¿¡ã€ç†è®ºåŠ›å¦ç‰æ–¹é¢ã€‚ % \end{abstract} % % \vskip2cm % \def\abstractname{å…责声明} % \begin{abstract} % \noindent % \begin{enumerate} % \item 本模æ¿çš„å‘布éµå®ˆ \LaTeX\ Project Public License,使用å‰è¯·è®¤çœŸé˜…读å议内 % 容。 % \item 任何个人或组织以本模æ¿ä¸ºåŸºç¡€è¿›è¡Œä¿®æ”¹ã€æ‰©å±•而生æˆçš„æ–°çš„专用模æ¿ï¼Œè¯·ä¸¥æ ¼éµ % 守 \LaTeX\ Project Public License å议。由于è¿çНåè®®è€Œå¼•èµ·çš„ä»»ä½•çº çº·äº‰ç«¯å‡ä¸Ž % 本模æ¿ä½œè€…æ— å…³ã€‚ % \end{enumerate} % \end{abstract} % % % \clearpage % \pagestyle{fancy} % \begin{multicols}{2}[ % \setlength{\columnseprule}{.4pt} % \setlength{\columnsep}{18pt}] % \tableofcontents % \end{multicols} % \clearpage % % \section{模æ¿ä»‹ç»} % \thucoursework\ (\textbf{T}sing\textbf{h}ua \textbf{U}niversity \LaTeX\ % \textbf{Coursework} Template) 是为了帮助清åŽå¤§å¦å¦ç”Ÿæ’°å†™è¯¾ç¨‹ä½œä¸šè€Œç¼–写 % çš„ \LaTeX\ 模æ¿ã€‚最åˆç”±å¾ç¥¥ç¥¥å¸ˆå…„æ‹…ä»»\textit{Information Inference} 这门课助教期间设计出æ¥ï¼Œå½“时命å为\texttt{idef.sty}ã€‚åŽæ¥ç”±èµµä¸°æŽ¥æ‰‹è¿›è¡Œæ‹“展和完善。 % 本文档将尽é‡å®Œæ•´çš„ä»‹ç»æ¨¡æ¿çš„ä½¿ç”¨æ–¹æ³•ï¼Œå¦‚æœ‰ä¸æ¸…楚之处å¯ä»¥å‚è€ƒç¤ºä¾‹æ–‡æ¡£æˆ–è€…æ ¹æ® % 第~\ref{sec:howtoask} 节说明æé—®ï¼Œæœ‰å…´è¶£è€…都å¯ä»¥å‚ä¸Žå®Œå–„æ¤æ‰‹å†Œï¼Œä¹Ÿéžå¸¸æ¬¢è¿Žå¯¹ä»£ % ç 的贡献。 % \section{安装} % \label{sec:installation} % %^^A å‘行版 updated , 2018/5/17 https://mirror.ctan.org/systems/texlive/tlnet/tlpkg % 阅读文档å¯ä»¥ä½¿ç”¨ä»¥ä¸‹å‘½ä»¤ï¼š % \begin{shell} % $ texdoc thucoursework % \end{shell} % % 如果è¦ä½¿ç”¨å¼€å‘版,需自己下载,\thucoursework\ 相关链接: % \begin{itemize} % \item 主页:\href{https://github.com/zhaofeng-shu33/THU-coursework-template}{GitHub} % \item 下载:\href{https://www.ctan.org/pkg/thucoursework}{CTAN} % \end{itemize} % % \subsection{模æ¿çš„组æˆ} % 下表列出了 \thucoursework\ çš„ä¸»è¦æ–‡ä»¶åŠå…¶åŠŸèƒ½ä»‹ç»ï¼š % % \begin{longtable}{l|p{8cm}} % \toprule % {\heiti 文件(夹)} & {\heiti 功能æè¿°}\\\midrule % \endfirsthead % \midrule % {\heiti 文件(夹)} & {\heiti 功能æè¿°}\\\midrule % \endhead % \endfoot % \endlastfoot % thucoursework.dtx & \textsc{DocStrip} æºæ–‡ä»¶ï¼ˆå¼€å‘用)\\\midrule % iihw.tex & \xiangxiang 编写的使用模æ¿çš„英文作业例å\\ % ithw.tex & \zhaofeng 编写的使用模æ¿çš„䏿–‡ä½œä¸šä¾‹å\\ \midrule % Makefile & Makefile\\ % & latexmk é…置文件 \\ % README.md & Readme\\ % \textbf{thucoursework.pdf} & 用户手册(本文档)\\\bottomrule % \end{longtable} % % % \subsection{ç”Ÿæˆæ¨¡æ¿sty文件和用户手册} % \label{sec:generate-cls} % \note[æç¤ºï¼š]{若使用 linux æ“作系统,å¯åœ¨å«æœ‰\file{Makefile}的目录下直接è¿è¡Œ \texttt{make doc} 命令 % ç”Ÿæˆæ¨¡æ¿sty文件和用户手册} % % 在使用之å‰å¯ä»¥ç”¨ä¸‹é¢çš„代ç ç”Ÿæˆæ¨¡æ¿sty文件和用户手册: % % \begin{shell} % $ xelatex thucoursework.dtx % $ makeindex -s gind.ist -o thucoursework.ind thucoursework.idx % $ makeindex -s gglo.ist -o thucoursework.gls thucoursework.glo % $ xelatex thucoursework.dtx % $ xelatex thucoursework.dtx % 生æˆè¯´æ˜Žæ–‡æ¡£ thucoursework.pdf % \end{shell} % % % % \subsection{生æˆä½œä¸š} % \label{sec:generate-coursework} % 本节介ç»å‡ ç§å¸¸è§çš„生æˆä½œä¸šçš„æ–¹æ³•ã€‚ç”¨æˆ·å¯æ ¹æ®è‡ªå·±çš„æƒ…况选择,使用å‰è¯·ä»¿ç…§ä¾‹å里的tex文件,使用 % \begin{latex} % \usepackage{iidef} % \end{latex} % 引用å®åŒ…。 % \subsubsection{\XeLaTeX} % \label{sec:xelatex} % 很多用户对 \LaTeX\ 命令执行的次数ä¸å¤ªæ¸…楚。一个基本的原则是多次è¿è¡Œ \LaTeX\ 命 % 令直至ä¸å†å‡ºçްè¦å‘Šã€‚下é¢ç»™å‡ºç”Ÿæˆç¤ºä¾‹æ–‡æ¡£çš„详细过程(\texttt{\#} 开头的行为注 % 释),首先æ¥çœ‹æŽ¨èçš„ \texttt{xelatex} æ–¹å¼ï¼š % \begin{shell} % # 1. å‘现里é¢çš„引用关系,文件åŽç¼€ .tex å¯ä»¥çœç•¥ % $ xelatex main % % # 2. 编译å‚è€ƒæ–‡ä»¶æºæ–‡ä»¶ï¼Œç”Ÿæˆ bbl 文件 % $ bibtex main % % # 3. 下é¢è§£å†³å¼•用 % $ xelatex main % $ xelatex main # æ¤æ—¶ç”Ÿæˆå®Œæ•´çš„ pdf 文件 % \end{shell} % % \subsubsection{PDF\LaTeX} % \label{sec:pdflatex} % 当仅使用英文完æˆè¯¾ç¨‹ä½œä¸šæ—¶ï¼Œå¯ä»¥ä½¿ç”¨ PDF\LaTeX,编译速度会快很多。按照第~\ref{sec:xelatex} èŠ‚çš„é¡ºåºæ‰§è¡Œå³å¯ï¼Œåªæ˜¯å°†å‘½ä»¤ä¸ % \texttt{xelatex} 替æ¢ä¸º \texttt{pdflatex}。 % % éœ€è¦æ³¨æ„的是 PDF\LaTeX\ ä¸èƒ½å¤„ç†å¸¸è§çš„ EPS 图形,需è¦å…ˆç”¨ \texttt{epstopdf} 将其转化 % æˆ PDF。ä¸è¿‡ PDF\LaTeX\ å¢žåŠ äº†å¯¹ png,jpg ç‰æ ¼å¼çš„æ”¯æŒï¼Œæ¯”较方便。\TeX Live % 自从 2010 版本起自动调用 \texttt{epstopdf} å°† EPS 图形转化为 PDF。 % % \subsubsection{latexmk} % \label{sec:latexmk} % \texttt{latexmk} 命令支æŒå…¨è‡ªåŠ¨ç”Ÿæˆ \LaTeX\ 编写的文档,并且支æŒä½¿ç”¨ä¸åŒçš„工具 % 链æ¥è¿›è¡Œç”Ÿæˆï¼Œå®ƒä¼šè‡ªåЍè¿è¡Œå¤šæ¬¡å·¥å…·ç›´åˆ°äº¤å‰å¼•用都被解决。下é¢ç»™å‡ºäº†ä¸€ä¸ªç”¨ % \texttt{latexmk} 调用 \texttt{xelatex} ç”Ÿæˆæœ€ç»ˆæ–‡æ¡£çš„示例: % \begin{shell} % # 一å¥è¯å°±å¤Ÿäº†ï¼ % $ latexmk -xelatex Assignment % \end{shell} % % \subsubsection{make} % \label{sec:make} % \note[æç¤ºï¼š]{使用 \texttt{make} 编译,需è¦é…åˆlinux æ“作系统。} % % % \subsection{å‡çº§} % \label{sec:updgrade} % % \section{使用说明} % \label{sec:usage} % 本手册å‡å®šç”¨æˆ·å·²ç»èƒ½å¤„ç†ä¸€èˆ¬çš„ \LaTeX\ 文档。如果 % ä»Žæ¥æ²¡æœ‰æŽ¥è§¦è¿‡ \TeX\ å’Œ \LaTeX,建议先å¦ä¹ 相关的基础知识。 % % \subsection{关于æé—®} % \label{sec:howtoask} % 按照优先级推èæé—®çš„ä½ç½®å¦‚下: % % \begin{itemize} % \item \href{https://github.com/zhaofeng-shu33/thucoursework/issues}{Github Issues} % \item \href{https://github.com/CTeX-org/forum/issues}{ctex 论å›} % \end{itemize} % % \subsection{示例文件} % \label{sec:userguide} % % æŽ¨èæ–°ç”¨æˆ·ä»Žæ¨¡æ¿è‡ªå¸¦çš„示例文档入手,里é¢åŒ…括了写作业用到的所有命令åŠå…¶ä½¿ç”¨æ–¹æ³•, % åªéœ€è¦ç”¨è‡ªå·±çš„内容进行相应替æ¢å°±å¯ä»¥ã€‚å¯¹äºŽä¸æ¸…楚的命令å¯ä»¥æŸ¥é˜…本手册。下é¢çš„例 % åæè¿°äº†æ¨¡æ¿ä¸ä½œä¸šçš„组织形å¼ï¼Œæ¥è‡ªäºŽç¤ºä¾‹æ–‡æ¡£ï¼Œå…·ä½“内容å¯ä»¥å‚考模æ¿é™„带 % \changes{v2.3}{2018/03/30}{[\zhaofeng] Add sample file \file{ithw.tex}} % çš„ \file{iihw.tex} å’Œ \file{ithw.tex}。 % % \lstinputlisting[style=lstStyleLaTeX]{iihw.tex} % % % \subsection{作业选项} % \label{sec:option} % % \DescribeOption{thehwcnt} % 指定作业åºå·ï¼Œ % 为å¯é€‰é¡¹ã€‚ % \begin{latex} % % 使用默认åºå·1 % \usepackage{iidef} % % % 指定åºå·ä¸º6 % \usepackage[thehwcnt=6]{iidef} % \end{latex} % % \subsection{基本信æ¯}\label{sec:basic_info} % \DescribeMacro{\thecourseinstitute} % æŒ‡å®šå¦æ ¡æˆ–å¦é™¢ï¼Œå¦‚æžœä½¿ç”¨ä¸æ–‡ï¼Œè¯·å¼•用\pkg{ctex} å®åŒ…。 % \begin{latex} % % 指定å¦é™¢æ˜¯TBSI % \thecourseinstitute{Tsinghua-Berkeley Shenzhen Institute} % % % æŒ‡å®šä¸æ–‡å % \thecourseinstitute{清åŽå¤§å¦ç”µå工程系} % \end{latex} % % \DescribeMacro{\thecoursename} % 指定课程å % \begin{latex} % % æŒ‡å®šè¯¾ç¨‹åæ˜¯ Information Inference % \thecoursename{Information Inference} % % æŒ‡å®šè¯¾ç¨‹åæ˜¯ "应用信æ¯è®º" % \thecoursename{应用信æ¯è®º} % \end{latex} % % \DescribeMacro{\theterm} % æŒ‡å®šå¦æœŸ % \begin{latex} % % English example % \theterm{Fall 2017} % % 䏿–‡ç¤ºä¾‹ % \theterm{2018年春å£å¦æœŸ} % \end{latex} % % \DescribeMacro{\hwname} % 指定作业å,默认是 Homework % \begin{latex} % % English example % \hwname{Coursework} % % 䏿–‡ç¤ºä¾‹ % \hwname{作业} % \end{latex} % % \subsection{æ ‡é¢˜} % \DescribeMacro{\courseheader} % å°†å…¶æ”¾åœ¨æ£æ–‡å‰é¢ç”Ÿæˆä½œä¸šæ ‡é¢˜ % % \note[æç¤ºï¼š]{使用 \cs{courseheader} å‰éœ€ä½¿ç”¨~\ref{sec:basic_info}节æè¿°çš„宿Œ‡å®šç›¸å…³åŸºæœ¬ä¿¡æ¯ã€‚并且使用了\cs{courseheader}æ— éœ€å†ç”¨ \LaTeX\ 里的\cs{maketitle}} % \begin{latex} % \begin{document} % \courseheader % \name{YOUR NAME} % \end{latex} % \DescribeMacro{\name} %^^A manually indentation % \indent 生æˆå§“åã€ä½œä¸šåã€æ—¥æœŸ % % \note[æç¤ºï¼š]{使用 \cs{name} 会直接在文档ä¸è¾“出姓åã€ä½œä¸šåã€æ—¥æœŸï¼Œå› æ¤å¦‚果需è¦è‡ªå®šä¹‰ä½œä¸šå,需è¦åœ¨ä½¿ç”¨\cs{name} å‰ç”¨ \cs{hwname} 指定作业åç§°} % \subsection{题目自动编å·} % 建议使用嵌套的\texttt{enumerate} 环境对题目自动编å·ï¼Œå¯æ¯”较好的解决自动缩进的问题。 % 本模æ¿è®¾ç½®äº†ä¸€çº§åˆ—表为作业åºå·åŠ é¢˜ç›®åºå·ï¼Œæ¯”如第6次作业第3é¢˜ä¼šæŽ’ç‰ˆæˆ \enspace 6.3.\enspace ,对于æŸä¸€é“题目的ä¸åŒå°é—®ï¼Œé»˜è®¤æ˜¯ç”¨(a),(b),(c) 进行 % 顺åºç¼–排。 % \begin{latex} % \begin{enumerate} % \item First Problem % \item Second Problem % \begin{enumerate} % \item first question of the second problem % \item second question of the second problem % \end{enumerate} % \end{enumerate} % \end{latex} % % å¦‚æžœéœ€è¦æ”¹å˜é»˜è®¤çš„设置,比如ä¸åŒå°é—®ä½¿ç”¨ç½—马数å—,则å¯ä»¥åœ¨æ£æ–‡å¼€å§‹ä¹‹å‰ä½¿ç”¨ % \begin{latex} % \setlist[enumerate,2]{label=\roman*.} % \end{latex} % 进行设置。 % % \subsection{è¯æ˜Žå’Œè§£çš„环境} % \myentry{è¯æ˜Ž} % \DescribeEnv{proof} % \texttt{proof} 环境是 \pkg{amsthm} å®åŒ…æä¾›çš„,引用本模æ¿åŽå¯ä»¥ç›´æŽ¥ä½¿ç”¨ã€‚ % \begin{latex} % \begin{proof} % proof contents go here % \end{proof} % \end{latex} % åœ¨ä¸æ–‡ä½œä¸šä¸ï¼Œå¼•用\pkg{ctex} å®åŒ… % åŽ â€œè¯æ˜Žâ€ çš„çŽ¯å¢ƒä¼šå˜æˆ 䏿–‡ï¼Œå¦‚æžœéœ€è¦æ”¹å˜é»˜è®¤æ–‡å—,å¯ä»¥åœ¨åºè¨€ä¸ä½¿ç”¨ \cs{ctexset} é…ç½® % \begin{latex} % \ctexset{ % proofname = \heiti{è¯æ˜Ž} % } % \begin{document} % \end{latex} % \myentry{è§£} % \DescribeEnv{solution} % \texttt{solution} çŽ¯å¢ƒæ˜¯æœ¬æ¨¡æ¿æä¾›çš„ï¼Œç”¨äºŽå›žç”“求解XXXâ€ä¹‹ç±»çš„问题。 % \begin{latex} % \begin{solution} % solution contents go here % \end{solution} % \end{latex} % \DescribeMacro{slname} % åœ¨ä¸æ–‡ä½œä¸šä¸ï¼Œå¯èƒ½éœ€è¦å°† \texttt{solution} 环境默认的 \textit{solution.} å˜æˆä¸æ–‡ï¼Œä¸ºæ¤å¯ä»¥å°† % \begin{latex} % \slname{\heiti{è§£}} % \end{latex} % 放在使用 \texttt{solution} 环境之å‰ã€‚ % \subsection{常用数å¦ç¬¦å·} % 本文档预先定义了常用的数å¦ç¬¦å·ï¼Œåœ¨\file{iihw.tex} 示例文件ä¸å¯¹è¿™äº›ç¬¦å·çš„使用有详细说明。 % \section{致谢} % \label{sec:thanks} % 感谢师兄å¾ç¥¥ç¥¥çš„æœ€åˆçš„作业模æ¿è®¾è®¡ï¼Œ \textsc{Thu}\-\textsc{Thesis} å®åŒ…的文档æºç 。 % \changes{v2.4}{2018/04/09}{[\zhaofeng] finish the chinese pdf manual} % \changes{v2.5}{2018/05/20}{[\zhaofeng] make documentation more compact by including \texttt{dtx-style.sty} in the \texttt{dtx} file itself.} % \changes{v2.5.1}{2020/02/23}{[\zhaofeng] remove dtx-style source code from manual} % \StopEventually{\PrintChanges\PrintIndex} % \clearpage % % \section{实现细节} % % \subsection{基本信æ¯} % \changes{v2.0}{2018/03/22}{[\zhaofeng] Make it a latex package(.sty)} % \begin{macrocode} %<*sty> \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{iidef} [2020/09/09 2.6 Tsinghua University Coursework Template] % \end{macrocode} % \subsection{装载å®åŒ…} % \label{sec:loadpackage} % % 引用的å®åŒ…和相应的定义。 % \changes{v2.6}{2020/09/09}{[\zhaofeng] support \texttt{exam} document class} % \begin{macrocode} %% configuration of nested enumerate env \RequirePackage{enumitem} %% set hwcount key-value option \RequirePackage{kvoptions} %% required by macro DeclareMathOperator \RequirePackage{amsmath} %% Set up page headers using with fancyhdr \@ifundefined{lhead}{\RequirePackage{fancyhdr}} {\def\@thulhead{thulhead}} %define the solution env with amsthm proof \RequirePackage{amsthm} % \end{macrocode} % % å®šä¹‰å¦æœŸã€å¦é™¢ã€è¯¾ç¨‹å,作业å % \changes{v2.3}{2018/03/30}{[\zhaofeng] User configuration of \cs{hwname}} % \begin{macrocode} %% semester \def\@term{term} \newcommand{\theterm}[1]{\renewcommand\@term{#1}} %% institute \newcommand{\@courseinstitute}[1]{institute} \newcommand{\thecourseinstitute}[1]{\renewcommand\@courseinstitute{#1}} %% coursename \newcommand{\@coursename}[1]{coursename} \newcommand{\thecoursename}[1]{\renewcommand\@coursename{\textsc{#1}}} %% user can rewrite homework name \def\@hwname{Homework} \def\hwname#1{\renewcommand\@hwname{#1}} % \end{macrocode} % \subsection{作业选项} % \changes{v2.1}{2018/03/22}{[\zhaofeng] Use kvoptions to set the coursework counter.} % \begin{macrocode} %% \iidef@thehwcnt = 1 \DeclareStringOption[1]{thehwcnt} \ProcessKeyvalOptions* \def\thehwcnt{\iidef@thehwcnt} % \end{macrocode} % \subsection{æ ‡é¢˜} % 定义 \cs{courseheader} % \changes{v2.2}{2018/03/27}{[\zhaofeng] Use fancyhdr to set the coursework user file header.} % \begin{macrocode} %% page header setup, distinguish between first page(plain style) %% and second page on (runningpage style) %%*************************************************************************** \newcommand{\courseheader}{ \thispagestyle{plain}%first page use native plain style to suppress header \vspace*{-1in} \begin{center} \@courseinstitute\\ \@coursename\\ \@term \vspace*{0.1in} \hrule \end{center} \begin{center} \underline{\bf \@hwname\;\thehwcnt} \\ \end{center} } \@ifundefined{@thulhead}{ \fancypagestyle{runningpage} { \fancyhead[L]{\small\@coursename} \fancyhead[R]{\small\@courseinstitute} } %% use runningpage style from second page on \pagestyle{runningpage} }{} %% ********************************************************************************************* % \end{macrocode} % % 定义 \cs{name} % \begin{macrocode} %%name command macro %%************************* \newcommand{\name}[1]{ \begin{flushleft} #1\hfill \today \end{flushleft} \hrule \vspace{2em} \flushleft } %%************************* % \end{macrocode} % \subsection{题目自动编å·} % \begin{macrocode} %% enumitem related configuration \setlist[enumerate,1]{label=\thehwcnt.\arabic*.} \setlist[enumerate,2]{label=(\alph*)} \setlist[enumerate,3]{label=\roman*.} \setlist[enumerate,4]{label=\greek*} % \end{macrocode} % \subsection{解的环境} % \changes{v2.3}{2018/03/30}{[\zhaofeng] Add \texttt{solution} environment} % \changes{v2.3}{2018/03/30}{[\zhaofeng] user configuration of \texttt{solution} environment name} % 包装 \pkg{amsthm} çš„ \cs{proof},å¯ä»¥é€šè¿‡ \cs{slname} 对默认â€è§£â€œçš„æ–‡å—进行修改。 % \begin{macrocode} %%****************************** \def\@slname{Solution} \def\slname#1{\renewcommand\@slname{#1}} \@ifundefined{solution}{ \newenvironment{solution} { \proof[\@slname] } { %% no qed symbol in solution env \renewcommand{\qedsymbol}{} \endproof } }{} %%****************************** % \end{macrocode} % \subsection{常用数å¦ç¬¦å·} % \begin{macrocode} %%common math symbols go here %%************************************************* \def\v#1{\underline{#1}} \newcommand{\uc}{\underline{c}} % c, vec \newcommand{\uv}{\underline{v}} % x, vec \newcommand{\uw}{\underline{w}} % w, vec \newcommand{\ux}{\underline{x}} % x, vec \newcommand{\uy}{\underline{y}} % y, vec \newcommand{\uz}{\underline{z}} % z, vec \newcommand{\um}{\underline{m}} % m, vec \newcommand{\rvx}{\mathsf{x}} % x, r.v. \newcommand{\rvy}{\mathsf{y}} % y, r.v. \newcommand{\rvz}{\mathsf{z}} % z, r.v. \newcommand{\rvw}{\mathsf{w}} % w, r.v. \newcommand{\rvH}{\mathsf{H}} % H, r.v. \newcommand{\urvx}{\underline{\mathsf{x}}} % x, r.v. vec \newcommand{\urvy}{\underline{\mathsf{y}}} % y, r.v. vec \newcommand{\urvz}{\underline{\mathsf{z}}} % z, r.v. vec \newcommand{\urvw}{\underline{\mathsf{w}}} % w, r.v. vec \newcommand{\defas}{\triangleq} %\coloneqq \newcommand{\reals}{\mathbb{R}} \newcommand{\TT}{\mathrm{T}} % transpose \DeclareMathOperator*{\argmax}{arg\,max} \DeclareMathOperator*{\argmin}{arg\,min} \DeclareMathOperator*{\argsup}{arg\,sup} \DeclareMathOperator*{\arginf}{arg\,inf} \DeclareMathOperator{\diag}{diag} \DeclareMathOperator{\Var}{Var} \DeclareMathOperator{\Cov}{Cov} \DeclareMathOperator{\MSE}{MSE} \DeclareMathOperator{\1}{\mathds{1}} \DeclareMathOperator{\In}{\mathbb{I}} \DeclareMathOperator{\E}{\mathbb{E}} \DeclareMathOperator{\Prob}{\mathbb{P}} \newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}} \def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}} %%************************************************************************************ %</sty> % \end{macrocode} % \iffalse % \begin{macrocode} %<*dtx-style> \ProvidesPackage{dtx-style} \RequirePackage{hypdoc} \RequirePackage[UTF8,scheme=chinese]{ctex} \RequirePackage{newpxtext} \RequirePackage{newpxmath} \RequirePackage[ top=2.5cm, bottom=2.5cm, left=4cm, right=2cm, headsep=3mm]{geometry} \RequirePackage{array,longtable,booktabs} \RequirePackage{listings} \RequirePackage{fancyhdr} \RequirePackage{xcolor} \RequirePackage{enumitem} \RequirePackage{etoolbox} \RequirePackage{metalogo} \colorlet{thu@macro}{blue!60!black} \colorlet{thu@env}{blue!70!black} \colorlet{thu@option}{purple} \patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{thu@macro}}{}{} \patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{thu@macro}}{}{} \patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{thu@env}}{}{} \patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{thu@env}}{}{} \def\DescribeOption{% \leavevmode\@bsphack\begingroup\MakePrivateLetters% \Describe@Option} \def\Describe@Option#1{\endgroup \marginpar{\raggedleft\PrintDescribeOption{#1}}% \thu@special@index{option}{#1}\@esphack\ignorespaces} \def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{thu@option} #1\ } \def\thu@special@index#1#2{\@bsphack \begingroup \HD@target \let\HDorg@encapchar\encapchar \edef\encapchar usage{% \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}% }% \index{#2\actualchar{\string\ttfamily\space#2} (#1)\encapchar usage}% \index{#1:\levelchar#2\actualchar {\string\ttfamily\space#2}\encapchar usage}% \endgroup \@esphack} \lstdefinestyle{lstStyleBase}{% basicstyle=\small\ttfamily, aboveskip=\medskipamount, belowskip=\medskipamount, lineskip=0pt, boxpos=c, showlines=false, extendedchars=true, upquote=true, tabsize=2, showtabs=false, showspaces=false, showstringspaces=false, numbers=none, linewidth=\linewidth, xleftmargin=4pt, xrightmargin=0pt, resetmargins=false, breaklines=true, breakatwhitespace=false, breakindent=0pt, breakautoindent=true, columns=flexible, keepspaces=true, gobble=2, framesep=3pt, rulesep=1pt, framerule=1pt, backgroundcolor=\color{gray!5}, stringstyle=\color{green!40!black!100}, keywordstyle=\bfseries\color{blue!50!black}, commentstyle=\slshape\color{black!60}} \lstdefinestyle{lstStyleShell}{% style=lstStyleBase, frame=l, rulecolor=\color{purple}, language=bash} \lstdefinestyle{lstStyleLaTeX}{% style=lstStyleBase, frame=l, rulecolor=\color{violet}, language=[LaTeX]TeX} \lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{} \lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{} \setlist{nosep} \DeclareDocumentCommand{\option}{m}{\textsf{#1}} \DeclareDocumentCommand{\env}{m}{\texttt{#1}} \DeclareDocumentCommand{\pkg}{s m}{% \texttt{#2}\IfBooleanF#1{\thu@special@index{package}{#2}}} \DeclareDocumentCommand{\file}{s m}{% \texttt{#2}\IfBooleanF#1{\thu@special@index{file}{#2}}} \newcommand{\myentry}[1]{% \marginpar{\raggedleft\color{purple}\bfseries\strut #1}} \newcommand{\note}[2][Note]{{% \color{magenta}{\bfseries #1}\emph{#2}}} \def\thucoursework{\textsc{Thu}\-\textsc{Coursework}} \endinput %</dtx-style> % \end{macrocode} % \fi % \Finale % \endinput