├── .gitignore ├── AssignmentTemplate(En-ver) ├── AssignmentTemplate(En-dev).pdf ├── AssignmentTemplate(En-dev).tex ├── AssignmentTemplate(En-dist).pdf └── AssignmentTemplate(En-dist).tex ├── Examples ├── AssignmentExample-En.jpg └── AssignmentExample-Zh.jpg ├── Figures └── Lenna.jpg ├── LICENSE ├── README.md ├── assignment-en.pdf ├── assignment-en.tex ├── assignment-zh.pdf ├── assignment-zh.tex ├── assignment.cls ├── ref-en.bib ├── ref-zh.bib └── 作业模板(中文版) ├── 作业模板(中文-发布).pdf ├── 作业模板(中文-发布).tex ├── 作业模板(中文-开发).pdf └── 作业模板(中文-开发).tex /.gitignore: -------------------------------------------------------------------------------- 1 | ## Core latex/pdflatex auxiliary files: 2 | *.aux 3 | *.lof 4 | *.log 5 | *.lot 6 | *.fls 7 | *.out 8 | *.toc 9 | *.fmt 10 | *.fot 11 | *.cb 12 | *.cb2 13 | .*.lb 14 | 15 | ## Intermediate documents: 16 | *.dvi 17 | *.xdv 18 | *-converted-to.* 19 | # these rules might exclude image files for figures etc. 20 | # *.ps 21 | # *.eps 22 | # *.pdf 23 | 24 | ## Generated if empty string is given at "Please type another file name for output:" 25 | .pdf 26 | 27 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 28 | *.bbl 29 | *.bcf 30 | *.blg 31 | *-blx.aux 32 | *-blx.bib 33 | *.run.xml 34 | 35 | ## Build tool auxiliary files: 36 | *.fdb_latexmk 37 | *.synctex 38 | *.synctex(busy) 39 | *.synctex.gz 40 | *.synctex.gz(busy) 41 | *.pdfsync 42 | 43 | ## Build tool directories for auxiliary files 44 | # latexrun 45 | latex.out/ 46 | 47 | ## Auxiliary and intermediate files from other packages: 48 | # algorithms 49 | *.alg 50 | *.loa 51 | 52 | # achemso 53 | acs-*.bib 54 | 55 | # amsthm 56 | *.thm 57 | 58 | # beamer 59 | *.nav 60 | *.pre 61 | *.snm 62 | *.vrb 63 | 64 | # changes 65 | *.soc 66 | 67 | # comment 68 | *.cut 69 | 70 | # cprotect 71 | *.cpt 72 | 73 | # elsarticle (documentclass of Elsevier journals) 74 | *.spl 75 | 76 | # endnotes 77 | *.ent 78 | 79 | # fixme 80 | *.lox 81 | 82 | # feynmf/feynmp 83 | *.mf 84 | *.mp 85 | *.t[1-9] 86 | *.t[1-9][0-9] 87 | *.tfm 88 | 89 | #(r)(e)ledmac/(r)(e)ledpar 90 | *.end 91 | *.?end 92 | *.[1-9] 93 | *.[1-9][0-9] 94 | *.[1-9][0-9][0-9] 95 | *.[1-9]R 96 | *.[1-9][0-9]R 97 | *.[1-9][0-9][0-9]R 98 | *.eledsec[1-9] 99 | *.eledsec[1-9]R 100 | *.eledsec[1-9][0-9] 101 | *.eledsec[1-9][0-9]R 102 | *.eledsec[1-9][0-9][0-9] 103 | *.eledsec[1-9][0-9][0-9]R 104 | 105 | # glossaries 106 | *.acn 107 | *.acr 108 | *.glg 109 | *.glo 110 | *.gls 111 | *.glsdefs 112 | *.lzo 113 | *.lzs 114 | 115 | # uncomment this for glossaries-extra (will ignore makeindex's style files!) 116 | # *.ist 117 | 118 | # gnuplottex 119 | *-gnuplottex-* 120 | 121 | # gregoriotex 122 | *.gaux 123 | *.gtex 124 | 125 | # htlatex 126 | *.4ct 127 | *.4tc 128 | *.idv 129 | *.lg 130 | *.trc 131 | *.xref 132 | 133 | # hyperref 134 | *.brf 135 | 136 | # knitr 137 | *-concordance.tex 138 | # TODO Comment the next line if you want to keep your tikz graphics files 139 | *.tikz 140 | *-tikzDictionary 141 | 142 | # listings 143 | *.lol 144 | 145 | # luatexja-ruby 146 | *.ltjruby 147 | 148 | # makeidx 149 | *.idx 150 | *.ilg 151 | *.ind 152 | 153 | # minitoc 154 | *.maf 155 | *.mlf 156 | *.mlt 157 | *.mtc[0-9]* 158 | *.slf[0-9]* 159 | *.slt[0-9]* 160 | *.stc[0-9]* 161 | 162 | # minted 163 | _minted* 164 | *.pyg 165 | 166 | # morewrites 167 | *.mw 168 | 169 | # nomencl 170 | *.nlg 171 | *.nlo 172 | *.nls 173 | 174 | # pax 175 | *.pax 176 | 177 | # pdfpcnotes 178 | *.pdfpc 179 | 180 | # sagetex 181 | *.sagetex.sage 182 | *.sagetex.py 183 | *.sagetex.scmd 184 | 185 | # scrwfile 186 | *.wrt 187 | 188 | # sympy 189 | *.sout 190 | *.sympy 191 | sympy-plots-for-*.tex/ 192 | 193 | # pdfcomment 194 | *.upa 195 | *.upb 196 | 197 | # pythontex 198 | *.pytxcode 199 | pythontex-files-*/ 200 | 201 | # tcolorbox 202 | *.listing 203 | 204 | # thmtools 205 | *.loe 206 | 207 | # TikZ & PGF 208 | *.dpth 209 | *.md5 210 | *.auxlock 211 | 212 | # todonotes 213 | *.tdo 214 | 215 | # vhistory 216 | *.hst 217 | *.ver 218 | 219 | # easy-todo 220 | *.lod 221 | 222 | # xcolor 223 | *.xcp 224 | 225 | # xmpincl 226 | *.xmpi 227 | 228 | # xindy 229 | *.xdy 230 | 231 | # xypic precompiled matrices and outlines 232 | *.xyc 233 | *.xyd 234 | 235 | # endfloat 236 | *.ttt 237 | *.fff 238 | 239 | # Latexian 240 | TSWLatexianTemp* 241 | 242 | ## Editors: 243 | # WinEdt 244 | *.bak 245 | *.sav 246 | 247 | # Texpad 248 | .texpadtmp 249 | 250 | # LyX 251 | *.lyx~ 252 | 253 | # Kile 254 | *.backup 255 | 256 | # gummi 257 | .*.swp 258 | 259 | # KBibTeX 260 | *~[0-9]* 261 | 262 | # TeXnicCenter 263 | *.tps 264 | 265 | # auto folder when using emacs and auctex 266 | ./auto/* 267 | *.el 268 | 269 | # expex forward references with \gathertags 270 | *-tags.tex 271 | 272 | # standalone packages 273 | *.sta 274 | 275 | # Makeindex log files 276 | *.lpz 277 | -------------------------------------------------------------------------------- /AssignmentTemplate(En-ver)/AssignmentTemplate(En-dev).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chen-Jialin/Assignment-Template/68442e7595a08ce60a9e496baa709bbf3bb61ce8/AssignmentTemplate(En-ver)/AssignmentTemplate(En-dev).pdf -------------------------------------------------------------------------------- /AssignmentTemplate(En-ver)/AssignmentTemplate(En-dev).tex: -------------------------------------------------------------------------------- 1 | % !TEX program = pdflatex 2 | % !TEX options = -synctex=1 -interaction=nonstopmode -file-line-error "%DOC%" 3 | % Assignment Template 4 | \documentclass[UTF8,10pt,a4paper]{article} 5 | \usepackage[scheme=plain]{ctex}% Chinese support 6 | % assignment information 7 | \newcommand{\CourseName}{Course Name} 8 | \newcommand{\CourseCode}{Course Code} 9 | \newcommand{\Semester}{Season, 20} 10 | \newcommand{\ProjectName}{Assignment } 11 | \newcommand{\DueTimeType}{Due Date} 12 | \newcommand{\DueTime}{ , 20 (day)} 13 | \newcommand{\StudentName}{陈稼霖} 14 | \newcommand{\StudentID}{45875852} 15 | \usepackage[vmargin=1in,hmargin=.5in]{geometry}% page margin 16 | \usepackage{fancyhdr}% header and foot 17 | \usepackage{lastpage}% return the page number of the last page 18 | \usepackage{calc}% return the width of the text 19 | \pagestyle{fancy}% global header and foot style 20 | \fancyhf{}% clear the default header and foot 21 | \fancyhead[L]{\CourseName}% the left of the header 22 | \fancyhead[C]{\ProjectName}% the center of the header 23 | \fancyhead[R]{\StudentName}% the right of the header 24 | \fancyfoot[R]{\thepage\ / \pageref{LastPage}}% the right of the foot 25 | \setlength\headheight{12pt}% the height of the header 26 | \fancypagestyle{FirstPageStyle}{% the header and foot style of the first page 27 | \fancyhf{}% clear the default header and foot 28 | \fancyhead[L]{\CourseName\\ 29 | \CourseCode\\ 30 | \Semester}% the left of the header 31 | \fancyhead[C]{{\Huge\bfseries\ProjectName}\\ 32 | \DueTimeType\ : \DueTime}% the center of the header 33 | \fancyhead[R]{Name : \makebox[\widthof{\StudentID}][s]{\StudentName}\\ 34 | Student ID\@ : \StudentID\\ 35 | Score : \underline{\makebox[\widthof{\StudentID}]{}}}% the right of the header 36 | \fancyfoot[R]{\thepage\ / \pageref{LastPage}}% the right of the foot 37 | \setlength\headheight{36pt}% the height of the header 38 | } 39 | \usepackage{amsmath,amssymb,amsthm,bm}% basic math support, special math symbols, theorem custom, bold in equation 40 | \allowdisplaybreaks[4]% cross-page equations 41 | \newtheoremstyle{Problem}% theorem style name 42 | {}% space above theorem, being left empty means default 43 | {}% space below theorem, being left empty means default 44 | {}% theorem body font 45 | {}% theorem indent amount 46 | {\bfseries}% theorem head font 47 | {.}% punctuation after theorem head 48 | { }% space after theorem head, whitespace means normal interword space 49 | {\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)} Score: \underline{\qquad\qquad}}% theorem head spec, being left empty means default 50 | \theoremstyle{Problem}% set the theorem style 51 | \newtheorem{prob}{Problem}% problem 52 | \newtheoremstyle{Solution}% theorem style name 53 | {}% space above theorem, being left empty means default 54 | {}% space below theorem, being left empty means default 55 | {}% theorem body font 56 | {}% theorem indent amount 57 | {\bfseries}% theorem head font 58 | {:}% punctuation after theorem head 59 | { }% space after theorem head, whitespace means normal interword space 60 | {\thmname{#1}}% theorem head spec, being left empty means default 61 | \makeatletter 62 | \def\@endtheorem{\qed\endtrivlist\@endpefalse}% add qed symbols (black hollow small square) to the end of solutions 63 | \makeatother 64 | \theoremstyle{Solution}% set the theorem style 65 | \newtheorem*{sol}{Solution}% solution 66 | % \usepackage{mathrsfs}% non-CM calligraphic letters in equation - \mathscr{} 67 | % \usepackage{esint}% special integral signs 68 | % \providecommand{\abs}[1]{\left\lvert#1\right\rvert}% absolute - \abs 69 | % \providecommand{\norm}[1]{\left\lVert#1\right\rVert}% norm - \norm 70 | % \providecommand{\bra}[1]{\left\langle#1\right\rvert}% bra - \bra{} 71 | % \providecommand{\ket}[1]{\left\lvert#1\right\rangle}% ket - \ket{} 72 | % \providecommand{\braket}[2]{\left\langle#1\vert#2\right\rangle}% contiguous ket after bra - \braket{}{} 73 | % \usepackage{graphicx}% graphics - 74 | % \begin{figure}[htbp]% set the position of the figure 75 | % \centering% figure centering 76 | % \includegraphics[scale=.5]{figure-file-name} 77 | % \caption{figure-caption} 78 | % \label{figure-label} 79 | % \end{figure} 80 | % \usepackage{float}% set the position of figures mandatorily - [H] 81 | % \usepackage{subfigure}% subfigures in the figure environment - 82 | % \begin{figure}[htbp]set the position of the figure environment 83 | % \centering% figure environment centering 84 | % \subfigure[subfigure-caption]{ 85 | % \label{subfigure-label} 86 | % \includegraphics[width=0.45\textwidth]{subfigure-file-name}} 87 | % \subfigure[subfigure-caption]{ 88 | % \label{subfigure-label} 89 | % \includegraphics[width=0.45\textwidth]{subfigure-file-name}} 90 | % \caption{figure caption} 91 | % \label{figure-label} 92 | % \end{figure} 93 | % \usepackage{multirow}% tables with merged multi-row cells 94 | % \usepackage{booktabs}% three-line tables - \toprule, \midrule, \bottomrule 95 | % \usepackage{longtable}% cross-page tables - 96 | % \begin{center}% table centering 97 | % \begin{longtable}{lcr}% table columns aligning: l = left-aligning, c = center-aligning, r = right-aligning 98 | % \caption{table-caption} 99 | % \label{table-label} 100 | % \end{longtable} 101 | % \end{center} 102 | % \usepackage[version=4]{mhchem}% chemistry equations - \ce{} 103 | \begin{document} 104 | \thispagestyle{FirstPageStyle}% set the style of head and foot of the first page 105 | \begin{prob}[Problem title] 106 | This is the problem. 107 | \end{prob} 108 | \begin{sol} 109 | This is the solution. 110 | \end{sol} 111 | \end{document} -------------------------------------------------------------------------------- /AssignmentTemplate(En-ver)/AssignmentTemplate(En-dist).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chen-Jialin/Assignment-Template/68442e7595a08ce60a9e496baa709bbf3bb61ce8/AssignmentTemplate(En-ver)/AssignmentTemplate(En-dist).pdf -------------------------------------------------------------------------------- /AssignmentTemplate(En-ver)/AssignmentTemplate(En-dist).tex: -------------------------------------------------------------------------------- 1 | % !TEX program = pdflatex 2 | % !TEX options = -synctex=1 -interaction=nonstopmode -file-line-error "%DOC%" 3 | % Assignment Template 4 | \documentclass[UTF8,10pt,a4paper]{article} 5 | \usepackage[scheme=plain]{ctex} 6 | \newcommand{\CourseName}{Course Name} 7 | \newcommand{\CourseCode}{Course Code} 8 | \newcommand{\Semester}{Season, 20} 9 | \newcommand{\ProjectName}{Assignment } 10 | \newcommand{\DueTimeType}{Due Date} 11 | \newcommand{\DueTime}{ , 20 (day)} 12 | \newcommand{\StudentName}{陈稼霖} 13 | \newcommand{\StudentID}{45875852} 14 | \usepackage[vmargin=1in,hmargin=.5in]{geometry} 15 | \usepackage{fancyhdr} 16 | \usepackage{lastpage} 17 | \usepackage{calc} 18 | \pagestyle{fancy} 19 | \fancyhf{} 20 | \fancyhead[L]{\CourseName} 21 | \fancyhead[C]{\ProjectName} 22 | \fancyhead[R]{\StudentName} 23 | \fancyfoot[R]{\thepage\ / \pageref{LastPage}} 24 | \setlength\headheight{12pt} 25 | \fancypagestyle{FirstPageStyle}{ 26 | \fancyhf{} 27 | \fancyhead[L]{\CourseName\\ 28 | \CourseCode\\ 29 | \Semester} 30 | \fancyhead[C]{{\Huge\bfseries\ProjectName}\\ 31 | \DueTimeType\ : \DueTime} 32 | \fancyhead[R]{Name : \makebox[\widthof{\StudentID}][s]{\StudentName}\\ 33 | Student ID\@ : \StudentID\\ 34 | Score : \underline{\makebox[\widthof{\StudentID}]{}}} 35 | \fancyfoot[R]{\thepage\ / \pageref{LastPage}} 36 | \setlength\headheight{36pt} 37 | } 38 | \usepackage{amsmath,amssymb,amsthm,bm} 39 | \allowdisplaybreaks[4] 40 | \newtheoremstyle{Problem} 41 | {} 42 | {} 43 | {} 44 | {} 45 | {\bfseries} 46 | {.} 47 | { } 48 | {\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)} Score: \underline{\qquad\qquad}} 49 | \theoremstyle{Problem} 50 | \newtheorem{prob}{Problem} 51 | \newtheoremstyle{Solution} 52 | {} 53 | {} 54 | {} 55 | {} 56 | {\bfseries} 57 | {:} 58 | { } 59 | {\thmname{#1}} 60 | \makeatletter 61 | \def\@endtheorem{\qed\endtrivlist\@endpefalse} 62 | \makeatother 63 | \theoremstyle{Solution} 64 | \newtheorem*{sol}{Solution} 65 | % \usepackage{graphicx} 66 | \begin{document} 67 | \thispagestyle{FirstPageStyle} 68 | \begin{prob}[Problem title] 69 | This is the problem. 70 | \end{prob} 71 | \begin{sol} 72 | This is the solution. 73 | \end{sol} 74 | \end{document} -------------------------------------------------------------------------------- /Examples/AssignmentExample-En.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chen-Jialin/Assignment-Template/68442e7595a08ce60a9e496baa709bbf3bb61ce8/Examples/AssignmentExample-En.jpg -------------------------------------------------------------------------------- /Examples/AssignmentExample-Zh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chen-Jialin/Assignment-Template/68442e7595a08ce60a9e496baa709bbf3bb61ce8/Examples/AssignmentExample-Zh.jpg -------------------------------------------------------------------------------- /Figures/Lenna.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chen-Jialin/Assignment-Template/68442e7595a08ce60a9e496baa709bbf3bb61ce8/Figures/Lenna.jpg -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Chen Jialin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 作业模板 Assignment Template 2 | 3 | 可爱而优雅、功能齐全而稳定的 $\LaTeX$ 模板,适用于 4 | - 作业 5 | - 实验报告 6 | - 课程项目 7 | - 课程论文 8 | 9 | 等各种场景,支持 10 | - 中英双语 11 | - 数学公式 12 | - 图表 13 | - 量子线路图(会影响长表格环境) 14 | - 化学式 15 | - 程序代码 16 | - 文献引用 17 | 等功能. 18 | 19 | Cute and elegant, poly-functional and robust $\LaTeX$ template, applicable to various scenarios such as 20 | - assignments 21 | - experiment reports 22 | - course projects 23 | - course essays 24 | 25 | It is bilingual and supports functions including 26 | - mathematical formulas 27 | - figures 28 | - tables 29 | - quantum circuit diagram (may affect longtable environment) 30 | - chemistry formulas 31 | - program code 32 | - reference citing 33 | 34 | 同时支持 pdf$\LaTeX$ 和 Xe$\LaTeX$. 35 | 36 | Both pdf$\LaTeX$ and Xe$\LaTeX$ work. 37 | 38 | 自定义题目、题解、证明环境,自定义绝对值(`\abs{}`)、范数(`\norm{}`)、反双曲三角函数(`\arcsinh`、`\arccosh`、`\arctanh`)、复数实/虚部(`\re`、`\im`)、符号函数(`\sgn`)、辛格函数(`\sinc`)、矩形函数(`\rect`)、矩阵的迹(`\tr`)等 $\LaTeX$ 原生宏包未支持的数学、物理专业常用符号. 39 | 40 | Customized environments of problems, solutions and proofs; customized operators common used in mathematics and physics which are not originally supported by $\LaTeX$ packages, such as absolute value (`\abs{}`), norm (`\norm{}`), inverse hyperbolic function (`\arcsinh`, `\arccosh`, `\arctanh`), real / imaginary part of complex numbers (`\re`, `\im`), sign function (`\sgn`), sinc function(`\sinc`), rectangular function (`\rect`), trace of matrices (`\tr`), etc. 41 | 42 | ## 基本用法 Basic usage 43 | 44 | #### 中文版: 45 | 0. 将类文件 `assignment.cls` 与 `*.tex` 文件置于同一路径下; 46 | 1. `*.tex` 文件开头用 `\documentclass{assignment}` 调用本作业模板类; 47 | 2. 导言区用 `\ProjectInfos{<课程名称>}{<课程代码>}{<学期>}{<项目名称>}{<项目副标题或补充信息>}{<姓名>}[<姓名上的超链接>]{<学号>}` 设置页眉、页脚; 48 | 3. 分别用 `\begin{prob}...\end{prob}`、`\begin{sol}...\end{sol}` 和 `\begin{pf}...\end{pf}` 调用题目、题解、证明环境; 49 | 4. 已添加支持数学公式、图表、化学式、程序代码、文献引用等的宏包,仿照示例文件 `Assignment-zh*` 使用即可; 50 | 5. 用 pdf$\LaTeX$ 或 Xe$\LaTeX$ 编译. 因引用了末页页码,因此需连续编译两次. 如有文献引用,按照 pdf$\LaTeX\rightarrow$bib$\TeX\rightarrow$pdf$\LaTeX\rightarrow$pdf$\LaTeX$ 或 Xe$\LaTeX\rightarrow$bib$\TeX\rightarrow$Xe$\LaTeX\rightarrow$Xe$\LaTeX$ 顺序编译. 51 | 52 | **注意**: 若 `ctex` 包依赖字体缺失, 则将导致 `Critical Package ctex: CTeX fontset 'fandol' is unavailable in current (ctex) mode.` 报错, 此时请选择 Xe$\LaTeX$ 编译. 53 | 54 | #### English version: 55 | 0. Make sure that this class file `assignment.cls` is in the same path as `*.tex` file; 56 | 1. Call the assignment template class with `\documentclass[en]{assignment}` at the beginning of `*.tex` file; 57 | 2. Set the headers and the footers with `\ProjectInfos{}{}{}{}{}{}[]{}`; 58 | 3. Call environments of problems, solutions and proofs with `\begin{prob}...\end{prob}`, `\begin{sol}...\end{sol}` and `\begin{pf}...\end{pf}`, respectively; 59 | 4. Packages for mathematical formulas, figures, tables, chemistry formulas, reference citing have been included. See their usages in example files `Assignment-en.*`; 60 | 5. Compile with pdf$\LaTeX$ or Xe$\LaTeX$. Need to compile twice because of references to the page number of the last page. Compile in the order of pdf$\LaTeX\rightarrow$bib$\TeX\rightarrow$pdf$\LaTeX\rightarrow$pdf$\LaTeX$ or Xe$\LaTeX\rightarrow$bib$\TeX\rightarrow$Xe$\LaTeX\rightarrow$Xe$\LaTeX$, if there is any reference citing. 61 | 62 | **Attention**: Lack of dependent fonts for `ctex` package will cause error `Critical Package ctex: CTeX fontset 'fandol' is unavailable in current (ctex) mode.`. Then please compile with Xe$\LaTeX$ 63 | 64 | ## 效果展示 Examples 65 | 66 | ![中文版效果图](Examples/AssignmentExample-Zh.jpg) 67 | 68 | ![English version example](Examples/AssignmentExample-En.jpg) 69 | 70 | ## 注意 Note 71 | 72 | 文件夹 `作业模板(中文版)` 和 `AssignmentTemplate(En-ver)` 是已不再维护的旧版本. 73 | 74 | In folder `作业模板(中文版)` and `AssignmentTemplate(En-ver)` are the old-version templates which are not maintained anymore. 75 | 76 | ## 待做 TODO 77 | 78 | 暂无. 79 | 80 | Null for now. -------------------------------------------------------------------------------- /assignment-en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chen-Jialin/Assignment-Template/68442e7595a08ce60a9e496baa709bbf3bb61ce8/assignment-en.pdf -------------------------------------------------------------------------------- /assignment-en.tex: -------------------------------------------------------------------------------- 1 | % !TEX program = pdflatex -> bibtex -> pdflatex*2 2 | \documentclass[en, twoside]{assignment} 3 | \ProjectInfos{Quantum Mechanics}{PHYS1501}{Fall, 2020}{Assignment 1}{Due date : 2020. 09. 08 (Tuesday)}{Multipluz}[https://github.com/Chen-Jialin]{45875852} 4 | 5 | \begin{document} 6 | \begin{prob} 7 | Show that this \LaTeX{} template supports following functions: 8 | \begin{itemize} 9 | \item[(1)] Mathematical formulas; 10 | \item[(2)] Chemistry formulas. 11 | % \item[(3)] Quantum circuit diagram. 12 | \end{itemize} 13 | \end{prob} 14 | \begin{pf} 15 | \begin{itemize} 16 | \item[(1)] In three-dimensional space, the Schrödinger equation of a particle in a potential $V(\bm{r},t)$ is 17 | \begin{equation} 18 | i\hbar\frac{\partial}{\partial t}\lvert\psi(\bm{r},t)\rangle=-\frac{\hbar^2}{2m}\nabla^2\lvert\psi(\bm{r},t)\rangle+V(\bm{r},t)\lvert\psi(\bm{r},t)\rangle. 19 | \end{equation} 20 | \item[(2)] Heating and using concentrated sulfuric acid as catalyst, benzene can react with nitric acid to produce nitrobenzene: 21 | % online tool: https://py-chemist.com/mol_2_chemfig/home 22 | \begin{equation} 23 | \ce{\chemfig{*6([,.5]-=-=-=)} + \chemfig{[,.75]HO-NO_2} ->[\mbox{concentrated }H2SO4][$\Delta$] \chemfig{*6([,.5]-=-(-NO_2)=-=)} + H2O}. 24 | \end{equation} 25 | % \item[(3)] The circuit of quantum Fourier transform is 26 | % \begin{center} 27 | % \begin{quantikz} 28 | % \lstick{$q_0$} & \gate{H} & \gate{\begin{array}{c}P\\\pi/8\end{array}} & \gate{\begin{array}{c}P\\\pi/4\end{array}} & \gate{\begin{array}{c}P\\\pi/2\end{array}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ 29 | % \lstick{$q_1$} & \qw & \qw & \qw & \ctrl{-1} & \gate{H} & \gate{\begin{array}{c}P\\\pi/4\end{array}} & \gate{\begin{array}{c}P\\\pi/2\end{array}} & \qw & \qw & \qw & \qw\\ 30 | % \lstick{$q_2$} & \qw & \qw & \ctrl{-2} & \qw & \qw & \qw & \ctrl{-1} & \gate{H} & \gate{\begin{array}{c}P\\\pi/2\end{array}} & \qw & \qw\\ 31 | % \lstick{$q_3$} & \qw & \ctrl{-3} & \qw & \qw & \qw & \ctrl{-2} & \qw & \qw & \ctrl{-1} & \gate{H} & \qw 32 | % \end{quantikz} 33 | % \end{center} 34 | \end{itemize} 35 | \end{pf} 36 | 37 | \clearpage 38 | 39 | \begin{prob} 40 | Conduct following operation: 41 | \begin{itemize} 42 | \item[(1)] Insert figures: 43 | \begin{itemize} 44 | \item[(a)] single figure, setting its position mandatorily; 45 | \item[(b)] two subfigures; 46 | \end{itemize} 47 | \item[(2)] Insert such a table: 48 | \begin{itemize} 49 | \item[$\triangleright$] with merged multi-row and multi-column cells; 50 | \item[$\triangleright$] three-line table; 51 | \item[$\triangleright$] cross-page; 52 | \end{itemize} 53 | \item[(3)] Insert code; 54 | \item[(4)] Cite a reference. 55 | \end{itemize} 56 | \end{prob} 57 | \begin{sol} 58 | \begin{itemize} 59 | \item[(1)] 60 | \begin{itemize} 61 | \item[(a)] As figure \ref{Lenna}. 62 | \begin{figure}[hbt!] 63 | \centering 64 | \includegraphics[width=.2\textwidth]{Lenna.jpg} 65 | \caption{Lenna.} 66 | \label{Lenna} 67 | \end{figure} 68 | \item[(b)] As the subfigures \ref{lenna1} and \ref{lenna2} in figure \ref{Lenna2}. 69 | \begin{figure}[hbt!] 70 | \centering 71 | \subfigure[lenna 1.]{ 72 | \label{lenna1} 73 | \includegraphics[width=.2\textwidth]{Lenna.jpg}} 74 | \subfigure[lenna 2.]{ 75 | \label{lenna2} 76 | \includegraphics[width=.2\textwidth]{Lenna.jpg}} 77 | \caption{Lenna.} 78 | \label{Lenna2} 79 | \end{figure} 80 | \end{itemize} 81 | \item[(2)] As table \ref{my-table}. 82 | \begin{center} 83 | \begin{longtable}{ccccc} 84 | \caption{Exemplary table.} 85 | \label{my-table}\\ \toprule 86 | \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}merged multi-row\\ cell\end{tabular}} & \multicolumn{2}{c}{merged multi-column cell} & \multicolumn{2}{c}{merged multi-column cell} \\ \cline{2-5} 87 | & Column 1 & Column 2 & Column a & Column b \\ \midrule 88 | If & you & shed & tears & when \\ 89 | you & missed & the & sun & \\ 90 | you & also & miss & the & stars \\ \bottomrule 91 | \end{longtable} 92 | \end{center} 93 | \item[(3)] Code are shown as following: 94 | \begin{lstlisting}[language=Fortran] 95 | program main 96 | implicit none 97 | 98 | write(*,*) 'hello world' 99 | end program main 100 | \end{lstlisting} 101 | \item[(4)] This book \cite{cohen2006quantum} provides a good introduction to quantum mechanics. 102 | \end{itemize} 103 | \end{sol} 104 | 105 | \bibliographystyle{unsrt} 106 | \bibliography{ref-en} 107 | \end{document} -------------------------------------------------------------------------------- /assignment-zh.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chen-Jialin/Assignment-Template/68442e7595a08ce60a9e496baa709bbf3bb61ce8/assignment-zh.pdf -------------------------------------------------------------------------------- /assignment-zh.tex: -------------------------------------------------------------------------------- 1 | % !TEX program = pdflatex -> bibtex -> pdflatex*2 2 | \documentclass{assignment} 3 | \ProjectInfos{量子力学}{PHYS1501}{2020-2021学年第一学期}{第一次作业}{截止时间:2020. 09. 08(周二)}{陈润植}[https://github.com/Chen-Jialin]{45875852} 4 | 5 | \begin{document} 6 | \begin{prob} 7 | 请证明本 \LaTeX{} 模板支持以下功能: 8 | \begin{itemize} 9 | \item[(1)] 数学公式; 10 | \item[(2)] 化学反应方程式。 11 | % \item[(3)] 量子线路图. 12 | \end{itemize} 13 | \end{prob} 14 | \begin{pf} 15 | \begin{itemize} 16 | \item[(1)] 三维空间中,位于位势 $V(\bm{r},t)$ 中的单粒子薛定谔方程为 17 | \begin{equation} 18 | i\hbar\frac{\partial}{\partial t}\lvert\psi(\bm{r},t)\rangle=-\frac{\hbar^2}{2m}\nabla^2\lvert\psi(\bm{r},t)\rangle+V(\bm{r},t)\lvert\psi(\bm{r},t)\rangle. 19 | \end{equation} 20 | \item[(2)] 加热并用浓硫酸催化,苯可与硝酸反应生成硝基苯: 21 | % 在线工具:https://py-chemist.com/mol_2_chemfig/home 22 | \begin{equation} 23 | \ce{\chemfig{*6([,.5]-=-=-=)} + \chemfig{[,.75]HO-NO_2} ->[\mbox{浓硫酸}][$\Delta$] \chemfig{*6([,.5]-=-(-NO_2)=-=)} + H2O}. 24 | \end{equation} 25 | % \item[(3)] 量子傅里叶变换的线路图为 26 | % \begin{center} 27 | % \begin{quantikz} 28 | % \lstick{$q_0$} & \gate{H} & \gate{\begin{array}{c}P\\\pi/8\end{array}} & \gate{\begin{array}{c}P\\\pi/4\end{array}} & \gate{\begin{array}{c}P\\\pi/2\end{array}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ 29 | % \lstick{$q_1$} & \qw & \qw & \qw & \ctrl{-1} & \gate{H} & \gate{\begin{array}{c}P\\\pi/4\end{array}} & \gate{\begin{array}{c}P\\\pi/2\end{array}} & \qw & \qw & \qw & \qw\\ 30 | % \lstick{$q_2$} & \qw & \qw & \ctrl{-2} & \qw & \qw & \qw & \ctrl{-1} & \gate{H} & \gate{\begin{array}{c}P\\\pi/2\end{array}} & \qw & \qw\\ 31 | % \lstick{$q_3$} & \qw & \ctrl{-3} & \qw & \qw & \qw & \ctrl{-2} & \qw & \qw & \ctrl{-1} & \gate{H} & \qw 32 | % \end{quantikz} 33 | % \end{center} 34 | \end{itemize} 35 | \end{pf} 36 | 37 | \clearpage 38 | \begin{prob} 39 | 请完成以下操作: 40 | \begin{itemize} 41 | \item[(1)] 插入图片; 42 | \begin{itemize} 43 | \item[(a)] 单张图片,强制设定图片位置; 44 | \item[(b)] 两张子图; 45 | \end{itemize} 46 | \item[(2)] 插入表格,要求如下: 47 | \begin{itemize} 48 | \item[$\triangleright$] 含有多行、多列单元格合并; 49 | \item[$\triangleright$] 三线表; 50 | \item[$\triangleright$] 表格跨页; 51 | \end{itemize} 52 | \item[(3)] 插入代码; 53 | \item[(4)] 引用文献。 54 | \end{itemize} 55 | \end{prob} 56 | \begin{sol} 57 | \begin{itemize} 58 | \item[(1)] 59 | \begin{itemize} 60 | \item[(a)] 如图 \ref{Lenna}。 61 | \begin{figure}[hbt!] 62 | \centering 63 | \includegraphics[width=.2\textwidth]{Lenna.jpg} 64 | \caption{莱娜} 65 | \label{Lenna} 66 | \end{figure} 67 | \item[(b)] 如图 \ref{Lenna2}中的子图 \ref{lenna1} 和 \ref{lenna2}。 68 | \begin{figure}[hbt!] 69 | \centering 70 | \subfigure[莱娜 1]{ 71 | \label{lenna1} 72 | \includegraphics[width=0.2\textwidth]{Lenna.jpg}} 73 | \subfigure[莱娜 2]{ 74 | \label{lenna2} 75 | \includegraphics[width=0.2\textwidth]{Lenna.jpg}} 76 | \caption{莱娜} 77 | \label{Lenna2} 78 | \end{figure} 79 | \end{itemize} 80 | \item[(2)] 如表 \ref{my-table}。 81 | % 在线工具:https://www.tablesgenerator.com/ 82 | \begin{center} 83 | \begin{longtable}{ccccc} 84 | \caption{示例表格} 85 | \label{my-table}\\ \toprule 86 | \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}多行单元格\\ 合并\end{tabular}} & \multicolumn{2}{c}{多列单元格合并} & \multicolumn{2}{c}{多列单元格合并} \\ \cline{2-5} 87 | & 列1 & 列2 & 列a & 列b \\ \midrule 88 | 如 & 迈 & 咽 & 霜 & 西 \\ 89 | 海 & 步 & 雄 & 晨 & 风 \\ 90 | 残 & 从 & 关 & 月 & 烈 \\ 91 | 阳 & 头 & 漫 & 马 & 长 \\ 92 | 如 & 越 & 道 & 蹄 & 空 \\ 93 | 血 & 从 & 真 & 声 & 雁 \\ 94 | & 头 & 如 & 碎 & 叫 \\ 95 | & 越 & 铁 & 喇 & 霜 \\ 96 | & 苍 & 而 & 叭 & 晨 \\ 97 | & 山 & 今 & 声 & 月 \\ \bottomrule 98 | \end{longtable} 99 | \end{center} 100 | \item[(3)] 代码如下: 101 | \begin{lstlisting}[language=Fortran] 102 | program main 103 | implicit none 104 | 105 | write(*,*) 'hello world' 106 | end program main 107 | \end{lstlisting} 108 | \item[(4)] 鲁迅先生说过 \cite{luxun2006}:“贪安稳就没有自由,要自由就要历些危险,只有这两条路。” 109 | \end{itemize} 110 | \end{sol} 111 | 112 | \bibliographystyle{unsrt} 113 | \bibliography{ref-zh} 114 | \end{document} -------------------------------------------------------------------------------- /assignment.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e} 2 | \ProvidesClass{assignment}[2020/09/08 Class for assignments] 3 | 4 | %% 选项 Options 5 | % 边数模式 Side mode 6 | \providecommand{\Side}{oneside}% 单边 (不分奇偶数页, 默认) 或双边 (区分奇偶数页) 模式 Oneside (not distinguishing odd or even pages, default) or twoside (distinguishing odd and even pages) mode 7 | \newif\ifTwoSide% [布尔变量] 是否为双边模式 [Bool] Whether twoside mode or not (default) 8 | \DeclareOption{oneside}% 单边模式 Oneside mode 9 | { 10 | \renewcommand{\Side}{oneside} 11 | \TwoSidefalse 12 | } 13 | \DeclareOption{twoside}% 双边模式 Twoside mode 14 | { 15 | \renewcommand{\Side}{twoside} 16 | \TwoSidetrue 17 | } 18 | 19 | % 语言 Language 20 | \newif\ifUsingEnglish% [布尔变量] 是否 (默认) 使用英语 [Bool] Whether using English or not (default) 21 | \DeclareOption{zh}% 使用中文 22 | { 23 | \UsingEnglishfalse 24 | \PassOptionsToPackage{scheme=chinese}{ctex}% 用 ctex 宏包汉化文档结构 Chinesize the structure of the file with ctex package 25 | } 26 | \DeclareOption{en}% Using English 27 | { 28 | \UsingEnglishtrue 29 | \PassOptionsToPackage{scheme=plain}{ctex}% 阻止 ctex 宏包过度汉化 Suppress excessive chinesization by ctex package 30 | } 31 | \ProcessOptions\relax 32 | 33 | % 其余变量传递给 article 类 Other options passed to article class 34 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} 35 | \ProcessOptions\relax 36 | 37 | %% 加载文档类 Load class 38 | \LoadClass[a4paper, \Side, 10pt]{article}% 加载纸张大小为 A4, \Side 模式, 字号为 10 号的 article 类 Load article class with A4 paper, \Side style and 10pt font 39 | 40 | %% 调用宏包 Call packages 41 | \RequirePackage[UTF8]{ctex}% 中文支持 Chinese support 42 | 43 | \RequirePackage[vmargin=1in,hmargin=.5in]{geometry}% 页边距 Page margin 44 | 45 | % 自定义页眉和页脚 Header and footer customization 46 | \RequirePackage{fancyhdr}% 页眉和页脚 Header & footer 47 | \RequirePackage{xparse}% 多可选参数的自定义命令 Newcommand with multiple optional arguements 48 | \RequirePackage{lastpage}% 返回末页页码 Return page number of the last page 49 | \RequirePackage{calc}% 返回文本宽度 Return width of text 50 | % \RequirePackage[fit]{truncate}% 截断过长文本 Truncate overlong text 51 | 52 | % 数学公式 Mathematical equations 53 | \RequirePackage{amsmath, amssymb, amsthm, bm, mathtools}% 基础数学支持, 特殊数学符号, 自定义定理, 公式内加粗 Basic math support, special math symbols, theorem customization, bold in equations 54 | \RequirePackage{mathrsfs}% 公式内花体字母 Non-CM calligraphic letters in equations 55 | \RequirePackage{esint}% 特殊积分号 Special integral signs 56 | \RequirePackage{siunitx}% 格式化物理量 (包括数值和单位) Formatted physical quantities (including values and units) 57 | \RequirePackage[thicklines]{cancel}% 公式内删除线 Cancel lines in equations 58 | 59 | % 图片 Figures 60 | \RequirePackage{graphicx}% 插入图片 Insert graphics 61 | \RequirePackage{float}% 强制设定图片位置 Set the positions of figures mandatorily 62 | \RequirePackage{subfigure}% figure环境中子图 Subfigures in the figure environment 63 | \RequirePackage{tikz}% 绘图 Create graphics 64 | % \usetikzlibrary{quantikz}% 绘制量子电路图 (会影响 longtable 环境的正常工作) Plot quantum circuit diagrams (may affect normal performance of longtable environments) 65 | 66 | % 表格 Tables 67 | \RequirePackage{multirow}% 表内多行单元格合并 Tables with merged multi-row cells 68 | \RequirePackage{booktabs}% 三线表 Three-line tables 69 | \RequirePackage{longtable}% 表格跨页 Cross-page tables 70 | \RequirePackage{lscape}% 横排表格 Landscape tables 71 | \RequirePackage{diagbox}% 对角线分割单元格 Cells saperated by diagonal lines 72 | 73 | % 化学式 Chemstry formulas 74 | \RequirePackage[version=4]{mhchem}% 基础化学式 Basic chemistry equations 75 | \RequirePackage{chemfig}% 化学结构式 Chemistry structural formulas 76 | 77 | \RequirePackage{listings}% 程序代码 Program code 78 | 79 | % 其他 Others 80 | \RequirePackage{ulem}% 各式下划线和删除标记 Various underlines & deletion notes 81 | \normalem% 避免将意大利斜体 (\emph 或 \em) 替换为下划线 Avoide replacing italics (\emph or \em) with underlines 82 | \RequirePackage{color}% 文本颜色 Text color 83 | \RequirePackage{hyperref}% 超链接 Hyperlink 84 | \RequirePackage{framed}% 文本加框 Framed text 85 | \RequirePackage{footmisc}% 脚注引用 Footnote reference 86 | 87 | % 页眉和页脚 Header & footer 88 | \ifUsingEnglish 89 | \providecommand{\Name}{Name}% "Name" at the right of the header 90 | \providecommand{\StudentID}{Student ID}% "Student ID" at the right of the header 91 | \providecommand{\Grade}{Grade}% "Grade" at the right of the header 92 | \else 93 | \providecommand{\Name}{姓名}% 页眉右 "姓名" 94 | \providecommand{\StudentID}{学号}% 页眉右 "学号" 95 | \providecommand{\Grade}{成绩}% 页眉右 "成绩" 96 | \fi 97 | \pagestyle{fancy}% 全局页眉和页脚风格 Global header and footer style 98 | \fancyhf{}% 清除预设的页眉和页脚 Clear default header and footer 99 | % #1 课程名称 Course name 100 | % #2 课程代码 Course code 101 | % #3 学期 Semeter 102 | % #4 项目标题 Project title 103 | % #5 项目副标题或补充信息 Project subtitle / supplementary information 104 | % #6 姓名 Student name 105 | % #7 姓名上的超链接 Hyperlink on student name 106 | % #8 学号 Student ID 107 | \NewDocumentCommand{\ProjectInfos}{ m m m m m m O{https://github.com/Chen-Jialin} m } 108 | { 109 | \fancyhead[C]{#4}% 页眉中 The center of the header 110 | \ifTwoSide 111 | \fancyhead[LE]{#1}% 偶数页眉左 The left of even page header 112 | \fancyhead[RE]{\href{#7}{#6}}% 偶数页眉右 The right of even page header 113 | \fancyhead[LO]{#8}% 奇数页眉左 The left of odd page header 114 | \fancyhead[RO]{#2}% 奇数页眉右 The right of odd page header 115 | \else 116 | \fancyhead[L]{\href{#7}{#6}}% 页眉右 The left of the header 117 | \fancyhead[R]{#4}% 页眉右 The right of the header 118 | \fi 119 | \setlength{\headheight}{14pt}% 页眉高 Height of the header 120 | \fancypagestyle{FirstPage}% 首页页眉和页脚风格 First-page header and footer Style 121 | { 122 | \fancyhf{}% 清除预设的页眉和页脚 Clear default header and footer 123 | \setlength{\headheight}{38pt}% 页眉高 Height of the header 124 | \fancyhead[L]{#1\\ 125 | #2\\ 126 | #3}% 页眉左 The left of the header 127 | \fancyhead[C]{{\Huge\bfseries#4}\\ 128 | #5}% 页眉中 The center of the header 129 | \fancyhead[R]{\Name{} : \makebox[\maxof{\widthof{#6}}{\widthof{#8}}][s]{\href{#7}{#6}}\\ 130 | \StudentID{} : \makebox[\maxof{\widthof{#6}}{\widthof{#8}}][s]{#8}\\ 131 | \Grade{} : \underline{\makebox[\maxof{\widthof{#6}}{\widthof{#8}}][s]{}}}% 页眉右 The right of the header 132 | \fancyfoot[R]{\thepage\ / \pageref{LastPage}}% 页脚右: <当前页码> / <总页数> The right of the footer: / 133 | } 134 | \thispagestyle{FirstPage}% 设置首页页眉风格为 FirstPage Set header style of the first page as FirstPage 135 | } 136 | \ifTwoSide 137 | \fancyfoot[RO]{\thepage\ / \pageref{LastPage}}% 奇数页脚右: <当前页码> / <总页数> The right of odd page footer: / 138 | \fancyfoot[LE]{\thepage\ / \pageref{LastPage}}% 偶数页脚左: <当前页码> / <总页数> The left of even page footer: / 139 | \else 140 | \fancyfoot[R]{\thepage\ / \pageref{LastPage}}% 页脚右: <当前页码> / <总页数> The right of the footer: / 141 | \fi 142 | 143 | \allowdisplaybreaks[4]% 公式跨页 Cross-page equations 144 | \providecommand{\abs}[1]{\left\lvert#1\right\rvert}% 绝对值 Absolute value 145 | \providecommand{\norm}[1]{\left\lVert#1\right\rVert}% 范数 Norm 146 | \DeclareMathOperator{\arcsinh}{arcsinh}% 反双曲正弦 Inverse hyperbolic sine 147 | \DeclareMathOperator{\arccosh}{arccosh}% 反双曲余弦 Inverse hyperbolic cosine 148 | \DeclareMathOperator{\arctanh}{arctanh}% 反双曲正切 Inverse hyperbolic tangent 149 | \DeclareMathOperator{\re}{Re}% 复数的实部 Real part of complex number 150 | \DeclareMathOperator{\im}{Im}% 复数的虚部或映射的像 Imaginary part of complex number or image of mapping 151 | \DeclareMathOperator{\sgn}{sgn}% 符号函数 Sign function 152 | \DeclareMathOperator{\sinc}{sinc}% 辛格函数 Sinc function 153 | \DeclareMathOperator{\rect}{rect}% 矩形函数 Rectangular function 154 | \DeclareMathOperator{\tr}{Tr}% 矩阵的迹 Trace of matrix 155 | \DeclareMathOperator{\res}{Res}% 留数 Residue 156 | 157 | % 题目和题解风格 Problem and solution style 158 | \ifUsingEnglish 159 | \newtheoremstyle{Problem}% Theorem style name 160 | {}% Space above theorem, being left empty means default 161 | {}% Space below theorem, being left empty means default 162 | {}% Theorem body font 163 | {}% Theorem indent amount 164 | {\bfseries}% Theorem head font 165 | {.}% Punctuation after theorem head 166 | { }% Space after theorem head, whitespace means normal interword space 167 | {\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)} Score: \underline{\qquad\qquad}}% Theorem head spec, being left empty means default 168 | \theoremstyle{Problem}% Set theorem style 169 | \newtheorem{prob}{Problem}% Problem 170 | \providecommand{\Solution}{Solution}% "Solution" in solution environment (sol) 171 | \providecommand{\Answer}{Answer}% "Answer" in answer environment (ans) 172 | \providecommand{\Proof}{Proof}% "Proof" in proof environment (pf) 173 | \else 174 | \newtheoremstyle{Problem}% 定理风格名称 175 | {}% 定理上方空间尺寸, 留空为默认 176 | {}% 定理下方空间尺寸, 留空为默认 177 | {}% 定理主体字体 178 | {}% 定理缩进量 179 | {\bfseries}% 定理开头字体 180 | {.}% 定理开头后所接标点 181 | { }% 定理开头后所接空间尺寸, 空格为默认词间距 182 | {第\thmnumber{ #2}\thmname{ #1 }\thmnote{ (#3)} 得分: \underline{\qquad\qquad}}% 定理开头格式, 留空为默认 183 | \theoremstyle{Problem}% 设定定理风格 184 | \newtheorem{prob}{题}% 题目 185 | \providecommand{\Solution}{解}% 题解环境 (sol) 中的 "解" 186 | \providecommand{\Answer}{答}% 回答环境 (ans) 中的 "答" 187 | \providecommand{\Proof}{证}% 证明环境 (pf) 中的 "证" 188 | \fi 189 | \newtheoremstyle{Solution}% 定理风格名称 Theorem style name 190 | {}% 定理上方空间尺寸, 留空为默认 Space above theorem, being left empty means default 191 | {}% 定理下方空间尺寸, 留空为默认 Space below theorem, being left empty means default 192 | {}% 定理主体文本字体 Theorem body font 193 | {}% 定理缩进量 Theorem indent amount 194 | {\bfseries}% 定理开头字体 Theorem head font 195 | {:}% 定理开头后所接标点 Punctuation after theorem head 196 | { }% 定理开头后所接空间尺寸, 空格为默认词间距 Space after theorem head, whitespace means normal interword space 197 | {\thmname{#1}}% 定理开头格式 Theorem head spec, being left empty means default 198 | \makeatletter 199 | \def\@endtheorem{\qed\endtrivlist\@endpefalse}% 题解末尾添加 QED 符号 (黑色空心小正方形)% Add QED symbols (black hollow small square) to the end of solutions 200 | \makeatother 201 | \theoremstyle{Solution}% 设定定理风格 Set theorem style 202 | \newtheorem*{sol}{\Solution}% 题解 Solution 203 | \newtheorem*{ans}{\Answer}% 回答 Answer 204 | \newtheorem*{pf}{\Proof}% 证明 Proof 205 | 206 | \providecommand{\muline}[1]{\text{\uline{$#1$}}}% 公式内下划线 Underlines in equations 207 | \providecommand{\muuline}[1]{\text{\uuline{$#1$}}}% 公式内双下划线 Double underlines in equations 208 | \providecommand{\muwave}[1]{\text{\wave{$#1$}}}% 公式内波浪下划线 Wavy underlines in equations 209 | \providecommand{\msout}[1]{\text{\sout{$#1$}}}% 公式内删除线 Strickout in equations 210 | \providecommand{\mxout}[1]{\text{\xout{$#1$}}}% 公式内删除标记 (多条斜线) Deletion notes (multiple slashes) in equations 211 | \providecommand{\mdashuline}[1]{\text{\dashuline{$#1$}}}% 公式内虚下划线 Dashed underlines in equations 212 | \providecommand{\mdotuline}[1]{\text{\dotuline{$#1$}}}% 公式内点状虚下划线 Dotted underlines in equations 213 | 214 | \graphicspath{{Figures/}}% 图片路径 Figure path 215 | 216 | % 插入代码风格 Inserted code style 217 | \lstset 218 | { 219 | upquote=true,% 左右引号输出为 ‘’ (false) 或 `' (true) Print left and right quote as ‘’ or `' 220 | showtabs=true,% 显示制表符 Show tabs 221 | tab=\rightarrowfill,% 用右箭头填充制表符 Fill tabs with right arrows 222 | showspaces=false,% 显示空格 Show blank spaces 223 | showstringspaces=false,% 显示字符串中空格 Show blank spaces in string 224 | numbers=left,% 在左侧添加行号 Add line numbers at left 225 | breaklines=true,% 自动折行 Automatic line wrapping 226 | breakatwhitespace=true,% Break lines only at white space 227 | frame=single% 用单线框围绕代码 Enclose code with single-line frames 228 | } 229 | 230 | % 超链接自动换行 Hyperlink automatic line wrapping 231 | \makeatletter 232 | \def\UrlAlphabet{% 233 | \do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j% 234 | \do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t% 235 | \do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D% 236 | \do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M\do\N% 237 | \do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X% 238 | \do\Y\do\Z} 239 | \def\UrlDigits{\do\1\do\2\do\3\do\4\do\5\do\6\do\7\do\8\do\9\do\0} 240 | \g@addto@macro{\UrlBreaks}{\UrlOrds} 241 | \g@addto@macro{\UrlBreaks}{\UrlAlphabet} 242 | \g@addto@macro{\UrlBreaks}{\UrlDigits} 243 | \makeatother -------------------------------------------------------------------------------- /ref-en.bib: -------------------------------------------------------------------------------- 1 | @misc{cohen2006quantum, 2 | title={Quantum Mechanics (2 vol. set)}, 3 | author={Cohen-Tannoudji, Claude and Diu, Bernard and Laloe, Frank and Dui, Bernard}, 4 | year={2006}, 5 | publisher={Wiley-Interscience} 6 | } -------------------------------------------------------------------------------- /ref-zh.bib: -------------------------------------------------------------------------------- 1 | @book{luxun2006, 2 | title={编年体鲁迅著作全集: 1926-1927}, 3 | author={鲁迅}, 4 | volume={3}, 5 | year={2006}, 6 | publisher={福建教育出版社} 7 | } -------------------------------------------------------------------------------- /作业模板(中文版)/作业模板(中文-发布).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chen-Jialin/Assignment-Template/68442e7595a08ce60a9e496baa709bbf3bb61ce8/作业模板(中文版)/作业模板(中文-发布).pdf -------------------------------------------------------------------------------- /作业模板(中文版)/作业模板(中文-发布).tex: -------------------------------------------------------------------------------- 1 | % !TEX program = pdflatex 2 | % !TEX options = -synctex=1 -interaction=nonstopmode -file-line-error "%DOC%" 3 | % 作业模板 4 | \documentclass[UTF8,10pt,a4paper]{article} 5 | \usepackage{ctex} 6 | % \catcode`\。=\active 7 | % \newcommand{。}{.} 8 | \newcommand{\CourseName}{课程名称} 9 | \newcommand{\CourseCode}{课程代码} 10 | \newcommand{\Semester}{20-20学年第学期} 11 | \newcommand{\ProjectName}{作业 } 12 | \newcommand{\DueTimeType}{截止日期} 13 | \newcommand{\DueTime}{20. . (周)} 14 | \newcommand{\StudentName}{陈稼霖} 15 | \newcommand{\StudentID}{45875852} 16 | \usepackage[vmargin=1in,hmargin=.5in]{geometry} 17 | \usepackage{fancyhdr} 18 | \usepackage{lastpage} 19 | \usepackage{calc} 20 | \pagestyle{fancy} 21 | \fancyhf{} 22 | \fancyhead[L]{\CourseName} 23 | \fancyhead[C]{\ProjectName} 24 | \fancyhead[R]{\StudentName} 25 | \fancyfoot[R]{\thepage\ / \pageref{LastPage}} 26 | \setlength\headheight{12pt} 27 | \fancypagestyle{FirstPageStyle}{ 28 | \fancyhf{} 29 | \fancyhead[L]{\CourseName\\ 30 | \CourseCode\\ 31 | \Semester} 32 | \fancyhead[C]{{\Huge\bfseries\ProjectName}\\ 33 | \DueTimeType\ : \DueTime} 34 | \fancyhead[R]{姓名 : \makebox[\widthof{\StudentID}][s]{\StudentName}\\ 35 | 学号 : \StudentID\\ 36 | 成绩 : \underline{\makebox[\widthof{\StudentID}]{}}} 37 | \fancyfoot[R]{\thepage\ / \pageref{LastPage}} 38 | \setlength\headheight{36pt} 39 | } 40 | \usepackage{amsmath,amssymb,amsthm,bm} 41 | \allowdisplaybreaks[4] 42 | \newtheoremstyle{Problem} 43 | {} 44 | {} 45 | {} 46 | {} 47 | {\bfseries} 48 | {.} 49 | { } 50 | {第\thmnumber{ #2}\thmname{ #1}\thmnote{ (#3)} 得分: \underline{\qquad\qquad}} 51 | \theoremstyle{Problem} 52 | \newtheorem{prob}{题} 53 | \newtheoremstyle{Solution} 54 | {} 55 | {} 56 | {} 57 | {} 58 | {\bfseries} 59 | {:} 60 | { } 61 | {\thmname{#1}} 62 | \makeatletter 63 | \def\@endtheorem{\qed\endtrivlist\@endpefalse} 64 | \makeatother 65 | \theoremstyle{Solution} 66 | \newtheorem*{sol}{解} 67 | % \usepackage{graphicx} 68 | \begin{document} 69 | \thispagestyle{FirstPageStyle} 70 | \begin{prob}[问题标题] 71 | 此乃问题描述。 72 | \end{prob} 73 | \begin{sol} 74 | 此为解。 75 | \end{sol} 76 | \end{document} -------------------------------------------------------------------------------- /作业模板(中文版)/作业模板(中文-开发).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chen-Jialin/Assignment-Template/68442e7595a08ce60a9e496baa709bbf3bb61ce8/作业模板(中文版)/作业模板(中文-开发).pdf -------------------------------------------------------------------------------- /作业模板(中文版)/作业模板(中文-开发).tex: -------------------------------------------------------------------------------- 1 | % !TEX program = pdflatex 2 | % !TEX options = -synctex=1 -interaction=nonstopmode -file-line-error "%DOC%" 3 | % 作业模板 4 | \documentclass[UTF8,10pt,a4paper]{article} 5 | \usepackage{ctex}% 中文支持 6 | % 将全角句号映射为全角句点,需xelatex编译 7 | % \catcode`\。=\active 8 | % \newcommand{。}{.} 9 | % 作业信息 10 | \newcommand{\CourseName}{课程名称} 11 | \newcommand{\CourseCode}{课程代码} 12 | \newcommand{\Semester}{20-20学年第学期} 13 | \newcommand{\ProjectName}{作业 } 14 | \newcommand{\DueTimeType}{截止日期} 15 | \newcommand{\DueTime}{20. . (周)} 16 | \newcommand{\StudentName}{陈稼霖} 17 | \newcommand{\StudentID}{45875852} 18 | \usepackage[vmargin=1in,hmargin=.5in]{geometry}% 页边距 19 | \usepackage{fancyhdr}% 页眉和页脚 20 | \usepackage{lastpage}% 返回末页页码 21 | \usepackage{calc}% 返回文本宽度 22 | \pagestyle{fancy}% 全局页眉和页脚风格 23 | \fancyhf{}% 清除预设的页眉和页脚 24 | \fancyhead[L]{\CourseName}% 页眉左 25 | \fancyhead[C]{\ProjectName}% 页眉中 26 | \fancyhead[R]{\StudentName}% 页眉右 27 | \fancyfoot[R]{\thepage\ / \pageref{LastPage}}% 页脚右 28 | \setlength\headheight{12pt}% 页眉高 29 | \fancypagestyle{FirstPageStyle}{% 首页页眉和页脚风格 30 | \fancyhf{}% 清除预设的页眉和页脚 31 | \fancyhead[L]{\CourseName\\ 32 | \CourseCode\\ 33 | \Semester}% 页眉左 34 | \fancyhead[C]{{\Huge\bfseries\ProjectName}\\ 35 | \DueTimeType\ : \DueTime}% 页眉中 36 | \fancyhead[R]{姓名 : \makebox[\widthof{\StudentID}][s]{\StudentName}\\ 37 | 学号 : \StudentID\\ 38 | 成绩 : \underline{\makebox[\widthof{\StudentID}]{}}}% 页眉右 39 | \fancyfoot[R]{\thepage\ / \pageref{LastPage}}% 页脚右 40 | \setlength\headheight{36pt}% 页眉高 41 | } 42 | \usepackage{amsmath,amssymb,amsthm,bm}% 基础数学支持,特殊数学字符,自定义定理,公式内加粗 43 | \allowdisplaybreaks[4]% 公式跨页 44 | \newtheoremstyle{Problem}% 定理风格名称 45 | {}% 定理上方空间尺寸,留空为默认 46 | {}% 定理下方空间尺寸,留空为默认 47 | {}% 定理主体字体 48 | {}% 定理缩进量 49 | {\bfseries}% 定理开头字体 50 | {.}% 定理开头后所接标点 51 | { }% 定理开头后所接空间尺寸,空格为默认词间距 52 | {第\thmnumber{ #2}\thmname{ #1}\thmnote{ (#3)} 得分: \underline{\qquad\qquad}}% 定理开头格式,留空为默认 53 | \theoremstyle{Problem}% 设定定理风格 54 | \newtheorem{prob}{题}% 题目 55 | \newtheoremstyle{Solution}% 定理风格名称 56 | {}% 定理上方空间尺寸,留空为默认 57 | {}% 定理下方空间尺寸,留空为默认 58 | {}% 定理主体文本字体 59 | {}% 定理缩进量 60 | {\bfseries}% 定理开头字体 61 | {:}% 定理开头后所接标点 62 | { }% 定理开头后所接空间尺寸,空格为默认词间距 63 | {\thmname{#1}}% 定理开头格式 64 | \makeatletter 65 | \def\@endtheorem{\qed\endtrivlist\@endpefalse}% 题解后添加qed符号(黑色空心小正方形) 66 | \makeatother 67 | \theoremstyle{Solution}% 设定定理风格 68 | \newtheorem*{sol}{解}% 题解 69 | % \usepackage{mathrsfs}% 公式内花体字母 - \mathscr{} 70 | % \usepackage{esint}% 特殊积分号 71 | % \providecommand{\abs}[1]{\left\lvert#1\right\rvert}% 绝对值 - \abs{} 72 | % \providecommand{\norm}[1]{\left\lVert#1\right\rVert}% 范数 - \norm{} 73 | % \providecommand{\bra}[1]{\left\langle#1\right\rvert}% 左矢 - \bra{} 74 | % \providecommand{\ket}[1]{\left\lvert#1\right\rangle}% 右矢 - \ket{} 75 | % \providecommand{\braket}[2]{\left\langle#1\vert#2\right\rangle}% 右矢接左矢 - \braket{}{} 76 | % \usepackage{graphicx}% 图片 - 77 | % \begin{figure}[htbp]% 图片位置优先顺序:当地,页顶,页底,另起一页 78 | % \centering% 图片居中 79 | % \includegraphics[scale=.5]{图片文件名/路径名} 80 | % \caption{图片文字说明} 81 | % \label{图片引用代码} 82 | % \end{figure} 83 | % \usepackage{float}% 强制设定图片位置 - [H] 84 | % \usepackage{subfigure}% figure环境内多子图 - 85 | % \begin{figure}[htbp]% figure环境位置优先顺序:当地、页顶、页底、另起一页 86 | % \centering% figure环境居中 87 | % \subfigure[子图文字说明]{ 88 | % \label{子图引用代码} 89 | % \includegraphics[width=0.45\textwidth]{子图文件名/路径}} 90 | % \subfigure[子图文字说明]{ 91 | % \label{子图引用代码} 92 | % \includegraphics[width=0.45\textwidth]{子图文件名/路径}} 93 | % \caption{总文字说明} 94 | % \label{总引用代码} 95 | % \end{figure} 96 | % \usepackage{multirow}% 表格内多行单元格合并 97 | % \usepackage{booktabs}% 三线表 - \toprule, \midrule, \bottomrule 98 | % \usepackage{longtable}% 表格跨页 - 99 | % \begin{center}% 表格居中 100 | % \begin{longtable}{lcr}% 表格列对齐: l = 居左, c = 居中, r = 居右 101 | % \caption{表格文字说明} 102 | % \label{表格引用代码} 103 | % \end{longtable} 104 | % \end{center} 105 | % \usepackage[version=4]{mhchem}% 化学式 - \ce{} 106 | \begin{document} 107 | \thispagestyle{FirstPageStyle}% 设定首页页眉和页脚风格 108 | \begin{prob}[问题标题] 109 | 此乃问题描述。 110 | \end{prob} 111 | \begin{sol} 112 | 此为解。 113 | \end{sol} 114 | \end{document} --------------------------------------------------------------------------------