├── .ci ├── texlive.profile └── texlive.sh ├── .github ├── CONTRIBUTING.md └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── cjc.bst ├── cjc.cls ├── cjc.dtx ├── example-fig.pdf ├── latexmkrc ├── main.tex └── refs.bib /.ci/texlive.profile: -------------------------------------------------------------------------------- 1 | selected_scheme scheme-basic 2 | TEXDIR /tmp/texlive 3 | TEXMFLOCAL /tmp/texlive/texmf-local 4 | TEXMFSYSCONFIG /tmp/texlive/texmf-config 5 | TEXMFSYSVAR /tmp/texlive/texmf-var 6 | tlpdbopt_autobackup 0 7 | tlpdbopt_install_docfiles 0 8 | tlpdbopt_install_srcfiles 0 9 | -------------------------------------------------------------------------------- /.ci/texlive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export PATH="/tmp/texlive/bin/x86_64-linux:$PATH" 4 | 5 | if ! command -v tlmgr > /dev/null; then 6 | REMOTE="http://mirror.ctan.org/systems/texlive/tlnet"; 7 | INSTALL="/tmp/install-texlive"; 8 | mkdir -p $INSTALL; 9 | curl -sSL $REMOTE/install-tl-unx.tar.gz | tar -xzv -C $INSTALL \ 10 | --strip-components=1; 11 | $INSTALL/install-tl -profile ./.ci/texlive.profile; 12 | fi 13 | 14 | tlmgr update --self --all --reinstall-forcibly-removed; 15 | 16 | tlmgr install latexmk l3build \ 17 | fontname fontspec l3kernel l3packages xetex \ 18 | cjk ctex environ ms trimspaces ulem xecjk zhnumber \ 19 | caption filehook footmisc notoccite titlesec unicode-math \ 20 | fandol tex-gyre xits \ 21 | booktabs listings thumbpdf xcolor zapfding \ 22 | algorithm2e ifoddpage nomencl relsize siunitx; 23 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ### 要参与 LaTeX 模板的开发,首先要熟悉面向用户的命令和工具,除了 lshort,还应熟悉: 2 | 3 | - latex2e: 系统地介绍了 LATEX 使用的方方面面的文档,有平时很多用不到但是 LATEX 提供了的命令 4 | 5 | - 所用宏包的文档(可能还有源码): 6 | 7 | - 常用的工具 latexmk, texdoc 8 | 9 | - 一些调试技巧如 `\show` 和 `\meaning` 命令 10 | 11 | 12 | ### 下面是面向开发的文档: 13 | 14 | - clsguide: 给 LaTaX2e 宏包作者的指南 15 | 16 | - fntguide, fontspec 字体的设置 17 | 18 | - classes: 三个标准文档类 article, book, report 的实现 19 | 20 | - source2e: LaTaX2e 的源码 21 | 22 | - macros2e: 集中介绍了 LaTaX2e 里使用的一些内部宏,用于参考 23 | 24 | - dtxtut: LaTeX 的宏包与说明文档的封装方式,更详细的有 docstrip 和 doc,[Joseph Wright 的文章](http://www.texdev.net/2009/10/06/a-model-dtx-file/) 介绍了更好封装的技巧 25 | 26 | 27 | ### 关于更低层的 TeX 只是,有以下资料: 28 | 29 | - TeXbook: Knuth 的 TeX 圣经,了解底层 TeX 的原理必读。还有更简略一点的介绍文档 TeXbyTopic 和 impatient。 30 | 31 | - The LaTeX Companion: 一本大而全的书。 32 | 33 | 34 | ### 关于 BibTeX,应阅读以下文档: 35 | 36 | - btxdoc, btxhak: BibTeX 的说明文档 37 | 38 | - btxbst.doc: BibTeX 的三个标准 bst 的源文件(带注释) 39 | 40 | - ttb: 关于 bst 更详细的介绍 41 | 42 | - natbib: natbib 宏包的文档 43 | 44 | LaTeX3 的开发正在进行中,其底层接又已经相对成熟和稳定。xecjk 和 ctex 均是建立 在 LaTeX3 基础上的。关于 LaTeX3 的语法的文档有: 45 | 46 | - l3styleguide: 这是 LaTeX3 项目组写给开发者的指南 47 | 48 | - expl3: 这是 LaTeX3 编程接口宏包的文档 49 | 50 | - interface3: 这是 LaTeX3 的开发者接口文档 51 | 52 | - source3: 这是 LaTeX3 的实现 53 | 54 | 55 | 56 | ### 参考: 57 | 58 | [开发一个 LaTeX 宏包需要多少知识? - 知乎](https://www.zhihu.com/question/27017364) 59 | 60 | [如何写一个package或者class - 知乎专栏](https://zhuanlan.zhihu.com/p/19705200) 61 | 62 | 63 | ### 一些高质量的模板: 64 | 65 | - 清华大学 [xueruini/thuthesis](https://github.com/xueruini/thuthesis) 66 | 67 | - 中国科学院大学 [mohuangrui/ucasthesis](https://github.com/mohuangrui/ucasthesis) 68 | 69 | - 复旦大学 [Stone-Zeng/fduthesis](https://github.com/Stone-Zeng/fduthesis) 70 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | ## 编译环境 8 | - 编译的系统:macOS 10.14 | Windows 10 | Ubuntu 18.04 | Overleaf 9 | - TeX 发行版:MacTeX 2019 | TeX Live 2019 | MikTeX 2.9.6753 10 | - 相关宏包版本:ctex v2.4.14 | unicode-math v0.8l 11 | 12 | ## 描述问题 13 | 14 | 15 | 16 | 截图: 17 | 18 | 19 | 示例代码: 20 | ```TeX 21 | \documentclass{cjc} 22 | \begin{document} 23 | abc 24 | \end{document} 25 | ``` 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | main.pdf 2 | cjc.pdf 3 | *.hd 4 | build 5 | 6 | ## Core latex/pdflatex auxiliary files: 7 | *.aux 8 | *.lof 9 | *.log 10 | *.lot 11 | *.fls 12 | *.out 13 | *.toc 14 | *.fmt 15 | *.fot 16 | *.cb 17 | *.cb2 18 | .*.lb 19 | 20 | ## Intermediate documents: 21 | *.dvi 22 | *.xdv 23 | *-converted-to.* 24 | # these rules might exclude image files for figures etc. 25 | # *.ps 26 | # *.eps 27 | # *.pdf 28 | 29 | ## Generated if empty string is given at "Please type another file name for output:" 30 | .pdf 31 | 32 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 33 | *.bbl 34 | *.bcf 35 | *.blg 36 | *-blx.aux 37 | *-blx.bib 38 | *.run.xml 39 | 40 | ## Build tool auxiliary files: 41 | *.fdb_latexmk 42 | *.synctex 43 | *.synctex(busy) 44 | *.synctex.gz 45 | *.synctex.gz(busy) 46 | *.pdfsync 47 | 48 | ## Build tool directories for auxiliary files 49 | # latexrun 50 | latex.out/ 51 | 52 | ## Auxiliary and intermediate files from other packages: 53 | # algorithms 54 | *.alg 55 | *.loa 56 | 57 | # achemso 58 | acs-*.bib 59 | 60 | # amsthm 61 | *.thm 62 | 63 | # beamer 64 | *.nav 65 | *.pre 66 | *.snm 67 | *.vrb 68 | 69 | # changes 70 | *.soc 71 | 72 | # comment 73 | *.cut 74 | 75 | # cprotect 76 | *.cpt 77 | 78 | # elsarticle (documentclass of Elsevier journals) 79 | *.spl 80 | 81 | # endnotes 82 | *.ent 83 | 84 | # fixme 85 | *.lox 86 | 87 | # feynmf/feynmp 88 | *.mf 89 | *.mp 90 | *.t[1-9] 91 | *.t[1-9][0-9] 92 | *.tfm 93 | 94 | #(r)(e)ledmac/(r)(e)ledpar 95 | *.end 96 | *.?end 97 | *.[1-9] 98 | *.[1-9][0-9] 99 | *.[1-9][0-9][0-9] 100 | *.[1-9]R 101 | *.[1-9][0-9]R 102 | *.[1-9][0-9][0-9]R 103 | *.eledsec[1-9] 104 | *.eledsec[1-9]R 105 | *.eledsec[1-9][0-9] 106 | *.eledsec[1-9][0-9]R 107 | *.eledsec[1-9][0-9][0-9] 108 | *.eledsec[1-9][0-9][0-9]R 109 | 110 | # glossaries 111 | *.acn 112 | *.acr 113 | *.glg 114 | *.glo 115 | *.gls 116 | *.glsdefs 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 232 | *.xyc 233 | 234 | # endfloat 235 | *.ttt 236 | *.fff 237 | 238 | # Latexian 239 | TSWLatexianTemp* 240 | 241 | ## Editors: 242 | # WinEdt 243 | *.bak 244 | *.sav 245 | 246 | # Texpad 247 | .texpadtmp 248 | 249 | # LyX 250 | *.lyx~ 251 | 252 | # Kile 253 | *.backup 254 | 255 | # KBibTeX 256 | *~[0-9]* 257 | 258 | # auto folder when using emacs and auctex 259 | ./auto/* 260 | *.el 261 | 262 | # expex forward references with \gathertags 263 | *-tags.tex 264 | 265 | # standalone packages 266 | *.sta 267 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: generic 2 | 3 | cache: 4 | directories: 5 | - /tmp/texlive 6 | 7 | install: 8 | - source ./.ci/texlive.sh 9 | 10 | script: 11 | - make main 12 | - make doc 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The LaTeX Project Public License 2 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 3 | 4 | LPPL Version 1.3c 2008-05-04 5 | 6 | Copyright 1999 2002-2008 LaTeX3 Project 7 | Everyone is allowed to distribute verbatim copies of this 8 | license document, but modification of it is not allowed. 9 | 10 | 11 | PREAMBLE 12 | ======== 13 | 14 | The LaTeX Project Public License (LPPL) is the primary license under 15 | which the LaTeX kernel and the base LaTeX packages are distributed. 16 | 17 | You may use this license for any work of which you hold the copyright 18 | and which you wish to distribute. This license may be particularly 19 | suitable if your work is TeX-related (such as a LaTeX package), but 20 | it is written in such a way that you can use it even if your work is 21 | unrelated to TeX. 22 | 23 | The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', 24 | below, gives instructions, examples, and recommendations for authors 25 | who are considering distributing their works under this license. 26 | 27 | This license gives conditions under which a work may be distributed 28 | and modified, as well as conditions under which modified versions of 29 | that work may be distributed. 30 | 31 | We, the LaTeX3 Project, believe that the conditions below give you 32 | the freedom to make and distribute modified versions of your work 33 | that conform with whatever technical specifications you wish while 34 | maintaining the availability, integrity, and reliability of 35 | that work. If you do not see how to achieve your goal while 36 | meeting these conditions, then read the document `cfgguide.tex' 37 | and `modguide.tex' in the base LaTeX distribution for suggestions. 38 | 39 | 40 | DEFINITIONS 41 | =========== 42 | 43 | In this license document the following terms are used: 44 | 45 | `Work' 46 | Any work being distributed under this License. 47 | 48 | `Derived Work' 49 | Any work that under any applicable law is derived from the Work. 50 | 51 | `Modification' 52 | Any procedure that produces a Derived Work under any applicable 53 | law -- for example, the production of a file containing an 54 | original file associated with the Work or a significant portion of 55 | such a file, either verbatim or with modifications and/or 56 | translated into another language. 57 | 58 | `Modify' 59 | To apply any procedure that produces a Derived Work under any 60 | applicable law. 61 | 62 | `Distribution' 63 | Making copies of the Work available from one person to another, in 64 | whole or in part. Distribution includes (but is not limited to) 65 | making any electronic components of the Work accessible by 66 | file transfer protocols such as FTP or HTTP or by shared file 67 | systems such as Sun's Network File System (NFS). 68 | 69 | `Compiled Work' 70 | A version of the Work that has been processed into a form where it 71 | is directly usable on a computer system. This processing may 72 | include using installation facilities provided by the Work, 73 | transformations of the Work, copying of components of the Work, or 74 | other activities. Note that modification of any installation 75 | facilities provided by the Work constitutes modification of the Work. 76 | 77 | `Current Maintainer' 78 | A person or persons nominated as such within the Work. If there is 79 | no such explicit nomination then it is the `Copyright Holder' under 80 | any applicable law. 81 | 82 | `Base Interpreter' 83 | A program or process that is normally needed for running or 84 | interpreting a part or the whole of the Work. 85 | 86 | A Base Interpreter may depend on external components but these 87 | are not considered part of the Base Interpreter provided that each 88 | external component clearly identifies itself whenever it is used 89 | interactively. Unless explicitly specified when applying the 90 | license to the Work, the only applicable Base Interpreter is a 91 | `LaTeX-Format' or in the case of files belonging to the 92 | `LaTeX-format' a program implementing the `TeX language'. 93 | 94 | 95 | 96 | CONDITIONS ON DISTRIBUTION AND MODIFICATION 97 | =========================================== 98 | 99 | 1. Activities other than distribution and/or modification of the Work 100 | are not covered by this license; they are outside its scope. In 101 | particular, the act of running the Work is not restricted and no 102 | requirements are made concerning any offers of support for the Work. 103 | 104 | 2. You may distribute a complete, unmodified copy of the Work as you 105 | received it. Distribution of only part of the Work is considered 106 | modification of the Work, and no right to distribute such a Derived 107 | Work may be assumed under the terms of this clause. 108 | 109 | 3. You may distribute a Compiled Work that has been generated from a 110 | complete, unmodified copy of the Work as distributed under Clause 2 111 | above, as long as that Compiled Work is distributed in such a way that 112 | the recipients may install the Compiled Work on their system exactly 113 | as it would have been installed if they generated a Compiled Work 114 | directly from the Work. 115 | 116 | 4. If you are the Current Maintainer of the Work, you may, without 117 | restriction, modify the Work, thus creating a Derived Work. You may 118 | also distribute the Derived Work without restriction, including 119 | Compiled Works generated from the Derived Work. Derived Works 120 | distributed in this manner by the Current Maintainer are considered to 121 | be updated versions of the Work. 122 | 123 | 5. If you are not the Current Maintainer of the Work, you may modify 124 | your copy of the Work, thus creating a Derived Work based on the Work, 125 | and compile this Derived Work, thus creating a Compiled Work based on 126 | the Derived Work. 127 | 128 | 6. If you are not the Current Maintainer of the Work, you may 129 | distribute a Derived Work provided the following conditions are met 130 | for every component of the Work unless that component clearly states 131 | in the copyright notice that it is exempt from that condition. Only 132 | the Current Maintainer is allowed to add such statements of exemption 133 | to a component of the Work. 134 | 135 | a. If a component of this Derived Work can be a direct replacement 136 | for a component of the Work when that component is used with the 137 | Base Interpreter, then, wherever this component of the Work 138 | identifies itself to the user when used interactively with that 139 | Base Interpreter, the replacement component of this Derived Work 140 | clearly and unambiguously identifies itself as a modified version 141 | of this component to the user when used interactively with that 142 | Base Interpreter. 143 | 144 | b. Every component of the Derived Work contains prominent notices 145 | detailing the nature of the changes to that component, or a 146 | prominent reference to another file that is distributed as part 147 | of the Derived Work and that contains a complete and accurate log 148 | of the changes. 149 | 150 | c. No information in the Derived Work implies that any persons, 151 | including (but not limited to) the authors of the original version 152 | of the Work, provide any support, including (but not limited to) 153 | the reporting and handling of errors, to recipients of the 154 | Derived Work unless those persons have stated explicitly that 155 | they do provide such support for the Derived Work. 156 | 157 | d. You distribute at least one of the following with the Derived Work: 158 | 159 | 1. A complete, unmodified copy of the Work; 160 | if your distribution of a modified component is made by 161 | offering access to copy the modified component from a 162 | designated place, then offering equivalent access to copy 163 | the Work from the same or some similar place meets this 164 | condition, even though third parties are not compelled to 165 | copy the Work along with the modified component; 166 | 167 | 2. Information that is sufficient to obtain a complete, 168 | unmodified copy of the Work. 169 | 170 | 7. If you are not the Current Maintainer of the Work, you may 171 | distribute a Compiled Work generated from a Derived Work, as long as 172 | the Derived Work is distributed to all recipients of the Compiled 173 | Work, and as long as the conditions of Clause 6, above, are met with 174 | regard to the Derived Work. 175 | 176 | 8. The conditions above are not intended to prohibit, and hence do not 177 | apply to, the modification, by any method, of any component so that it 178 | becomes identical to an updated version of that component of the Work as 179 | it is distributed by the Current Maintainer under Clause 4, above. 180 | 181 | 9. Distribution of the Work or any Derived Work in an alternative 182 | format, where the Work or that Derived Work (in whole or in part) is 183 | then produced by applying some process to that format, does not relax or 184 | nullify any sections of this license as they pertain to the results of 185 | applying that process. 186 | 187 | 10. a. A Derived Work may be distributed under a different license 188 | provided that license itself honors the conditions listed in 189 | Clause 6 above, in regard to the Work, though it does not have 190 | to honor the rest of the conditions in this license. 191 | 192 | b. If a Derived Work is distributed under a different license, that 193 | Derived Work must provide sufficient documentation as part of 194 | itself to allow each recipient of that Derived Work to honor the 195 | restrictions in Clause 6 above, concerning changes from the Work. 196 | 197 | 11. This license places no restrictions on works that are unrelated to 198 | the Work, nor does this license place any restrictions on aggregating 199 | such works with the Work by any means. 200 | 201 | 12. Nothing in this license is intended to, or may be used to, prevent 202 | complete compliance by all parties with all applicable laws. 203 | 204 | 205 | NO WARRANTY 206 | =========== 207 | 208 | There is no warranty for the Work. Except when otherwise stated in 209 | writing, the Copyright Holder provides the Work `as is', without 210 | warranty of any kind, either expressed or implied, including, but not 211 | limited to, the implied warranties of merchantability and fitness for a 212 | particular purpose. The entire risk as to the quality and performance 213 | of the Work is with you. Should the Work prove defective, you assume 214 | the cost of all necessary servicing, repair, or correction. 215 | 216 | In no event unless required by applicable law or agreed to in writing 217 | will The Copyright Holder, or any author named in the components of the 218 | Work, or any other party who may distribute and/or modify the Work as 219 | permitted above, be liable to you for damages, including any general, 220 | special, incidental or consequential damages arising out of any use of 221 | the Work or out of inability to use the Work (including, but not limited 222 | to, loss of data, data being rendered inaccurate, or losses sustained by 223 | anyone as a result of any failure of the Work to operate with any other 224 | programs), even if the Copyright Holder or said author or said other 225 | party has been advised of the possibility of such damages. 226 | 227 | 228 | MAINTENANCE OF THE WORK 229 | ======================= 230 | 231 | The Work has the status `author-maintained' if the Copyright Holder 232 | explicitly and prominently states near the primary copyright notice in 233 | the Work that the Work can only be maintained by the Copyright Holder 234 | or simply that it is `author-maintained'. 235 | 236 | The Work has the status `maintained' if there is a Current Maintainer 237 | who has indicated in the Work that they are willing to receive error 238 | reports for the Work (for example, by supplying a valid e-mail 239 | address). It is not required for the Current Maintainer to acknowledge 240 | or act upon these error reports. 241 | 242 | The Work changes from status `maintained' to `unmaintained' if there 243 | is no Current Maintainer, or the person stated to be Current 244 | Maintainer of the work cannot be reached through the indicated means 245 | of communication for a period of six months, and there are no other 246 | significant signs of active maintenance. 247 | 248 | You can become the Current Maintainer of the Work by agreement with 249 | any existing Current Maintainer to take over this role. 250 | 251 | If the Work is unmaintained, you can become the Current Maintainer of 252 | the Work through the following steps: 253 | 254 | 1. Make a reasonable attempt to trace the Current Maintainer (and 255 | the Copyright Holder, if the two differ) through the means of 256 | an Internet or similar search. 257 | 258 | 2. If this search is successful, then enquire whether the Work 259 | is still maintained. 260 | 261 | a. If it is being maintained, then ask the Current Maintainer 262 | to update their communication data within one month. 263 | 264 | b. If the search is unsuccessful or no action to resume active 265 | maintenance is taken by the Current Maintainer, then announce 266 | within the pertinent community your intention to take over 267 | maintenance. (If the Work is a LaTeX work, this could be 268 | done, for example, by posting to comp.text.tex.) 269 | 270 | 3a. If the Current Maintainer is reachable and agrees to pass 271 | maintenance of the Work to you, then this takes effect 272 | immediately upon announcement. 273 | 274 | b. If the Current Maintainer is not reachable and the Copyright 275 | Holder agrees that maintenance of the Work be passed to you, 276 | then this takes effect immediately upon announcement. 277 | 278 | 4. If you make an `intention announcement' as described in 2b. above 279 | and after three months your intention is challenged neither by 280 | the Current Maintainer nor by the Copyright Holder nor by other 281 | people, then you may arrange for the Work to be changed so as 282 | to name you as the (new) Current Maintainer. 283 | 284 | 5. If the previously unreachable Current Maintainer becomes 285 | reachable once more within three months of a change completed 286 | under the terms of 3b) or 4), then that Current Maintainer must 287 | become or remain the Current Maintainer upon request provided 288 | they then update their communication data within one month. 289 | 290 | A change in the Current Maintainer does not, of itself, alter the fact 291 | that the Work is distributed under the LPPL license. 292 | 293 | If you become the Current Maintainer of the Work, you should 294 | immediately provide, within the Work, a prominent and unambiguous 295 | statement of your status as Current Maintainer. You should also 296 | announce your new status to the same pertinent community as 297 | in 2b) above. 298 | 299 | 300 | WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE 301 | ====================================================== 302 | 303 | This section contains important instructions, examples, and 304 | recommendations for authors who are considering distributing their 305 | works under this license. These authors are addressed as `you' in 306 | this section. 307 | 308 | Choosing This License or Another License 309 | ---------------------------------------- 310 | 311 | If for any part of your work you want or need to use *distribution* 312 | conditions that differ significantly from those in this license, then 313 | do not refer to this license anywhere in your work but, instead, 314 | distribute your work under a different license. You may use the text 315 | of this license as a model for your own license, but your license 316 | should not refer to the LPPL or otherwise give the impression that 317 | your work is distributed under the LPPL. 318 | 319 | The document `modguide.tex' in the base LaTeX distribution explains 320 | the motivation behind the conditions of this license. It explains, 321 | for example, why distributing LaTeX under the GNU General Public 322 | License (GPL) was considered inappropriate. Even if your work is 323 | unrelated to LaTeX, the discussion in `modguide.tex' may still be 324 | relevant, and authors intending to distribute their works under any 325 | license are encouraged to read it. 326 | 327 | A Recommendation on Modification Without Distribution 328 | ----------------------------------------------------- 329 | 330 | It is wise never to modify a component of the Work, even for your own 331 | personal use, without also meeting the above conditions for 332 | distributing the modified component. While you might intend that such 333 | modifications will never be distributed, often this will happen by 334 | accident -- you may forget that you have modified that component; or 335 | it may not occur to you when allowing others to access the modified 336 | version that you are thus distributing it and violating the conditions 337 | of this license in ways that could have legal implications and, worse, 338 | cause problems for the community. It is therefore usually in your 339 | best interest to keep your copy of the Work identical with the public 340 | one. Many works provide ways to control the behavior of that work 341 | without altering any of its licensed components. 342 | 343 | How to Use This License 344 | ----------------------- 345 | 346 | To use this license, place in each of the components of your work both 347 | an explicit copyright notice including your name and the year the work 348 | was authored and/or last substantially modified. Include also a 349 | statement that the distribution and/or modification of that 350 | component is constrained by the conditions in this license. 351 | 352 | Here is an example of such a notice and statement: 353 | 354 | %% pig.dtx 355 | %% Copyright 2005 M. Y. Name 356 | % 357 | % This work may be distributed and/or modified under the 358 | % conditions of the LaTeX Project Public License, either version 1.3 359 | % of this license or (at your option) any later version. 360 | % The latest version of this license is in 361 | % http://www.latex-project.org/lppl.txt 362 | % and version 1.3 or later is part of all distributions of LaTeX 363 | % version 2005/12/01 or later. 364 | % 365 | % This work has the LPPL maintenance status `maintained'. 366 | % 367 | % The Current Maintainer of this work is M. Y. Name. 368 | % 369 | % This work consists of the files pig.dtx and pig.ins 370 | % and the derived file pig.sty. 371 | 372 | Given such a notice and statement in a file, the conditions 373 | given in this license document would apply, with the `Work' referring 374 | to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being 375 | generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' 376 | referring to any `LaTeX-Format', and both `Copyright Holder' and 377 | `Current Maintainer' referring to the person `M. Y. Name'. 378 | 379 | If you do not want the Maintenance section of LPPL to apply to your 380 | Work, change `maintained' above into `author-maintained'. 381 | However, we recommend that you use `maintained', as the Maintenance 382 | section was added in order to ensure that your Work remains useful to 383 | the community even when you can no longer maintain and support it 384 | yourself. 385 | 386 | Derived Works That Are Not Replacements 387 | --------------------------------------- 388 | 389 | Several clauses of the LPPL specify means to provide reliability and 390 | stability for the user community. They therefore concern themselves 391 | with the case that a Derived Work is intended to be used as a 392 | (compatible or incompatible) replacement of the original Work. If 393 | this is not the case (e.g., if a few lines of code are reused for a 394 | completely different task), then clauses 6b and 6d shall not apply. 395 | 396 | 397 | Important Recommendations 398 | ------------------------- 399 | 400 | Defining What Constitutes the Work 401 | 402 | The LPPL requires that distributions of the Work contain all the 403 | files of the Work. It is therefore important that you provide a 404 | way for the licensee to determine which files constitute the Work. 405 | This could, for example, be achieved by explicitly listing all the 406 | files of the Work near the copyright notice of each file or by 407 | using a line such as: 408 | 409 | % This work consists of all files listed in manifest.txt. 410 | 411 | in that place. In the absence of an unequivocal list it might be 412 | impossible for the licensee to determine what is considered by you 413 | to comprise the Work and, in such a case, the licensee would be 414 | entitled to make reasonable conjectures as to which files comprise 415 | the Work. 416 | 417 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | MAIN = main 2 | NAME = cjc 3 | CLSFILES = $(NAME).cls 4 | BSTFILES = $(NAME).bst 5 | 6 | SHELL = bash 7 | LATEXMK = latexmk -xelatex 8 | VERSION = $(shell cat $(NAME).dtx | egrep -o "\[\d\d\d\d/\d\d\/\d\d v.+\]" \ 9 | | egrep -o "v\S+") 10 | TEXMF = $(shell kpsewhich --var-value TEXMFHOME) 11 | 12 | .PHONY : main cls doc test save clean all install distclean zip FORCE_MAKE 13 | 14 | main : $(MAIN).pdf 15 | 16 | all : main doc 17 | 18 | cls : $(CLSFILES) $(BSTFILES) 19 | 20 | doc : $(NAME).pdf 21 | 22 | $(MAIN).pdf : $(MAIN).tex $(CLSFILES) $(BSTFILES) FORCE_MAKE 23 | $(LATEXMK) $< 24 | 25 | $(NAME).cls : $(NAME).dtx 26 | xetex $< 27 | 28 | $(NAME).pdf : $(NAME).dtx FORCE_MAKE 29 | $(LATEXMK) $< 30 | 31 | clean : 32 | $(LATEXMK) -c $(MAIN).tex 33 | $(LATEXMK) -c $(NAME).dtx 34 | rm -rf build 35 | 36 | distclean : 37 | $(LATEXMK) -C $(MAIN).tex 38 | $(LATEXMK) -C $(NAME).dtx 39 | rm -rf build 40 | 41 | install : cls doc 42 | mkdir -p $(TEXMF)/{doc,source,tex}/latex/$(NAME) 43 | mkdir -p $(TEXMF)/bibtex/bst/$(NAME) 44 | cp $(BSTFILES) $(TEXMF)/bibtex/bst/$(NAME) 45 | cp $(NAME).pdf $(TEXMF)/doc/latex/$(NAME) 46 | cp $(NAME).dtx $(TEXMF)/source/latex/$(NAME) 47 | cp $(CLSFILES) $(TEXMF)/tex/latex/$(NAME) 48 | 49 | zip : main doc 50 | ln -sf . $(NAME) 51 | zip -r ../$(NAME)-$(VERSION).zip $(NAME)/{README.md,LICENSE,\ 52 | $(NAME).dtx,$(NAME).pdf,$(NAME).cls,$(NAME).bst,figures,\ 53 | $(MAIN).tex,$(MAIN).pdf,\ 54 | latexmkrc,Makefile} 55 | rm $(NAME) 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 中文期刊 LaTeX 模板框架 2 | 3 | 本项目是中文期刊 LaTeX 模板的一个编写框架, 4 | 包括模板代码、注释、文档,示例论文,以及用于维护模板的持续集成和单元测试。 5 | 该框架以[《计算机学报》](http://cjc.ict.ac.cn)的要求为基础, 6 | 针对中文期刊 LaTeX 模板的普遍需求提供了指南,并尽可能使格式与内容分离, 7 | 旨在帮助编写高质量的中文模板,也可供已有模板进行参考。 8 | 9 | 注意!该框架**不能**保证可以用于《计算机学报》的投稿。 10 | 11 | 主要特性: 12 | - 支持跨平台使用,兼容最新的 TeX Live, MacTeX 和 MikTeX 发行版, 13 | 并向后兼容到 2017 年的版本 14 | - 不支持已经过时的 CTeX 套装 15 | - 数学符号遵循国内的排版习惯 16 | - 单元测试(l3build) 17 | - 持续集成(travis-ci) 18 | 19 | 20 | ## 使用模板 21 | 22 | 模板的源代码代码位于 `cjc.dtx` 文件中, 23 | 编译模板的使用说明文档 `cjc.pdf`: 24 | ``` 25 | latexmk -xelatex cjc.dtx 26 | ``` 27 | 28 | 编译论文 `main.pdf`: 29 | ``` 30 | latexmk -xelatex main.tex 31 | ``` 32 | 33 | 清理论文编译过程中的临时文件: 34 | ``` 35 | latexmk -c main.tex 36 | ``` 37 | 38 | 以上编译过程也可以用 `make` 工具: 39 | ``` 40 | make doc # 编译生成 cjc.pdf 41 | make # 编译生成论文 main.pdf 42 | make clean # 删除编译过程中生成的临时文件 43 | ``` 44 | -------------------------------------------------------------------------------- /cjc.bst: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `gbt7714-unsrt.bst', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% gbt7714.dtx (with options: `2015,numerical') 8 | %% ------------------------------------------------------------------- 9 | %% GB/T 7714-2015 BibTeX Style 10 | %% https://github.com/CTeX-org/gbt7714-bibtex-style 11 | %% Version: 2019/03/21 v1.1.1 12 | %% ------------------------------------------------------------------- 13 | %% Copyright (C) 2016-2019 by Zeping Lee 14 | %% ------------------------------------------------------------------- 15 | %% This file may be distributed and/or modified under the 16 | %% conditions of the LaTeX Project Public License, either version 1.3c 17 | %% of this license or (at your option) any later version. 18 | %% The latest version of this license is in 19 | %% https://www.latex-project.org/lppl.txt 20 | %% and version 1.3c or later is part of all distributions of LaTeX 21 | %% version 2005/12/01 or later. 22 | %% ------------------------------------------------------------------- 23 | INTEGERS { 24 | uppercase.name 25 | max.num.authors 26 | period.between.author.year 27 | sentence.case.title 28 | link.title 29 | show.mark 30 | slash.for.extraction 31 | in.booktitle 32 | italic.jounal 33 | bold.journal.volume 34 | show.missing.address.publisher 35 | show.url 36 | show.doi 37 | show.note 38 | } 39 | 40 | FUNCTION {load.config} 41 | { 42 | #1 'uppercase.name := 43 | #3 'max.num.authors := 44 | #1 'sentence.case.title := 45 | #0 'link.title := 46 | #1 'show.mark := 47 | #1 'slash.for.extraction := 48 | #0 'in.booktitle := 49 | #0 'italic.jounal := 50 | #0 'bold.journal.volume := 51 | #1 'show.missing.address.publisher := 52 | #1 'show.url := 53 | #1 'show.doi := 54 | #0 'show.note := 55 | } 56 | 57 | ENTRY 58 | { address 59 | author 60 | booktitle 61 | date 62 | doi 63 | edition 64 | editor 65 | howpublished 66 | institution 67 | journal 68 | key 69 | language 70 | mark 71 | medium 72 | note 73 | number 74 | organization 75 | pages 76 | publisher 77 | school 78 | series 79 | title 80 | translator 81 | url 82 | urldate 83 | volume 84 | year 85 | } 86 | { entry.lang entry.is.electronic entry.numbered } 87 | { label extra.label sort.label short.list entry.mark entry.url } 88 | 89 | INTEGERS { output.state before.all mid.sentence after.sentence after.block after.slash } 90 | 91 | INTEGERS { lang.zh lang.ja lang.en lang.ru lang.other } 92 | 93 | INTEGERS { charptr len } 94 | 95 | FUNCTION {init.state.consts} 96 | { #0 'before.all := 97 | #1 'mid.sentence := 98 | #2 'after.sentence := 99 | #3 'after.block := 100 | #4 'after.slash := 101 | #3 'lang.zh := 102 | #4 'lang.ja := 103 | #1 'lang.en := 104 | #2 'lang.ru := 105 | #0 'lang.other := 106 | } 107 | 108 | FUNCTION {bbl.anonymous} 109 | { entry.lang lang.zh = 110 | { "佚名" } 111 | { "Anon" } 112 | if$ 113 | } 114 | 115 | FUNCTION {bbl.space} 116 | { entry.lang lang.zh = 117 | { "\ " } 118 | { " " } 119 | if$ 120 | } 121 | 122 | FUNCTION {bbl.et.al} 123 | { entry.lang lang.zh = 124 | { "等" } 125 | { entry.lang lang.ja = 126 | { "他" } 127 | { entry.lang lang.ru = 128 | { "идр" } 129 | { "et~al." } 130 | if$ 131 | } 132 | if$ 133 | } 134 | if$ 135 | } 136 | 137 | FUNCTION {citation.et.al} 138 | { bbl.et.al } 139 | 140 | FUNCTION {bbl.colon} { ": " } 141 | 142 | FUNCTION {bbl.wide.space} { "\quad " } 143 | 144 | FUNCTION {bbl.slash} { "//\allowbreak " } 145 | 146 | FUNCTION {bbl.sine.loco} 147 | { entry.lang lang.zh = 148 | { "[出版地不详]" } 149 | { "[S.l.]" } 150 | if$ 151 | } 152 | 153 | FUNCTION {bbl.sine.nomine} 154 | { entry.lang lang.zh = 155 | { "[出版者不详]" } 156 | { "[s.n.]" } 157 | if$ 158 | } 159 | 160 | FUNCTION {bbl.sine.loco.sine.nomine} 161 | { entry.lang lang.zh = 162 | { "[出版地不详: 出版者不详]" } 163 | { "[S.l.: s.n.]" } 164 | if$ 165 | } 166 | 167 | FUNCTION {not} 168 | { { #0 } 169 | { #1 } 170 | if$ 171 | } 172 | 173 | FUNCTION {and} 174 | { 'skip$ 175 | { pop$ #0 } 176 | if$ 177 | } 178 | 179 | FUNCTION {or} 180 | { { pop$ #1 } 181 | 'skip$ 182 | if$ 183 | } 184 | 185 | STRINGS { s t } 186 | 187 | FUNCTION {output.nonnull} 188 | { 's := 189 | output.state mid.sentence = 190 | { ", " * write$ } 191 | { output.state after.block = 192 | { add.period$ write$ 193 | newline$ 194 | "\newblock " write$ 195 | } 196 | { output.state before.all = 197 | 'write$ 198 | { output.state after.slash = 199 | { bbl.slash * write$ 200 | newline$ 201 | } 202 | { add.period$ " " * write$ } 203 | if$ 204 | } 205 | if$ 206 | } 207 | if$ 208 | mid.sentence 'output.state := 209 | } 210 | if$ 211 | s 212 | } 213 | 214 | FUNCTION {output} 215 | { duplicate$ empty$ 216 | 'pop$ 217 | 'output.nonnull 218 | if$ 219 | } 220 | 221 | FUNCTION {output.after} 222 | { 't := 223 | duplicate$ empty$ 224 | 'pop$ 225 | { 's := 226 | output.state mid.sentence = 227 | { t * write$ } 228 | { output.state after.block = 229 | { add.period$ write$ 230 | newline$ 231 | "\newblock " write$ 232 | } 233 | { output.state before.all = 234 | 'write$ 235 | { output.state after.slash = 236 | { bbl.slash * write$ } 237 | { add.period$ " " * write$ } 238 | if$ 239 | } 240 | if$ 241 | } 242 | if$ 243 | mid.sentence 'output.state := 244 | } 245 | if$ 246 | s 247 | } 248 | if$ 249 | } 250 | 251 | FUNCTION {output.check} 252 | { 't := 253 | duplicate$ empty$ 254 | { pop$ "empty " t * " in " * cite$ * warning$ } 255 | 'output.nonnull 256 | if$ 257 | } 258 | 259 | FUNCTION {fin.entry} 260 | { add.period$ 261 | write$ 262 | newline$ 263 | } 264 | 265 | FUNCTION {new.block} 266 | { output.state before.all = 267 | 'skip$ 268 | { output.state after.slash = 269 | 'skip$ 270 | { after.block 'output.state := } 271 | if$ 272 | } 273 | if$ 274 | } 275 | 276 | FUNCTION {new.sentence} 277 | { output.state after.block = 278 | 'skip$ 279 | { output.state before.all = 280 | 'skip$ 281 | { output.state after.slash = 282 | 'skip$ 283 | { after.sentence 'output.state := } 284 | if$ 285 | } 286 | if$ 287 | } 288 | if$ 289 | } 290 | 291 | FUNCTION {new.slash} 292 | { output.state before.all = 293 | 'skip$ 294 | { slash.for.extraction 295 | { after.slash 'output.state := } 296 | { after.block 'output.state := } 297 | if$ 298 | } 299 | if$ 300 | } 301 | 302 | FUNCTION {new.block.checka} 303 | { empty$ 304 | 'skip$ 305 | 'new.block 306 | if$ 307 | } 308 | 309 | FUNCTION {new.block.checkb} 310 | { empty$ 311 | swap$ empty$ 312 | and 313 | 'skip$ 314 | 'new.block 315 | if$ 316 | } 317 | 318 | FUNCTION {new.sentence.checka} 319 | { empty$ 320 | 'skip$ 321 | 'new.sentence 322 | if$ 323 | } 324 | 325 | FUNCTION {new.sentence.checkb} 326 | { empty$ 327 | swap$ empty$ 328 | and 329 | 'skip$ 330 | 'new.sentence 331 | if$ 332 | } 333 | 334 | FUNCTION {field.or.null} 335 | { duplicate$ empty$ 336 | { pop$ "" } 337 | 'skip$ 338 | if$ 339 | } 340 | 341 | FUNCTION {italicize} 342 | { duplicate$ empty$ 343 | { pop$ "" } 344 | { "\textit{" swap$ * "}" * } 345 | if$ 346 | } 347 | 348 | INTEGERS { byte second.byte } 349 | 350 | INTEGERS { char.lang tmp.lang } 351 | 352 | STRINGS { tmp.str } 353 | 354 | FUNCTION {get.str.lang} 355 | { 'tmp.str := 356 | lang.other 'tmp.lang := 357 | #1 'charptr := 358 | tmp.str text.length$ #1 + 'len := 359 | { charptr len < } 360 | { tmp.str charptr #1 substring$ chr.to.int$ 'byte := 361 | byte #128 < 362 | { charptr #1 + 'charptr := 363 | byte #64 > byte #91 < and byte #96 > byte #123 < and or 364 | { lang.en 'char.lang := } 365 | { lang.other 'char.lang := } 366 | if$ 367 | } 368 | { tmp.str charptr #1 + #1 substring$ chr.to.int$ 'second.byte := 369 | byte #224 < 370 | { charptr #2 + 'charptr := 371 | byte #207 > byte #212 < and 372 | byte #212 = second.byte #176 < and or 373 | { lang.ru 'char.lang := } 374 | { lang.other 'char.lang := } 375 | if$ 376 | } 377 | { byte #240 < 378 | { charptr #3 + 'charptr := 379 | byte #227 > byte #234 < and 380 | { lang.zh 'char.lang := } 381 | { byte #227 = 382 | { second.byte #143 > 383 | { lang.zh 'char.lang := } 384 | { second.byte #128 > second.byte #132 < and 385 | { lang.ja 'char.lang := } 386 | { lang.other 'char.lang := } 387 | if$ 388 | } 389 | if$ 390 | } 391 | { byte #239 = 392 | second.byte #163 > second.byte #172 < and and 393 | { lang.zh 'char.lang := } 394 | { lang.other 'char.lang := } 395 | if$ 396 | } 397 | if$ 398 | } 399 | if$ 400 | } 401 | { charptr #4 + 'charptr := 402 | byte #240 = second.byte #159 > and 403 | { lang.zh 'char.lang := } 404 | { lang.other 'char.lang := } 405 | if$ 406 | } 407 | if$ 408 | } 409 | if$ 410 | } 411 | if$ 412 | char.lang tmp.lang > 413 | { char.lang 'tmp.lang := } 414 | 'skip$ 415 | if$ 416 | } 417 | while$ 418 | tmp.lang 419 | } 420 | 421 | FUNCTION {check.entry.lang} 422 | { author field.or.null 423 | title field.or.null * 424 | get.str.lang 425 | } 426 | 427 | FUNCTION {set.entry.lang} 428 | { language empty$ 429 | { check.entry.lang } 430 | { language "english" = language "american" = or language "british" = or 431 | { lang.en } 432 | { language "chinese" = 433 | { lang.zh } 434 | { language "japanese" = 435 | { lang.ja } 436 | { language "russian" = 437 | { lang.ru } 438 | { check.entry.lang } 439 | if$ 440 | } 441 | if$ 442 | } 443 | if$ 444 | } 445 | if$ 446 | } 447 | if$ 448 | 'entry.lang := 449 | } 450 | 451 | FUNCTION {set.entry.numbered} 452 | { type$ "patent" = 453 | type$ "standard" = or 454 | type$ "techreport" = or 455 | { #1 'entry.numbered := } 456 | { #0 'entry.numbered := } 457 | if$ 458 | } 459 | 460 | INTEGERS { nameptr namesleft numnames name.lang } 461 | 462 | FUNCTION {format.names} 463 | { 's := 464 | #1 'nameptr := 465 | s num.names$ 'numnames := 466 | numnames 'namesleft := 467 | { namesleft #0 > } 468 | { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't := 469 | nameptr max.num.authors > 470 | { bbl.et.al 471 | #1 'namesleft := 472 | } 473 | { t "others" = 474 | { bbl.et.al } 475 | { t get.str.lang 'name.lang := 476 | name.lang lang.en = 477 | { t #1 "{vv~}{ll}{~f{~}}" format.name$ 478 | uppercase.name 479 | { "u" change.case$ } 480 | 'skip$ 481 | if$ 482 | t #1 "{, jj}" format.name$ * 483 | } 484 | { t #1 "{ll}{ff}" format.name$ } 485 | if$ 486 | } 487 | if$ 488 | } 489 | if$ 490 | nameptr #1 > 491 | { ", " swap$ * * } 492 | 'skip$ 493 | if$ 494 | nameptr #1 + 'nameptr := 495 | namesleft #1 - 'namesleft := 496 | } 497 | while$ 498 | } 499 | 500 | FUNCTION {format.key} 501 | { empty$ 502 | { key field.or.null } 503 | { "" } 504 | if$ 505 | } 506 | 507 | FUNCTION {format.authors} 508 | { author empty$ not 509 | { author format.names } 510 | { "empty author in " cite$ * warning$ 511 | "" 512 | } 513 | if$ 514 | } 515 | 516 | FUNCTION {format.editors} 517 | { editor empty$ 518 | { "" } 519 | { editor format.names } 520 | if$ 521 | } 522 | 523 | FUNCTION {format.translators} 524 | { translator empty$ 525 | { "" } 526 | { translator format.names 527 | entry.lang lang.zh = 528 | { translator num.names$ #3 > 529 | { "译" * } 530 | { ", 译" * } 531 | if$ 532 | } 533 | 'skip$ 534 | if$ 535 | } 536 | if$ 537 | } 538 | 539 | FUNCTION {format.full.names} 540 | {'s := 541 | #1 'nameptr := 542 | s num.names$ 'numnames := 543 | numnames 'namesleft := 544 | { namesleft #0 > } 545 | { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't := 546 | t get.str.lang 'name.lang := 547 | name.lang lang.en = 548 | { t #1 "{vv~}{ll}" format.name$ 't := } 549 | { t #1 "{ll}{ff}" format.name$ 't := } 550 | if$ 551 | nameptr #1 > 552 | { 553 | namesleft #1 > 554 | { ", " * t * } 555 | { 556 | numnames #2 > 557 | { "," * } 558 | 'skip$ 559 | if$ 560 | t "others" = 561 | { " et~al." * } 562 | { " and " * t * } 563 | if$ 564 | } 565 | if$ 566 | } 567 | 't 568 | if$ 569 | nameptr #1 + 'nameptr := 570 | namesleft #1 - 'namesleft := 571 | } 572 | while$ 573 | } 574 | 575 | FUNCTION {author.editor.full} 576 | { author empty$ 577 | { editor empty$ 578 | { "" } 579 | { editor format.full.names } 580 | if$ 581 | } 582 | { author format.full.names } 583 | if$ 584 | } 585 | 586 | FUNCTION {author.full} 587 | { author empty$ 588 | { "" } 589 | { author format.full.names } 590 | if$ 591 | } 592 | 593 | FUNCTION {editor.full} 594 | { editor empty$ 595 | { "" } 596 | { editor format.full.names } 597 | if$ 598 | } 599 | 600 | FUNCTION {make.full.names} 601 | { type$ "book" = 602 | type$ "inbook" = 603 | or 604 | 'author.editor.full 605 | { type$ "collection" = 606 | type$ "proceedings" = 607 | or 608 | 'editor.full 609 | 'author.full 610 | if$ 611 | } 612 | if$ 613 | } 614 | 615 | FUNCTION {output.bibitem} 616 | { newline$ 617 | "\bibitem[" write$ 618 | label write$ 619 | ")" make.full.names duplicate$ short.list = 620 | { pop$ } 621 | { * } 622 | if$ 623 | 's := 624 | s text.length$ 'charptr := 625 | { charptr #0 > } 626 | { s charptr #1 substring$ "]" = 627 | { #0 'charptr := } 628 | { charptr #1 - 'charptr := } 629 | if$ 630 | } 631 | while$ 632 | charptr #0 > 633 | { "{" s * "}" * } 634 | { s } 635 | if$ 636 | "]{" * write$ 637 | cite$ write$ 638 | "}" write$ 639 | newline$ 640 | "" 641 | before.all 'output.state := 642 | } 643 | 644 | FUNCTION {change.sentence.case} 645 | { entry.lang lang.en = 646 | { "t" change.case$ } 647 | 'skip$ 648 | if$ 649 | } 650 | 651 | FUNCTION {add.link} 652 | { url empty$ not 653 | { "\href{" url * "}{" * swap$ * "}" * } 654 | { doi empty$ not 655 | { "\href{http://dx.doi.org/" doi * "}{" * swap$ * "}" * } 656 | 'skip$ 657 | if$ 658 | } 659 | if$ 660 | } 661 | 662 | FUNCTION {format.title} 663 | { title empty$ 664 | { "" } 665 | { title 666 | sentence.case.title 667 | 'change.sentence.case 668 | 'skip$ 669 | if$ 670 | entry.numbered number empty$ not and 671 | { bbl.colon * number * } 672 | 'skip$ 673 | if$ 674 | link.title 675 | 'add.link 676 | 'skip$ 677 | if$ 678 | } 679 | if$ 680 | } 681 | 682 | FUNCTION {tie.or.space.connect} 683 | { duplicate$ text.length$ #3 < 684 | { "~" } 685 | { " " } 686 | if$ 687 | swap$ * * 688 | } 689 | 690 | FUNCTION {either.or.check} 691 | { empty$ 692 | 'pop$ 693 | { "can't use both " swap$ * " fields in " * cite$ * warning$ } 694 | if$ 695 | } 696 | 697 | FUNCTION {is.digit} 698 | { duplicate$ empty$ 699 | { pop$ #0 } 700 | { chr.to.int$ 701 | duplicate$ "0" chr.to.int$ < 702 | { pop$ #0 } 703 | { "9" chr.to.int$ > 704 | { #0 } 705 | { #1 } 706 | if$ 707 | } 708 | if$ 709 | } 710 | if$ 711 | } 712 | 713 | FUNCTION {is.number} 714 | { 's := 715 | s empty$ 716 | { #0 } 717 | { s text.length$ 'charptr := 718 | { charptr #0 > 719 | s charptr #1 substring$ is.digit 720 | and 721 | } 722 | { charptr #1 - 'charptr := } 723 | while$ 724 | charptr not 725 | } 726 | if$ 727 | } 728 | 729 | FUNCTION {format.volume} 730 | { volume empty$ not 731 | { volume is.number 732 | { entry.lang lang.zh = 733 | { "第 " volume * " 卷" * } 734 | { "volume" volume tie.or.space.connect } 735 | if$ 736 | } 737 | { volume } 738 | if$ 739 | } 740 | { "" } 741 | if$ 742 | } 743 | 744 | FUNCTION {format.number} 745 | { number empty$ not 746 | { number is.number 747 | { entry.lang lang.zh = 748 | { "第 " number * " 册" * } 749 | { "number" number tie.or.space.connect } 750 | if$ 751 | } 752 | { number } 753 | if$ 754 | } 755 | { "" } 756 | if$ 757 | } 758 | 759 | FUNCTION {format.volume.number} 760 | { volume empty$ not 761 | { format.volume } 762 | { format.number } 763 | if$ 764 | } 765 | 766 | FUNCTION {format.title.vol.num} 767 | { title 768 | sentence.case.title 769 | 'change.sentence.case 770 | 'skip$ 771 | if$ 772 | entry.numbered 773 | { number empty$ not 774 | { bbl.colon * number * } 775 | 'skip$ 776 | if$ 777 | } 778 | { format.volume.number 's := 779 | s empty$ not 780 | { bbl.colon * s * } 781 | 'skip$ 782 | if$ 783 | } 784 | if$ 785 | } 786 | 787 | FUNCTION {format.series.vol.num.title} 788 | { format.volume.number 's := 789 | series empty$ not 790 | { series 791 | sentence.case.title 792 | 'change.sentence.case 793 | 'skip$ 794 | if$ 795 | entry.numbered 796 | { bbl.wide.space * } 797 | { bbl.colon * 798 | s empty$ not 799 | { s * bbl.wide.space * } 800 | 'skip$ 801 | if$ 802 | } 803 | if$ 804 | title * 805 | sentence.case.title 806 | 'change.sentence.case 807 | 'skip$ 808 | if$ 809 | entry.numbered number empty$ not and 810 | { bbl.colon * number * } 811 | 'skip$ 812 | if$ 813 | } 814 | { format.title.vol.num } 815 | if$ 816 | link.title 817 | 'add.link 818 | 'skip$ 819 | if$ 820 | } 821 | 822 | FUNCTION {format.booktitle.vol.num} 823 | { booktitle 824 | entry.numbered 825 | 'skip$ 826 | { format.volume.number 's := 827 | s empty$ not 828 | { bbl.colon * s * } 829 | 'skip$ 830 | if$ 831 | } 832 | if$ 833 | } 834 | 835 | FUNCTION {format.series.vol.num.booktitle} 836 | { format.volume.number 's := 837 | series empty$ not 838 | { series bbl.colon * 839 | entry.numbered not s empty$ not and 840 | { s * bbl.wide.space * } 841 | 'skip$ 842 | if$ 843 | booktitle * 844 | } 845 | { format.booktitle.vol.num } 846 | if$ 847 | in.booktitle 848 | { duplicate$ empty$ not entry.lang lang.en = and 849 | { "In: " swap$ * } 850 | 'skip$ 851 | if$ 852 | } 853 | 'skip$ 854 | if$ 855 | } 856 | 857 | FUNCTION {format.journal} 858 | { journal 859 | italic.jounal entry.lang lang.en = and 860 | 'italicize 861 | 'skip$ 862 | if$ 863 | } 864 | 865 | FUNCTION {set.entry.mark} 866 | { entry.mark empty$ not 867 | 'pop$ 868 | { mark empty$ not 869 | { pop$ mark 'entry.mark := } 870 | { 'entry.mark := } 871 | if$ 872 | } 873 | if$ 874 | } 875 | 876 | FUNCTION {format.mark} 877 | { show.mark 878 | { medium empty$ not 879 | { entry.mark "/" * medium * 'entry.mark := } 880 | { entry.is.electronic 881 | { entry.mark "/OL" * 'entry.mark := } 882 | 'skip$ 883 | if$ 884 | } 885 | if$ 886 | "\allowbreak[" entry.mark * "]" * 887 | } 888 | { "" } 889 | if$ 890 | } 891 | 892 | FUNCTION {num.to.ordinal} 893 | { duplicate$ text.length$ 'charptr := 894 | duplicate$ charptr #1 substring$ 's := 895 | s "1" = 896 | { "st" * } 897 | { s "2" = 898 | { "nd" * } 899 | { s "3" = 900 | { "rd" * } 901 | { "th" * } 902 | if$ 903 | } 904 | if$ 905 | } 906 | if$ 907 | } 908 | 909 | FUNCTION {format.edition} 910 | { edition empty$ 911 | { "" } 912 | { edition is.number 913 | { entry.lang lang.zh = 914 | { edition " 版" * } 915 | { edition num.to.ordinal " ed." * } 916 | if$ 917 | } 918 | { entry.lang lang.en = 919 | { edition change.sentence.case 's := 920 | s "Revised" = s "Revised edition" = or 921 | { "Rev. ed." } 922 | { s " ed." *} 923 | if$ 924 | } 925 | { edition } 926 | if$ 927 | } 928 | if$ 929 | } 930 | if$ 931 | } 932 | 933 | FUNCTION {format.publisher} 934 | { publisher empty$ not 935 | { publisher } 936 | { school empty$ not 937 | { school } 938 | { organization empty$ not 939 | { organization } 940 | { institution empty$ not 941 | { institution } 942 | { "" } 943 | if$ 944 | } 945 | if$ 946 | } 947 | if$ 948 | } 949 | if$ 950 | } 951 | 952 | FUNCTION {format.address.publisher} 953 | { address empty$ not 954 | { address 955 | format.publisher empty$ not 956 | { bbl.colon * format.publisher * } 957 | { entry.is.electronic not show.missing.address.publisher and 958 | { bbl.colon * bbl.sine.nomine * } 959 | 'skip$ 960 | if$ 961 | } 962 | if$ 963 | } 964 | { entry.is.electronic not show.missing.address.publisher and 965 | { format.publisher empty$ not 966 | { bbl.sine.loco bbl.colon * format.publisher * } 967 | { bbl.sine.loco.sine.nomine } 968 | if$ 969 | } 970 | { format.publisher empty$ not 971 | { format.publisher } 972 | { "" } 973 | if$ 974 | } 975 | if$ 976 | } 977 | if$ 978 | } 979 | 980 | FUNCTION {extract.before.dash} 981 | { duplicate$ empty$ 982 | { pop$ "" } 983 | { 's := 984 | #1 'charptr := 985 | s text.length$ #1 + 'len := 986 | { charptr len < 987 | s charptr #1 substring$ "-" = not 988 | and 989 | } 990 | { charptr #1 + 'charptr := } 991 | while$ 992 | s #1 charptr #1 - substring$ 993 | } 994 | if$ 995 | } 996 | 997 | FUNCTION {extract.after.dash} 998 | { duplicate$ empty$ 999 | { pop$ "" } 1000 | { 's := 1001 | #1 'charptr := 1002 | s text.length$ #1 + 'len := 1003 | { charptr len < 1004 | s charptr #1 substring$ "-" = not 1005 | and 1006 | } 1007 | { charptr #1 + 'charptr := } 1008 | while$ 1009 | { charptr len < 1010 | s charptr #1 substring$ "-" = 1011 | and 1012 | } 1013 | { charptr #1 + 'charptr := } 1014 | while$ 1015 | s charptr global.max$ substring$ 1016 | } 1017 | if$ 1018 | } 1019 | 1020 | FUNCTION {contains.dash} 1021 | { duplicate$ empty$ 1022 | { pop$ #0 } 1023 | { 's := 1024 | { s empty$ not 1025 | s #1 #1 substring$ "-" = not 1026 | and 1027 | } 1028 | { s #2 global.max$ substring$ 's := } 1029 | while$ 1030 | s empty$ not 1031 | } 1032 | if$ 1033 | } 1034 | 1035 | FUNCTION {format.year} 1036 | { year empty$ not 1037 | { year extract.before.dash } 1038 | { date empty$ not 1039 | { date extract.before.dash } 1040 | { "empty year in " cite$ * warning$ 1041 | urldate empty$ not 1042 | { "[" urldate extract.before.dash * "]" * } 1043 | { "" } 1044 | if$ 1045 | } 1046 | if$ 1047 | } 1048 | if$ 1049 | extra.label * 1050 | } 1051 | 1052 | FUNCTION {format.date} 1053 | { type$ "patent" = type$ "newspaper" = or 1054 | date empty$ not and 1055 | { date } 1056 | { year } 1057 | if$ 1058 | } 1059 | 1060 | FUNCTION {format.editdate} 1061 | { date empty$ not 1062 | { "\allowbreak(" date * ")" * } 1063 | { "" } 1064 | if$ 1065 | } 1066 | 1067 | FUNCTION {format.urldate} 1068 | { urldate empty$ not entry.is.electronic and 1069 | { "\allowbreak[" urldate * "]" * } 1070 | { "" } 1071 | if$ 1072 | } 1073 | 1074 | FUNCTION {hyphenate} 1075 | { 't := 1076 | "" 1077 | { t empty$ not } 1078 | { t #1 #1 substring$ "-" = 1079 | { "-" * 1080 | { t #1 #1 substring$ "-" = } 1081 | { t #2 global.max$ substring$ 't := } 1082 | while$ 1083 | } 1084 | { t #1 #1 substring$ * 1085 | t #2 global.max$ substring$ 't := 1086 | } 1087 | if$ 1088 | } 1089 | while$ 1090 | } 1091 | 1092 | FUNCTION {format.pages} 1093 | { pages empty$ 1094 | { "" } 1095 | { pages hyphenate } 1096 | if$ 1097 | } 1098 | 1099 | FUNCTION {format.journal.volume} 1100 | { volume empty$ not 1101 | { bold.journal.volume 1102 | { "\textbf{" volume * "}" * } 1103 | { volume } 1104 | if$ 1105 | } 1106 | { "" } 1107 | if$ 1108 | } 1109 | 1110 | FUNCTION {format.journal.number} 1111 | { number empty$ not 1112 | { "\penalty0 (" number * ")" * } 1113 | { "" } 1114 | if$ 1115 | } 1116 | 1117 | FUNCTION {format.journal.pages} 1118 | { pages empty$ 1119 | { "" } 1120 | { ":\penalty0 " pages hyphenate * } 1121 | if$ 1122 | } 1123 | 1124 | FUNCTION {format.periodical.year.volume.number} 1125 | { year empty$ not 1126 | { year extract.before.dash } 1127 | { "empty year in periodical " cite$ * warning$ } 1128 | if$ 1129 | volume empty$ not 1130 | { ", " * volume extract.before.dash * } 1131 | 'skip$ 1132 | if$ 1133 | number empty$ not 1134 | { "\penalty0 (" * number extract.before.dash * ")" * } 1135 | 'skip$ 1136 | if$ 1137 | year contains.dash 1138 | { "--" * 1139 | year extract.after.dash empty$ 1140 | volume extract.after.dash empty$ and 1141 | number extract.after.dash empty$ and not 1142 | { year extract.after.dash empty$ not 1143 | { year extract.after.dash * } 1144 | { year extract.before.dash * } 1145 | if$ 1146 | volume empty$ not 1147 | { ", " * volume extract.after.dash * } 1148 | 'skip$ 1149 | if$ 1150 | number empty$ not 1151 | { "\penalty0 (" * number extract.after.dash * ")" * } 1152 | 'skip$ 1153 | if$ 1154 | } 1155 | 'skip$ 1156 | if$ 1157 | } 1158 | 'skip$ 1159 | if$ 1160 | } 1161 | 1162 | FUNCTION {check.url} 1163 | { url empty$ not 1164 | { "\url{" url * "}" * 'entry.url := 1165 | #1 'entry.is.electronic := 1166 | } 1167 | { howpublished empty$ not 1168 | { howpublished #1 #5 substring$ "\url{" = 1169 | { howpublished 'entry.url := 1170 | #1 'entry.is.electronic := 1171 | } 1172 | 'skip$ 1173 | if$ 1174 | } 1175 | { note empty$ not 1176 | { note #1 #5 substring$ "\url{" = 1177 | { note 'entry.url := 1178 | #1 'entry.is.electronic := 1179 | } 1180 | 'skip$ 1181 | if$ 1182 | } 1183 | 'skip$ 1184 | if$ 1185 | } 1186 | if$ 1187 | } 1188 | if$ 1189 | } 1190 | 1191 | FUNCTION {format.url} 1192 | { entry.url empty$ not 1193 | { new.block entry.url } 1194 | { "" } 1195 | if$ 1196 | } 1197 | 1198 | FUNCTION {check.doi} 1199 | { doi empty$ not 1200 | { #1 'entry.is.electronic := } 1201 | 'skip$ 1202 | if$ 1203 | } 1204 | 1205 | FUNCTION {is.in.url} 1206 | { 's := 1207 | s empty$ 1208 | { #1 } 1209 | { entry.url empty$ 1210 | { #0 } 1211 | { s text.length$ 'len := 1212 | entry.url text.length$ 'charptr := 1213 | { entry.url charptr len substring$ s = not 1214 | charptr #0 > 1215 | and 1216 | } 1217 | { charptr #1 - 'charptr := } 1218 | while$ 1219 | charptr 1220 | } 1221 | if$ 1222 | } 1223 | if$ 1224 | } 1225 | 1226 | FUNCTION {format.doi} 1227 | { "" 1228 | doi empty$ not show.doi and 1229 | { "" 's := 1230 | doi 't := 1231 | #0 'numnames := 1232 | { t empty$ not} 1233 | { t #1 #1 substring$ 'tmp.str := 1234 | tmp.str "," = tmp.str " " = or t #2 #1 substring$ empty$ or 1235 | { t #2 #1 substring$ empty$ 1236 | { s tmp.str * 's := } 1237 | 'skip$ 1238 | if$ 1239 | s empty$ s is.in.url or 1240 | 'skip$ 1241 | { numnames #1 + 'numnames := 1242 | numnames #1 > 1243 | { ", " * } 1244 | { "DOI: " * } 1245 | if$ 1246 | "\doi{" s * "}" * * 1247 | } 1248 | if$ 1249 | "" 's := 1250 | } 1251 | { s tmp.str * 's := } 1252 | if$ 1253 | t #2 global.max$ substring$ 't := 1254 | } 1255 | while$ 1256 | 's := 1257 | s empty$ not 1258 | { new.block s } 1259 | { "" } 1260 | if$ 1261 | } 1262 | 'skip$ 1263 | if$ 1264 | } 1265 | 1266 | FUNCTION {check.electronic} 1267 | { "" 'entry.url := 1268 | #0 'entry.is.electronic := 1269 | 'check.doi 1270 | 'skip$ 1271 | if$ 1272 | 'check.url 1273 | 'skip$ 1274 | if$ 1275 | medium empty$ not 1276 | { medium "MT" = medium "DK" = or medium "CD" = or medium "OL" = or 1277 | { #1 'entry.is.electronic := } 1278 | 'skip$ 1279 | if$ 1280 | } 1281 | 'skip$ 1282 | if$ 1283 | } 1284 | 1285 | FUNCTION {format.note} 1286 | { note empty$ not show.note and 1287 | { note } 1288 | { "" } 1289 | if$ 1290 | } 1291 | 1292 | FUNCTION {empty.misc.check} 1293 | { author empty$ title empty$ 1294 | year empty$ 1295 | and and 1296 | key empty$ not and 1297 | { "all relevant fields are empty in " cite$ * warning$ } 1298 | 'skip$ 1299 | if$ 1300 | } 1301 | 1302 | FUNCTION {monograph} 1303 | { output.bibitem 1304 | author empty$ not 1305 | { format.authors } 1306 | { editor empty$ not 1307 | { format.editors } 1308 | { "empty author and editor in " cite$ * warning$ 1309 | "" 1310 | } 1311 | if$ 1312 | } 1313 | if$ 1314 | output 1315 | new.block 1316 | format.series.vol.num.title "title" output.check 1317 | "M" set.entry.mark 1318 | format.mark "" output.after 1319 | new.block 1320 | format.translators output 1321 | new.sentence 1322 | format.edition output 1323 | new.block 1324 | format.address.publisher output 1325 | format.year "year" output.check 1326 | format.pages bbl.colon output.after 1327 | format.urldate "" output.after 1328 | format.url output 1329 | format.doi output 1330 | new.block 1331 | format.note output 1332 | fin.entry 1333 | } 1334 | 1335 | FUNCTION {incollection} 1336 | { output.bibitem 1337 | format.authors output 1338 | author format.key output 1339 | new.block 1340 | format.title "title" output.check 1341 | "M" set.entry.mark 1342 | format.mark "" output.after 1343 | new.block 1344 | format.translators output 1345 | new.slash 1346 | format.editors output 1347 | new.block 1348 | format.series.vol.num.booktitle "booktitle" output.check 1349 | new.block 1350 | format.edition output 1351 | new.block 1352 | format.address.publisher output 1353 | format.year "year" output.check 1354 | format.pages bbl.colon output.after 1355 | format.urldate "" output.after 1356 | format.url output 1357 | format.doi output 1358 | new.block 1359 | format.note output 1360 | fin.entry 1361 | } 1362 | 1363 | FUNCTION {periodical} 1364 | { output.bibitem 1365 | format.authors output 1366 | author format.key output 1367 | new.block 1368 | format.title "title" output.check 1369 | "J" set.entry.mark 1370 | format.mark "" output.after 1371 | new.block 1372 | format.periodical.year.volume.number output 1373 | new.block 1374 | format.address.publisher output 1375 | format.date "year" output.check 1376 | format.urldate "" output.after 1377 | format.url output 1378 | format.doi output 1379 | new.block 1380 | format.note output 1381 | fin.entry 1382 | } 1383 | 1384 | FUNCTION {article} 1385 | { output.bibitem 1386 | format.authors output 1387 | author format.key output 1388 | new.block 1389 | format.title "title" output.check 1390 | "J" set.entry.mark 1391 | format.mark "" output.after 1392 | new.block 1393 | format.journal "journal" output.check 1394 | format.date "year" output.check 1395 | format.journal.volume output 1396 | format.journal.number "" output.after 1397 | format.journal.pages "" output.after 1398 | format.urldate "" output.after 1399 | format.url output 1400 | format.doi output 1401 | new.block 1402 | format.note output 1403 | fin.entry 1404 | } 1405 | 1406 | FUNCTION {patent} 1407 | { output.bibitem 1408 | format.authors output 1409 | author format.key output 1410 | new.block 1411 | format.title "title" output.check 1412 | "P" set.entry.mark 1413 | format.mark "" output.after 1414 | new.block 1415 | format.date "year" output.check 1416 | format.urldate "" output.after 1417 | format.url output 1418 | format.doi output 1419 | new.block 1420 | format.note output 1421 | fin.entry 1422 | } 1423 | 1424 | FUNCTION {electronic} 1425 | { #1 #1 check.electronic 1426 | #1 'entry.is.electronic := 1427 | output.bibitem 1428 | format.authors output 1429 | author format.key output 1430 | new.block 1431 | format.series.vol.num.title "title" output.check 1432 | "EB" set.entry.mark 1433 | format.mark "" output.after 1434 | new.block 1435 | format.address.publisher output 1436 | date empty$ 1437 | { format.date output } 1438 | 'skip$ 1439 | if$ 1440 | format.pages bbl.colon output.after 1441 | format.editdate "" output.after 1442 | format.urldate "" output.after 1443 | format.url output 1444 | format.doi output 1445 | new.block 1446 | format.note output 1447 | fin.entry 1448 | } 1449 | 1450 | FUNCTION {misc} 1451 | { journal empty$ not 1452 | 'article 1453 | { booktitle empty$ not 1454 | 'incollection 1455 | { publisher empty$ not 1456 | 'monograph 1457 | { entry.is.electronic 1458 | 'electronic 1459 | { "Z" set.entry.mark 1460 | monograph 1461 | } 1462 | if$ 1463 | } 1464 | if$ 1465 | } 1466 | if$ 1467 | } 1468 | if$ 1469 | empty.misc.check 1470 | } 1471 | 1472 | FUNCTION {archive} 1473 | { "A" set.entry.mark 1474 | misc 1475 | } 1476 | 1477 | FUNCTION {book} { monograph } 1478 | 1479 | FUNCTION {booklet} { book } 1480 | 1481 | FUNCTION {collection} 1482 | { "G" set.entry.mark 1483 | monograph 1484 | } 1485 | 1486 | FUNCTION {database} 1487 | { "DB" set.entry.mark 1488 | electronic 1489 | } 1490 | 1491 | FUNCTION {dataset} 1492 | { "DS" set.entry.mark 1493 | electronic 1494 | } 1495 | 1496 | FUNCTION {inbook} { book } 1497 | 1498 | FUNCTION {inproceedings} 1499 | { "C" set.entry.mark 1500 | incollection 1501 | } 1502 | 1503 | FUNCTION {conference} { inproceedings } 1504 | 1505 | FUNCTION {map} 1506 | { "CM" set.entry.mark 1507 | misc 1508 | } 1509 | 1510 | FUNCTION {manual} { monograph } 1511 | 1512 | FUNCTION {mastersthesis} 1513 | { "D" set.entry.mark 1514 | monograph 1515 | } 1516 | 1517 | FUNCTION {newspaper} 1518 | { "N" set.entry.mark 1519 | article 1520 | } 1521 | 1522 | FUNCTION {online} 1523 | { "EB" set.entry.mark 1524 | electronic 1525 | } 1526 | 1527 | FUNCTION {phdthesis} { mastersthesis } 1528 | 1529 | FUNCTION {proceedings} 1530 | { "C" set.entry.mark 1531 | monograph 1532 | } 1533 | 1534 | FUNCTION {software} 1535 | { "CP" set.entry.mark 1536 | electronic 1537 | } 1538 | 1539 | FUNCTION {standard} 1540 | { "S" set.entry.mark 1541 | misc 1542 | } 1543 | 1544 | FUNCTION {techreport} 1545 | { "R" set.entry.mark 1546 | misc 1547 | } 1548 | 1549 | FUNCTION {unpublished} 1550 | { "Z" set.entry.mark 1551 | misc 1552 | } 1553 | 1554 | FUNCTION {default.type} { misc } 1555 | 1556 | MACRO {jan} {"January"} 1557 | 1558 | MACRO {feb} {"February"} 1559 | 1560 | MACRO {mar} {"March"} 1561 | 1562 | MACRO {apr} {"April"} 1563 | 1564 | MACRO {may} {"May"} 1565 | 1566 | MACRO {jun} {"June"} 1567 | 1568 | MACRO {jul} {"July"} 1569 | 1570 | MACRO {aug} {"August"} 1571 | 1572 | MACRO {sep} {"September"} 1573 | 1574 | MACRO {oct} {"October"} 1575 | 1576 | MACRO {nov} {"November"} 1577 | 1578 | MACRO {dec} {"December"} 1579 | 1580 | MACRO {acmcs} {"ACM Computing Surveys"} 1581 | 1582 | MACRO {acta} {"Acta Informatica"} 1583 | 1584 | MACRO {cacm} {"Communications of the ACM"} 1585 | 1586 | MACRO {ibmjrd} {"IBM Journal of Research and Development"} 1587 | 1588 | MACRO {ibmsj} {"IBM Systems Journal"} 1589 | 1590 | MACRO {ieeese} {"IEEE Transactions on Software Engineering"} 1591 | 1592 | MACRO {ieeetc} {"IEEE Transactions on Computers"} 1593 | 1594 | MACRO {ieeetcad} 1595 | {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} 1596 | 1597 | MACRO {ipl} {"Information Processing Letters"} 1598 | 1599 | MACRO {jacm} {"Journal of the ACM"} 1600 | 1601 | MACRO {jcss} {"Journal of Computer and System Sciences"} 1602 | 1603 | MACRO {scp} {"Science of Computer Programming"} 1604 | 1605 | MACRO {sicomp} {"SIAM Journal on Computing"} 1606 | 1607 | MACRO {tocs} {"ACM Transactions on Computer Systems"} 1608 | 1609 | MACRO {tods} {"ACM Transactions on Database Systems"} 1610 | 1611 | MACRO {tog} {"ACM Transactions on Graphics"} 1612 | 1613 | MACRO {toms} {"ACM Transactions on Mathematical Software"} 1614 | 1615 | MACRO {toois} {"ACM Transactions on Office Information Systems"} 1616 | 1617 | MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} 1618 | 1619 | MACRO {tcs} {"Theoretical Computer Science"} 1620 | 1621 | FUNCTION {sortify} 1622 | { purify$ 1623 | "l" change.case$ 1624 | } 1625 | 1626 | FUNCTION {chop.word} 1627 | { 's := 1628 | 'len := 1629 | s #1 len substring$ = 1630 | { s len #1 + global.max$ substring$ } 1631 | 's 1632 | if$ 1633 | } 1634 | 1635 | FUNCTION {format.lab.names} 1636 | { 's := 1637 | s #1 "{vv~}{ll}{, jj}{, ff}" format.name$ 't := 1638 | t get.str.lang 'name.lang := 1639 | name.lang lang.en = 1640 | { t #1 "{vv~}{ll}" format.name$} 1641 | { t #1 "{ll}{ff}" format.name$} 1642 | if$ 1643 | s num.names$ #1 > 1644 | { bbl.space * citation.et.al * } 1645 | 'skip$ 1646 | if$ 1647 | } 1648 | 1649 | FUNCTION {author.key.label} 1650 | { author empty$ 1651 | { key empty$ 1652 | { cite$ #1 #3 substring$ } 1653 | 'key 1654 | if$ 1655 | } 1656 | { author format.lab.names } 1657 | if$ 1658 | } 1659 | 1660 | FUNCTION {author.editor.key.label} 1661 | { author empty$ 1662 | { editor empty$ 1663 | { key empty$ 1664 | { cite$ #1 #3 substring$ } 1665 | 'key 1666 | if$ 1667 | } 1668 | { editor format.lab.names } 1669 | if$ 1670 | } 1671 | { author format.lab.names } 1672 | if$ 1673 | } 1674 | 1675 | FUNCTION {author.key.organization.label} 1676 | { author empty$ 1677 | { key empty$ 1678 | { organization empty$ 1679 | { cite$ #1 #3 substring$ } 1680 | { "The " #4 organization chop.word #3 text.prefix$ } 1681 | if$ 1682 | } 1683 | 'key 1684 | if$ 1685 | } 1686 | { author format.lab.names } 1687 | if$ 1688 | } 1689 | 1690 | FUNCTION {editor.key.organization.label} 1691 | { editor empty$ 1692 | { key empty$ 1693 | { organization empty$ 1694 | { cite$ #1 #3 substring$ } 1695 | { "The " #4 organization chop.word #3 text.prefix$ } 1696 | if$ 1697 | } 1698 | 'key 1699 | if$ 1700 | } 1701 | { editor format.lab.names } 1702 | if$ 1703 | } 1704 | 1705 | FUNCTION {calc.short.authors} 1706 | { type$ "book" = 1707 | type$ "inbook" = 1708 | or 1709 | 'author.editor.key.label 1710 | { type$ "collection" = 1711 | type$ "proceedings" = 1712 | or 1713 | { editor empty$ not 1714 | 'editor.key.organization.label 1715 | 'author.key.organization.label 1716 | if$ 1717 | } 1718 | 'author.key.label 1719 | if$ 1720 | } 1721 | if$ 1722 | 'short.list := 1723 | } 1724 | 1725 | FUNCTION {calc.label} 1726 | { calc.short.authors 1727 | short.list 1728 | "(" 1729 | * 1730 | format.year duplicate$ empty$ 1731 | short.list key field.or.null = or 1732 | { pop$ "" } 1733 | 'skip$ 1734 | if$ 1735 | * 1736 | 'label := 1737 | } 1738 | 1739 | INTEGERS { seq.num } 1740 | 1741 | FUNCTION {init.seq} 1742 | { #0 'seq.num :=} 1743 | 1744 | FUNCTION {int.to.fix} 1745 | { "000000000" swap$ int.to.str$ * 1746 | #-1 #10 substring$ 1747 | } 1748 | 1749 | FUNCTION {presort} 1750 | { set.entry.lang 1751 | set.entry.numbered 1752 | show.url show.doi check.electronic 1753 | calc.label 1754 | label sortify 1755 | " " 1756 | * 1757 | seq.num #1 + 'seq.num := 1758 | seq.num int.to.fix 1759 | 'sort.label := 1760 | sort.label * 1761 | #1 entry.max$ substring$ 1762 | 'sort.key$ := 1763 | } 1764 | 1765 | STRINGS { longest.label last.label next.extra } 1766 | 1767 | INTEGERS { longest.label.width last.extra.num number.label } 1768 | 1769 | FUNCTION {initialize.longest.label} 1770 | { "" 'longest.label := 1771 | #0 int.to.chr$ 'last.label := 1772 | "" 'next.extra := 1773 | #0 'longest.label.width := 1774 | #0 'last.extra.num := 1775 | #0 'number.label := 1776 | } 1777 | 1778 | FUNCTION {forward.pass} 1779 | { last.label label = 1780 | { last.extra.num #1 + 'last.extra.num := 1781 | last.extra.num int.to.chr$ 'extra.label := 1782 | } 1783 | { "a" chr.to.int$ 'last.extra.num := 1784 | "" 'extra.label := 1785 | label 'last.label := 1786 | } 1787 | if$ 1788 | number.label #1 + 'number.label := 1789 | } 1790 | 1791 | FUNCTION {reverse.pass} 1792 | { next.extra "b" = 1793 | { "a" 'extra.label := } 1794 | 'skip$ 1795 | if$ 1796 | extra.label 'next.extra := 1797 | extra.label 1798 | duplicate$ empty$ 1799 | 'skip$ 1800 | { "{\natexlab{" swap$ * "}}" * } 1801 | if$ 1802 | 'extra.label := 1803 | label extra.label * 'label := 1804 | } 1805 | 1806 | FUNCTION {bib.sort.order} 1807 | { sort.label 'sort.key$ := 1808 | } 1809 | 1810 | FUNCTION {begin.bib} 1811 | { preamble$ empty$ 1812 | 'skip$ 1813 | { preamble$ write$ newline$ } 1814 | if$ 1815 | "\begin{thebibliography}{" number.label int.to.str$ * "}" * 1816 | write$ newline$ 1817 | "\providecommand{\natexlab}[1]{#1}" 1818 | write$ newline$ 1819 | "\providecommand{\url}[1]{#1}" 1820 | write$ newline$ 1821 | "\expandafter\ifx\csname urlstyle\endcsname\relax\relax\else" 1822 | write$ newline$ 1823 | " \urlstyle{same}\fi" 1824 | write$ newline$ 1825 | show.doi 1826 | { "\providecommand{\href}[2]{\url{#2}}" 1827 | write$ newline$ 1828 | "\providecommand{\doi}[1]{\href{https://doi.org/#1}{#1}}" 1829 | write$ newline$ 1830 | } 1831 | 'skip$ 1832 | if$ 1833 | } 1834 | 1835 | FUNCTION {end.bib} 1836 | { newline$ 1837 | "\end{thebibliography}" write$ newline$ 1838 | } 1839 | 1840 | READ 1841 | 1842 | EXECUTE {init.state.consts} 1843 | 1844 | EXECUTE {load.config} 1845 | 1846 | EXECUTE {init.seq} 1847 | 1848 | ITERATE {presort} 1849 | 1850 | SORT 1851 | 1852 | EXECUTE {initialize.longest.label} 1853 | 1854 | ITERATE {forward.pass} 1855 | 1856 | REVERSE {reverse.pass} 1857 | 1858 | ITERATE {bib.sort.order} 1859 | 1860 | SORT 1861 | 1862 | EXECUTE {begin.bib} 1863 | 1864 | ITERATE {call.type$} 1865 | 1866 | EXECUTE {end.bib} 1867 | -------------------------------------------------------------------------------- /cjc.cls: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `cjc.cls', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% cjc.dtx (with options: `class') 8 | %% 9 | %% Copyright (C) 2019-2019 by Zeping Lee 10 | %% 11 | %% This file may be distributed and/or modified under the 12 | %% conditions of the LaTeX Project Public License, either version 1.3c 13 | %% of this license or (at your option) any later version. 14 | %% The latest version of this license is in 15 | %% https://www.latex-project.org/lppl.txt 16 | %% and version 1.3c or later is part of all distributions of LaTeX 17 | %% version 2005/12/01 or later. 18 | %% 19 | \NeedsTeXFormat{LaTeX2e}[1999/12/01] 20 | \ProvidesClass{cjc} 21 | [2019/06/01 v0.1 A template framework for Chinese journals] 22 | \RequirePackage{ifxetex} 23 | \RequireXeTeX 24 | \newif\ifcjc@chinese 25 | \DeclareOption{chinese}{\cjc@chinesetrue} 26 | \DeclareOption{english}{\cjc@chinesefalse} 27 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}} 28 | \ExecuteOptions{chinese} 29 | \ProcessOptions\relax 30 | \ifcjc@chinese 31 | \PassOptionsToClass{scheme=chinese}{ctexart} 32 | \else 33 | \PassOptionsToClass{scheme=plain}{ctexart} 34 | \fi 35 | \PassOptionsToPackage{quiet}{xeCJK} 36 | \LoadClass[UTF8,a4paper,twoside,twocolumn,zihao=5,linespread=1.08]{ctexart}[2016/05/16] 37 | \@ifclasslater{ctexart}{2016/05/16}{}{ 38 | \ClassError{cjc}{% 39 | This template requires TeX Live\MessageBreak 2016 or later version}{} 40 | } 41 | \RequirePackage{kvdefinekeys} 42 | \RequirePackage{kvsetkeys} 43 | \RequirePackage{amsmath} 44 | \RequirePackage{unicode-math} 45 | \RequirePackage{amsthm} 46 | \RequirePackage{geometry} 47 | \RequirePackage{graphicx} 48 | \RequirePackage{fancyhdr} 49 | \RequirePackage{caption} 50 | \RequirePackage{url} 51 | \RequirePackage[numbers,sort&compress]{natbib} 52 | \newcommand\cjc@strifeq{\csname str_if_eq_x:nnTF\endcsname} 53 | \newcommand\cjc@fontset{\csname g__ctex_fontset_tl\endcsname} 54 | \cjc@strifeq{\cjc@fontset}{fandol}{ 55 | \setmainfont[ 56 | Extension = .otf, 57 | UprightFont = *-regular, 58 | BoldFont = *-bold, 59 | ItalicFont = *-italic, 60 | BoldItalicFont = *-bolditalic, 61 | ]{texgyretermes} 62 | \setsansfont[ 63 | Extension = .otf, 64 | UprightFont = *-regular, 65 | BoldFont = *-bold, 66 | ItalicFont = *-italic, 67 | BoldItalicFont = *-bolditalic, 68 | ]{texgyreheros} 69 | \setmonofont[ 70 | Extension = .otf, 71 | UprightFont = *-regular, 72 | BoldFont = *-bold, 73 | ItalicFont = *-italic, 74 | BoldItalicFont = *-bolditalic, 75 | Scale = MatchLowercase, 76 | ]{texgyrecursor} 77 | \ClassWarningNoLine{cjc}{% 78 | You are using Fandol font family.\MessageBreak 79 | Some glyphs may be missing.\MessageBreak 80 | Please switch to a high-quality font set 81 | } 82 | }{ 83 | \setmainfont{Times New Roman} 84 | \setsansfont[Scale=MatchLowercase]{Arial} 85 | \cjc@strifeq{\cjc@fontset}{mac}{ 86 | \setmonofont[Scale=MatchLowercase]{Menlo} 87 | }{ 88 | \setmonofont[Scale=MatchLowercase]{Courier New} 89 | } 90 | } 91 | \cjc@strifeq{\cjc@fontset}{mac}{ 92 | \setCJKmainfont[ 93 | UprightFont = * Light, 94 | BoldFont = Heiti SC Medium, 95 | ItalicFont = Kaiti SC, 96 | BoldItalicFont = Kaiti SC Bold, 97 | ]{Songti SC} 98 | \setCJKsansfont[BoldFont=* Medium]{Heiti SC} 99 | \setCJKfamilyfont{zhsong}[ 100 | UprightFont = * Light, 101 | BoldFont = * Bold, 102 | ]{Songti SC} 103 | \setCJKfamilyfont{zhhei}[BoldFont=* Medium]{Heiti SC} 104 | \setCJKfamilyfont{zhkai}[BoldFont=* Bold]{Kaiti SC} 105 | \xeCJKsetwidth{‘’“”}{1em} 106 | }{ 107 | \xeCJKsetup{EmboldenFactor=2} 108 | \cjc@strifeq{\cjc@fontset}{windows}{ 109 | \IfFileExists{C:/bootfont.bin}{ 110 | \setCJKmainfont[ 111 | BoldFont = SimHei, 112 | ItalicFont = KaiTi_GB2312, 113 | ]{SimSun} 114 | \setCJKfamilyfont{zhkai}{KaiTi_GB2312} 115 | }{ 116 | \setCJKmainfont[ 117 | BoldFont = SimHei, 118 | ItalicFont = KaiTi 119 | ]{SimSun} 120 | \setCJKfamilyfont{zhkai}{KaiTi} 121 | } 122 | \setCJKsansfont{SimHei} 123 | \setCJKfamilyfont{zhsong}{SimSun} 124 | \setCJKfamilyfont{zhhei}{SimHei} 125 | }{} 126 | } 127 | \unimathsetup{ 128 | math-style = ISO, 129 | bold-style = ISO, 130 | nabla = upright, 131 | partial = upright, 132 | } 133 | \newif\ifcjc@xitsnew 134 | \@ifpackagelater{fontspec}{2017/01/20}{ 135 | \IfFontExistsTF{XITSMath-Regular.otf}{ 136 | \cjc@xitsnewtrue 137 | }{} 138 | }{} 139 | \ifcjc@xitsnew 140 | \setmathfont[ 141 | Extension = .otf, 142 | BoldFont = XITSMath-Bold, 143 | StylisticSet = 8, 144 | ]{XITSMath-Regular} 145 | \setmathfont[range={cal,bfcal},StylisticSet=1]{XITSMath-Regular.otf} 146 | \else 147 | \setmathfont[ 148 | Extension = .otf, 149 | BoldFont = *bold, 150 | StylisticSet = 8, 151 | ]{xits-math} 152 | \setmathfont[range={cal,bfcal},StylisticSet=1]{xits-math.otf} 153 | \fi 154 | \cjc@strifeq{\cjc@fontset}{mac}{ 155 | \newfontfamily\cjc@circlefont{Songti SC Light} 156 | }{ 157 | \cjc@strifeq{\cjc@fontset}{windows}{ 158 | \newfontfamily\cjc@circlefont{SimSun} 159 | }{ 160 | \ifcjc@xitsnew 161 | \newfontfamily\cjc@circlefont{XITS-Regular.otf} 162 | \else 163 | \newfontfamily\cjc@circlefont{xits-regular.otf} 164 | \fi 165 | } 166 | } 167 | \newdimen\bp@ 168 | \bp@=1bp 169 | \newcommand\cjc@setchinese{% 170 | \xeCJKResetPunctClass 171 | } 172 | \newcommand\cjc@setenglish{% 173 | \xeCJKDeclareCharClass{HalfLeft}{"2018, "201C}% 174 | \xeCJKDeclareCharClass{HalfRight}{% 175 | "00B7, "2019, "201D, "2013, "2014, "2025, "2026, "2E3A% 176 | }% 177 | } 178 | \newcommand\cjc@setdefaultlanguage{% 179 | \ifcjc@chinese 180 | \cjc@setchinese 181 | \else 182 | \cjc@setenglish 183 | \fi 184 | } 185 | \geometry{ 186 | paper = a4paper, 187 | vmargin = 2.6cm, 188 | hmargin = 2cm, 189 | headheight = 0.75cm, 190 | headsep = 0.15cm, 191 | twocolumn = true, 192 | columnsep = 0.75cm, 193 | } 194 | \pagestyle{fancy} 195 | \let\sectionmark\@gobble 196 | \renewcommand\headrulewidth{0.4\p@} 197 | \newcommand\cjc@hf@font{\small} 198 | \newcommand\cjc@number{1} 199 | \newcommand\cjc@volume{1} 200 | \fancypagestyle{main}{% 201 | \fancyhf{}% 202 | \fancyhead[LO]{\cjc@hf@font \cjc@number{} 期}% 203 | \fancyhead[CO]{\cjc@hf@font 作者名等:论文题目}% 204 | \fancyhead[RO,LE]{\cjc@hf@font\thepage}% 205 | \fancyhead[CE]{\cjc@hf@font 计算机学报}% 206 | \fancyhead[RE]{\cjc@hf@font \the\year{} 年}% 207 | } 208 | \pagestyle{main} 209 | \fancypagestyle{plain}{% 210 | \fancyhf{}% 211 | \fancyhead[L]{\cjc@hf@font 第 \cjc@volume{} 卷\quad 第 \cjc@number{} 期\\\the\year{} 年 \the\month{} 月}% 212 | \fancyhead[C]{\cjc@hf@font 计算机学报\\CHINESE JOURNAL OF COMPUTERS}% 213 | \fancyhead[R]{\cjc@hf@font Vol. \cjc@volume\quad No. \cjc@number\\\cjc@doi}% 214 | } 215 | \newcommand\cjc@clc{*****} 216 | \newcommand\cjc@doi{10.1000/182} 217 | \newcommand\cjcsetup{\kvsetkeys{cjc}} 218 | \kv@set@family@handler{cjc}{\expandafter\gdef\csname cjc@#1\endcsname{#2}} 219 | \newcommand\cjc@author{% 220 | } 221 | \def\@maketitle{% 222 | \newpage 223 | \null 224 | \cjc@make@zh@title 225 | \cjc@make@en@title 226 | } 227 | \def\cjc@make@zh@title{% 228 | \vspace*{20\bp@}% 229 | \begingroup 230 | \centering 231 | \heiti\zihao{2}\cjc@title\par 232 | \endgroup 233 | \vspace*{7.8\bp@}% 234 | \begingroup 235 | \zihao{-5}% 236 | \textbf{摘\quad 要}\quad\cjc@abstract\par 237 | 关键词\quad\cjc@keywords\par 238 | 中图法分类号\quad\cjc@clc\qquad 239 | DOI 号\quad\cjc@doi\par 240 | \endgroup 241 | } 242 | \def\cjc@make@en@title{% 243 | \vspace*{12\bp@}% 244 | \begingroup 245 | \centering 246 | \bfseries\zihao{4}\@nameuse{cjc@title*}\par 247 | \endgroup 248 | \vspace{5\bp@}% 249 | \begingroup 250 | \zihao{-5}% 251 | \textbf{Abstract}\quad\@nameuse{cjc@abstract*}\par 252 | \textbf{Key words}\quad\@nameuse{cjc@keywords*}\par 253 | \endgroup 254 | } 255 | \renewenvironment{abstract}{% 256 | \if@twocolumn 257 | \section*{\abstractname}% 258 | \else 259 | \small 260 | \begin{center}% 261 | {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}% 262 | \end{center}% 263 | \quotation 264 | \fi} 265 | {\if@twocolumn\else\endquotation\fi} 266 | \ctexset{ 267 | section = { 268 | format = \heiti\zihao{4}, 269 | beforeskip = 8\bp@, 270 | afterskip = 8\bp@, 271 | }, 272 | subsection = { 273 | format = \heiti\zihao{5}, 274 | beforeskip = 2.625\bp@, 275 | afterskip = 2.625\bp@, 276 | }, 277 | subsubsection = { 278 | format = \zihao{5}, 279 | beforeskip = \z@, 280 | afterskip = \z@, 281 | }, 282 | } 283 | \sloppy 284 | \raggedbottom 285 | \setlength{\parskip}{\z@} 286 | \urlstyle{same} 287 | \def\UrlBreaks{% 288 | \do\/% 289 | \do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l% 290 | \do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z% 291 | \do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L% 292 | \do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X\do\Y\do\Z% 293 | \do0\do1\do2\do3\do4\do5\do6\do7\do8\do9\do=\do/\do.\do:% 294 | \do\*\do\-\do\~\do\'\do\"\do\-} 295 | \Urlmuskip=0mu plus 0.1mu 296 | \renewcommand\topfraction{.85} 297 | \renewcommand\bottomfraction{.7} 298 | \renewcommand\textfraction{.15} 299 | \renewcommand\floatpagefraction{.66} 300 | \renewcommand\dbltopfraction{.66} 301 | \renewcommand\dblfloatpagefraction{.66} 302 | \setcounter{topnumber}{9} 303 | \setcounter{bottomnumber}{9} 304 | \setcounter{totalnumber}{20} 305 | \setcounter{dbltopnumber}{9} 306 | \def\fps@figure{htb} 307 | \def\fps@table{htb} 308 | \DeclareCaptionLabelSeparator{zhspace}{\hspace{\ccwd}} 309 | \captionsetup{ 310 | justification = centerlast, 311 | font = small, 312 | labelsep = zhspace, 313 | skip = 6\bp@, 314 | figureposition = bottom, 315 | tableposition = top, 316 | } 317 | \DeclareCaptionFont{heiti}{\heiti} 318 | \captionsetup[table]{ 319 | font = {heiti,small}, 320 | } 321 | \ifcjc@chinese 322 | \def\mathellipsis{\cdots} 323 | \fi 324 | \protected\def\le{\leqslant} 325 | \protected\def\ge{\geqslant} 326 | \AtBeginDocument{% 327 | \renewcommand\leq{\leqslant}% 328 | \renewcommand\geq{\geqslant}% 329 | } 330 | \removenolimits{% 331 | \int\iint\iiint\iiiint\oint\oiint\oiiint 332 | \intclockwise\varointclockwise\ointctrclockwise\sumint 333 | \intbar\intBar\fint\cirfnint\awint\rppolint 334 | \scpolint\npolint\pointint\sqint\intlarhk\intx 335 | \intcap\intcup\upint\lowint 336 | } 337 | \AtBeginDocument{% 338 | \renewcommand\Re{\operatorname{Re}}% 339 | \renewcommand\Im{\operatorname{Im}}% 340 | } 341 | \AtBeginDocument{% 342 | \renewcommand\nabla{\mbfnabla}% 343 | } 344 | \newcommand\bm{\symbf} 345 | \renewcommand\boldsymbol{\symbf} 346 | \newcommand\square{\mdlgwhtsquare} 347 | \newcommand\upe{\symup{e}} 348 | \newcommand\upi{\symup{i}} 349 | \newcommand\dif{\mathop{}\!\mathrm{d}} 350 | \DeclareMathOperator*{\argmax}{arg\,max} 351 | \DeclareMathOperator*{\argmin}{arg\,min} 352 | \newtheoremstyle{cjc} 353 | {\z@}{\z@} 354 | {}{2\ccwd} 355 | {\bfseries}{.} 356 | {\ccwd}{} 357 | \theoremstyle{cjc} 358 | \newcommand\cjc@assertionname{断言} 359 | \newcommand\cjc@assumptionname{假设} 360 | \newcommand\cjc@axiomname{公理} 361 | \newcommand\cjc@corollaryname{推论} 362 | \newcommand\cjc@definitionname{定义} 363 | \newcommand\cjc@examplename{例} 364 | \newcommand\cjc@lemmaname{引理} 365 | \newcommand\cjc@proofname{证明} 366 | \newcommand\cjc@propositionname{命题} 367 | \newcommand\cjc@remarkname{注} 368 | \newcommand\cjc@theoremname{定理} 369 | \newtheorem{theorem} {\cjc@theoremname} 370 | \newtheorem{assertion} [theorem]{\cjc@assertionname} 371 | \newtheorem{axiom} [theorem]{\cjc@axiomname} 372 | \newtheorem{corollary} [theorem]{\cjc@corollaryname} 373 | \newtheorem{lemma} [theorem]{\cjc@lemmaname} 374 | \newtheorem{proposition}[theorem]{\cjc@propositionname} 375 | \newtheorem{assumption} {\cjc@assumptionname} 376 | \newtheorem{definition} {\cjc@definitionname} 377 | \newtheorem{example} {\cjc@examplename} 378 | \newtheorem*{remark} {\cjc@remarkname} 379 | \DeclareRobustCommand{\qed}{证毕.} 380 | \renewenvironment{proof}[1][\proofname]{\par 381 | \textbf{\proofname}.\quad 382 | }{% 383 | \par\raggedleft\qed\par 384 | } 385 | \renewcommand\bibfont{\fontsize{7.5\bp@}{14\bp@}\linespread{1}\selectfont} 386 | \renewcommand\@biblabel[1]{[#1]\hfill} 387 | \newcommand\cjc@atendpackage{\csname ctex_at_end_package:nn\endcsname} 388 | \cjc@atendpackage{hyperref}{ 389 | \hypersetup{ 390 | bookmarksnumbered = true, 391 | bookmarksopen = true, 392 | bookmarksopenlevel = 1, 393 | linktoc = all, 394 | unicode = true, 395 | psdextra = true, 396 | hidelinks, 397 | } 398 | \AtBeginDocument{% 399 | \hypersetup{ 400 | pdftitle = \@title, 401 | pdfauthor = \@author, 402 | }% 403 | } 404 | \pdfstringdefDisableCommands{ 405 | \let\\\@empty 406 | \let\hspace\@gobble 407 | } 408 | \@ifpackagelater{hyperref}{2019/04/27}{}{% 409 | \g@addto@macro\psdmapshortnames{\let\mu\textmugreek}% 410 | } 411 | \ifcjc@chinese 412 | \def\equationautorefname~#1\null{公式~(#1)\null} 413 | \def\footnoteautorefname{脚注} 414 | \def\itemautorefname~#1\null{第~#1 项\null} 415 | \def\figureautorefname{图} 416 | \def\tableautorefname{表} 417 | \def\appendixautorefname{附录} 418 | \def\sectionautorefname~#1\null{第~#1 节\null} 419 | \def\subsectionautorefname~#1\null{第~#1 节\null} 420 | \def\subsubsectionautorefname~#1\null{第~#1 节\null} 421 | \def\theoremautorefname{定理} 422 | \def\HyRef@autopageref#1{\hyperref[{#1}]{第~\pageref*{#1} 页}} 423 | \fi 424 | } 425 | \cjc@atendpackage{siunitx}{ 426 | \sisetup{ 427 | group-minimum-digits = 4, 428 | separate-uncertainty = true, 429 | inter-unit-product = \ensuremath{{}\cdot{}}, 430 | } 431 | \ifcjc@chinese 432 | \sisetup{ 433 | list-final-separator = { 和 }, 434 | list-pair-separator = { 和 }, 435 | range-phrase = {~}, 436 | } 437 | \fi 438 | } 439 | -------------------------------------------------------------------------------- /cjc.dtx: -------------------------------------------------------------------------------- 1 | % \iffalse meta-comment 2 | % 3 | % Copyright (C) 2019-2019 by Zeping Lee 4 | % 5 | % This file may be distributed and/or modified under the 6 | % conditions of the LaTeX Project Public License, either version 1.3c 7 | % of this license or (at your option) any later version. 8 | % The latest version of this license is in 9 | % https://www.latex-project.org/lppl.txt 10 | % and version 1.3c or later is part of all distributions of LaTeX 11 | % version 2005/12/01 or later. 12 | % 13 | %<*internal> 14 | \iffalse 15 | \fi 16 | \begingroup 17 | \def\nameoflatex{LaTeX2e} 18 | \expandafter\endgroup\ifx\nameoflatex\fmtname\else 19 | \csname fi\endcsname 20 | % 21 | %<*install> 22 | \input docstrip.tex 23 | \preamble 24 | 25 | Copyright (C) 2019-\the\year by Zeping Lee 26 | 27 | This file may be distributed and/or modified under the 28 | conditions of the LaTeX Project Public License, either version 1.3c 29 | of this license or (at your option) any later version. 30 | The latest version of this license is in 31 | https://www.latex-project.org/lppl.txt 32 | and version 1.3c or later is part of all distributions of LaTeX 33 | version 2005/12/01 or later. 34 | 35 | \endpreamble 36 | \keepsilent 37 | \askforoverwritefalse 38 | \nopostamble 39 | \generate{ 40 | \file{\jobname.cls}{\from{\jobname.dtx}{class}} 41 | } 42 | \endbatchfile 43 | % 44 | %<*internal> 45 | \fi 46 | % 47 | %<*driver> 48 | \ProvidesFile{cjc.dtx} 49 | % 50 | %\NeedsTeXFormat{LaTeX2e}[1999/12/01] 51 | %\ProvidesClass{cjc} 52 | %<*class> 53 | [2019/06/01 v0.1 A template framework for Chinese journals] 54 | % 55 | % 56 | %<*driver> 57 | \documentclass[a4paper]{ltxdoc} 58 | \usepackage[UTF8]{ctex} 59 | \usepackage{amsmath} 60 | \usepackage{unicode-math} 61 | \usepackage{siunitx} 62 | \usepackage{caption} 63 | \usepackage{booktabs} 64 | \usepackage{xcolor} 65 | \usepackage{listings} 66 | \usepackage{hypdoc} 67 | 68 | \makeatletter 69 | 70 | % 设置字体 71 | \IfFileExists{/System/Library/Fonts/Times.ttc}{ 72 | \setmainfont{Times} 73 | \setsansfont[Scale=MatchLowercase]{Helvetica} 74 | \setmonofont[Scale=MatchLowercase]{Menlo} 75 | \xeCJKsetwidth{‘’“”}{1em} 76 | }{} 77 | \unimathsetup{ 78 | math-style=ISO, 79 | bold-style=ISO, 80 | } 81 | \setmathfont[ 82 | Extension = .otf, 83 | BoldFont = XITSMath-Bold, 84 | StylisticSet = 8, 85 | ]{XITSMath-Regular} 86 | 87 | % 定义一些命令用于写文档 88 | \newcommand\TeXLive{\TeX{} Live} 89 | \newcommand\unicodechar[1]{U+#1(\symbol{"#1})} 90 | \DeclareRobustCommand\file{\nolinkurl} 91 | \DeclareRobustCommand\env{\texttt} 92 | \DeclareRobustCommand\pkg{\textsf} 93 | \DeclareRobustCommand\cls{\textsf} 94 | \DeclareRobustCommand\opt{\texttt} 95 | 96 | % 在 doc 的基础上增加 option 的描述 97 | \def\DescribeOption{\leavevmode\@bsphack\begingroup\MakePrivateLetters 98 | \Describe@Option} 99 | \def\Describe@Option#1{\endgroup 100 | \marginpar{\raggedleft\PrintDescribeOption{#1}}% 101 | \SpecialEnvIndex{#1}\@esphack\ignorespaces} 102 | \@ifundefined{PrintDescribeOption} 103 | {\def\PrintDescribeOption#1{\strut \MacroFont #1\ }}{} 104 | 105 | % 调整列表的格式 106 | \setlength\partopsep{\z@} 107 | \def\@listi{\leftmargin\leftmargini 108 | \parsep \z@ 109 | \topsep 5\p@ \@plus2\p@ \@minus3\p@ 110 | \itemsep2\p@ \@plus\p@ \@minus\p@} 111 | \let\@listI\@listi 112 | \@listi 113 | 114 | % listings 的样式 115 | \lstdefinestyle{lstshell}{ 116 | basicstyle = \small\ttfamily, 117 | backgroundcolor = \color{lightgray}, 118 | gobble = 2, % 重要!否则会生成注释符号"%" 119 | language = bash, 120 | } 121 | \newcommand\shellcmd[1]{\colorbox{lightgray}{\lstinline[style=lstshell]|#1|}} 122 | \lstnewenvironment{shell}{\lstset{style=lstshell}}{} 123 | \lstnewenvironment{latex}{% 124 | \lstset{ 125 | basicstyle = \small\ttfamily, 126 | frame = single, 127 | gobble = 4, 128 | language = [LaTeX]TeX, 129 | }% 130 | }{} 131 | 132 | % 调整版本历史和索引的格式 133 | \renewcommand\glossaryname{版本历史} 134 | \GlossaryPrologue{\section*{\glossaryname}} 135 | \def\changes@#1#2#3{% 136 | \protected@edef\@tempa{% 137 | \noexpand\glossary{#1 (#2)\levelchar 138 | \ifx\saved@macroname\@empty 139 | \space 140 | \actualchar 141 | \else 142 | \saved@indexname 143 | \actualchar 144 | \string\verb\quotechar*% 145 | \verbatimchar\saved@macroname 146 | \verbatimchar 147 | : \levelchar 148 | \fi 149 | #3}}% 150 | \@tempa\endgroup\@esphack} 151 | \renewcommand\indexname{命令索引} 152 | \IndexPrologue{% 153 | \section*{\indexname} 154 | \textit{意大利体的数字表示描述对应索引项的页码;% 155 | 带下划线的数字表示定义对应索引项的代码行号;% 156 | 罗马字体的数字表示使用对应索引项的代码行号。}% 157 | } 158 | 159 | \hypersetup{ 160 | allcolors = blue, 161 | bookmarksnumbered = true, 162 | bookmarksopen = true, 163 | } 164 | \makeatother 165 | 166 | \EnableCrossrefs 167 | \CodelineIndex 168 | \RecordChanges 169 | % \OnlyDescription 170 | 171 | \begin{document} 172 | \DocInput{\jobname.dtx} 173 | \end{document} 174 | % 175 | % \fi 176 | % 177 | % \DoNotIndex{\def,\long,\edef,\xdef,\gdef,\let,\global} 178 | % \DoNotIndex{\if,\ifnum,\ifdim,\ifcat,\ifmmode,\ifvmode,\ifhmode,% 179 | % \iftrue,\iffalse,\ifvoid,\ifx,\ifeof,\ifcase,\else,\or,\fi} 180 | % \DoNotIndex{\begin,\end,\bgroup,\egroup,\begingroup,\endgroup} 181 | % \DoNotIndex{\expandafter,\csname,\endcsname} 182 | % \DoNotIndex{\hsize,\vsize,\hskip,\vskip,\kern,\hfil,\hfill,\hss} 183 | % \DoNotIndex{\hspace,\vspace} 184 | % \DoNotIndex{\p@,\m@ne,\z@,\@ne,\tw@,\@plus,\@minus} 185 | % \DoNotIndex{\newcounter,\setcounter,\addtocounter,} 186 | % \DoNotIndex{\newdim,\newlength,\setlength,\addtolength} 187 | % \DoNotIndex{\newcommand,\renewcommand,\providecommand,\DeclareRobustCommand} 188 | % \DoNotIndex{\newenvironment,\renewenvironment} 189 | % \DoNotIndex{\RequirePackage,\LoadClass,\ProvidesClass} 190 | % \DoNotIndex{\DeclareOption,\CurrentOption,\ExecuteOptions,\ProcessOptions} 191 | % \DoNotIndex{\rmfamily,\sffamily,\ttfamily,\bfseries,\mdseries,\itshape,% 192 | % \textrm,\textsf,\texttt,\textbf,\textmd,\textit,\textsl,\textsc} 193 | % \DoNotIndex{\iint,\iiint,\iiiint,\oint,\oiint,\oiiint,% 194 | % \intclockwise,\varointclockwise,\ointctrclockwise,\sumint,% 195 | % \intbar,\intBar,\fint,\cirfnint,\awint,\rppolint,% 196 | % \scpolint,\npolint,\pointint,\sqint,\intlarhk,\intx,% 197 | % \intcap,\intcup,\upint,\lowint} 198 | % \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,% 199 | % \m,\n,\o,\p,\q,\r,\s,\t,\u,\v,\w,\x,\y,\z,% 200 | % \A,\B,\C,\D,\E,\F,\G,\H,\I,\J,\K,\L,% 201 | % \M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z,% 202 | % \do\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ ,\,,\!,\',\",\/,\*,\-} 203 | % \DoNotIndex{\NAT@@close,\NAT@@open,\NAT@cite,\NAT@citenum,\NAT@citesuper,% 204 | % \NAT@citex,\NAT@citexnum,\NAT@cmt,\NAT@ctype,\NAT@date,% 205 | % \NAT@last@yr,\NAT@mbox,\NAT@penalty,\NAT@spacechar,% 206 | % \@citea,\def@NAT@last@yr,\ifNAT@swa} 207 | % \DoNotIndex{\quad,\par,\relax,\ccwd} 208 | % \DoNotIndex{\bp@} 209 | % 210 | % 211 | % 212 | % \GetFileInfo{\jobname.dtx} 213 | % 214 | % \title{\cls{cjc} 使用说明} 215 | % \author{Zeping Lee\thanks{zepinglee AT gmail.com}} 216 | % \date{\filedate\qquad\fileversion} 217 | % \maketitle 218 | % 219 | % \changes{v0.1}{2019/06/01}{Initial version.} 220 | % 221 | % 222 | % \StopEventually 223 | % \clearpage 224 | % \appendix 225 | % 226 | % 227 | % \section{代码实现} 228 | % \label{sec:code} 229 | % \linespread{1} 230 | % 231 | % 232 | % \subsection{处理选项} 233 | % 234 | % 检查编译引擎,要求使用 XeLaTeX。 235 | % \begin{macrocode} 236 | \RequirePackage{ifxetex} 237 | \RequireXeTeX 238 | % \end{macrocode} 239 | % 240 | % \begin{macrocode} 241 | \newif\ifcjc@chinese 242 | \DeclareOption{chinese}{\cjc@chinesetrue} 243 | \DeclareOption{english}{\cjc@chinesefalse} 244 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}} 245 | \ExecuteOptions{chinese} 246 | \ProcessOptions\relax 247 | % \end{macrocode} 248 | % 249 | % 250 | % \subsection{加载文档类和宏包} 251 | % 252 | % \begin{macrocode} 253 | \ifcjc@chinese 254 | \PassOptionsToClass{scheme=chinese}{ctexart} 255 | \else 256 | \PassOptionsToClass{scheme=plain}{ctexart} 257 | \fi 258 | \PassOptionsToPackage{quiet}{xeCJK} 259 | % \end{macrocode} 260 | % 261 | % 载入 \cls{ctexart} 文档类,注意要求为 2.2 或更高的版本。 262 | % \begin{macrocode} 263 | \LoadClass[UTF8,a4paper,twoside,twocolumn,zihao=5,linespread=1.08]{ctexart}[2016/05/16] 264 | % \end{macrocode} 265 | % 266 | % 检测 ctexart 版本,如果版本过低会报错 267 | % \begin{macrocode} 268 | \@ifclasslater{ctexart}{2016/05/16}{}{ 269 | \ClassError{cjc}{% 270 | This template requires TeX Live\MessageBreak 2016 or later version}{} 271 | } 272 | % \end{macrocode} 273 | % 274 | % 建议在模板开始处载入全部宏包,不要轻易改变加载顺序。 275 | % \pkg{hyperref} 一般在最后加载。 276 | % \begin{macrocode} 277 | \RequirePackage{kvdefinekeys} 278 | \RequirePackage{kvsetkeys} 279 | \RequirePackage{amsmath} 280 | \RequirePackage{unicode-math} 281 | \RequirePackage{amsthm} 282 | \RequirePackage{geometry} 283 | \RequirePackage{graphicx} 284 | \RequirePackage{fancyhdr} 285 | \RequirePackage{caption} 286 | \RequirePackage{url} 287 | \RequirePackage[numbers,sort&compress]{natbib} 288 | % \end{macrocode} 289 | % 290 | % 291 | % \subsection{字体} 292 | % 293 | % \subsubsection{字体库} 294 | % 295 | % \begin{macro}{\cjc@strifeq} 296 | % 使用 \LaTeX3 的功能判断字符串是否相等。这里也可以使用 \pkg{xstring} 宏包。 297 | % \begin{macrocode} 298 | \newcommand\cjc@strifeq{\csname str_if_eq_x:nnTF\endcsname} 299 | % \end{macrocode} 300 | % \end{macro} 301 | % 302 | % \begin{macro}{\cjc@fontset} 303 | % 将 \pkg{ctex} 的 \opt{fontset} 存在 \cs{cjc@fontset} 方便 \LaTeXe{} 调用。 304 | % \begin{macrocode} 305 | \newcommand\cjc@fontset{\csname g__ctex_fontset_tl\endcsname} 306 | % \end{macrocode} 307 | % \end{macro} 308 | % 309 | % 大部分学位论文都要求西文字体使用 Times New Roman, 310 | % 但是在 Linux 下没有这两个字体,所以使用它们的克隆版 TeX Gyre Termes。 311 | % \begin{macrocode} 312 | \cjc@strifeq{\cjc@fontset}{fandol}{ 313 | \setmainfont[ 314 | Extension = .otf, 315 | UprightFont = *-regular, 316 | BoldFont = *-bold, 317 | ItalicFont = *-italic, 318 | BoldItalicFont = *-bolditalic, 319 | ]{texgyretermes} 320 | \setsansfont[ 321 | Extension = .otf, 322 | UprightFont = *-regular, 323 | BoldFont = *-bold, 324 | ItalicFont = *-italic, 325 | BoldItalicFont = *-bolditalic, 326 | ]{texgyreheros} 327 | \setmonofont[ 328 | Extension = .otf, 329 | UprightFont = *-regular, 330 | BoldFont = *-bold, 331 | ItalicFont = *-italic, 332 | BoldItalicFont = *-bolditalic, 333 | Scale = MatchLowercase, 334 | ]{texgyrecursor} 335 | \ClassWarningNoLine{cjc}{% 336 | You are using Fandol font family.\MessageBreak 337 | Some glyphs may be missing.\MessageBreak 338 | Please switch to a high-quality font set 339 | } 340 | }{ 341 | \setmainfont{Times New Roman} 342 | \setsansfont[Scale=MatchLowercase]{Arial} 343 | \cjc@strifeq{\cjc@fontset}{mac}{ 344 | \setmonofont[Scale=MatchLowercase]{Menlo} 345 | }{ 346 | \setmonofont[Scale=MatchLowercase]{Courier New} 347 | } 348 | } 349 | % \end{macrocode} 350 | % 351 | % 中文字体可以由 \pkg{ctex} 自动设置,但是会有问题: 352 | % \begin{enumerate} 353 | % \item 无衬线字体默认会使用微软雅黑或者苹方,这对打印不太友好; 354 | % \item 没有粗体的字体不会开启伪粗; 355 | % \end{enumerate} 356 | % 所以需要重新配置一部分,参考 \pkg{ctex} 宏包。 357 | % \begin{macrocode} 358 | \cjc@strifeq{\cjc@fontset}{mac}{ 359 | \setCJKmainfont[ 360 | UprightFont = * Light, 361 | BoldFont = Heiti SC Medium, 362 | ItalicFont = Kaiti SC, 363 | BoldItalicFont = Kaiti SC Bold, 364 | ]{Songti SC} 365 | \setCJKsansfont[BoldFont=* Medium]{Heiti SC} 366 | \setCJKfamilyfont{zhsong}[ 367 | UprightFont = * Light, 368 | BoldFont = * Bold, 369 | ]{Songti SC} 370 | \setCJKfamilyfont{zhhei}[BoldFont=* Medium]{Heiti SC} 371 | \setCJKfamilyfont{zhkai}[BoldFont=* Bold]{Kaiti SC} 372 | \xeCJKsetwidth{‘’“”}{1em} 373 | }{ 374 | \xeCJKsetup{EmboldenFactor=2} 375 | \cjc@strifeq{\cjc@fontset}{windows}{ 376 | \IfFileExists{C:/bootfont.bin}{ 377 | \setCJKmainfont[ 378 | BoldFont = SimHei, 379 | ItalicFont = KaiTi_GB2312, 380 | ]{SimSun} 381 | \setCJKfamilyfont{zhkai}{KaiTi_GB2312} 382 | }{ 383 | \setCJKmainfont[ 384 | BoldFont = SimHei, 385 | ItalicFont = KaiTi 386 | ]{SimSun} 387 | \setCJKfamilyfont{zhkai}{KaiTi} 388 | } 389 | \setCJKsansfont{SimHei} 390 | \setCJKfamilyfont{zhsong}{SimSun} 391 | \setCJKfamilyfont{zhhei}{SimHei} 392 | }{} 393 | } 394 | % \end{macrocode} 395 | % 396 | % 使用 \pkg{unicode-math} 配置数学字体。 397 | % \begin{macrocode} 398 | \unimathsetup{ 399 | math-style = ISO, 400 | bold-style = ISO, 401 | nabla = upright, 402 | partial = upright, 403 | } 404 | % \end{macrocode} 405 | % 406 | % 使用 XITS Math 作为数学字体。 407 | % 408 | % 注意,\cs{IfFontExistsTF} 是 \pkg{fontspec} 2017/01/20 v2.5c 才提供的; 409 | % 而 XITS 字体于 2018-10-03 更改了字体的文件名。 410 | % \begin{macrocode} 411 | \newif\ifcjc@xitsnew 412 | \@ifpackagelater{fontspec}{2017/01/20}{ 413 | \IfFontExistsTF{XITSMath-Regular.otf}{ 414 | \cjc@xitsnewtrue 415 | }{} 416 | }{} 417 | \ifcjc@xitsnew 418 | \setmathfont[ 419 | Extension = .otf, 420 | BoldFont = XITSMath-Bold, 421 | StylisticSet = 8, 422 | ]{XITSMath-Regular} 423 | \setmathfont[range={cal,bfcal},StylisticSet=1]{XITSMath-Regular.otf} 424 | \else 425 | \setmathfont[ 426 | Extension = .otf, 427 | BoldFont = *bold, 428 | StylisticSet = 8, 429 | ]{xits-math} 430 | \setmathfont[range={cal,bfcal},StylisticSet=1]{xits-math.otf} 431 | \fi 432 | % \end{macrocode} 433 | % 434 | % \begin{macro}{\cjc@circlefont} 435 | % 五级节标题和脚注需要使用带圈数字, 436 | % 但 Times New Roman 没有这些符号的字形,而华文宋体和中易宋体提供了这些字形, 437 | % 配置在 \cs{cjc@circlefont}。 438 | % \begin{macrocode} 439 | \cjc@strifeq{\cjc@fontset}{mac}{ 440 | \newfontfamily\cjc@circlefont{Songti SC Light} 441 | }{ 442 | \cjc@strifeq{\cjc@fontset}{windows}{ 443 | \newfontfamily\cjc@circlefont{SimSun} 444 | }{ 445 | \ifcjc@xitsnew 446 | \newfontfamily\cjc@circlefont{XITS-Regular.otf} 447 | \else 448 | \newfontfamily\cjc@circlefont{xits-regular.otf} 449 | \fi 450 | } 451 | } 452 | % \end{macrocode} 453 | % \end{macro} 454 | % 455 | % 456 | % \subsubsection{字号与行距} 457 | % 458 | % 目前最广泛使用的印刷的长度单位点(磅)通常指 PostScript point 459 | % \footnote{\url{https://en.wikipedia.org/wiki/Point_(typography)}}, 460 | % 在 \LaTeX{} 中是 bp,比默认的 pt 略大。 461 | % 这里保存起来可以节约编译时间。 462 | % \begin{macrocode} 463 | \newdimen\bp@ 464 | \bp@=1bp 465 | % \end{macrocode} 466 | % 467 | % 468 | % \subsection{处理语言} 469 | % 470 | % 由于 Unicode 的一些标点符号是中西文混用的: 471 | % \unicodechar{00B7}、 472 | % \unicodechar{2013}、 473 | % \unicodechar{2014}、 474 | % \unicodechar{2018}、 475 | % \unicodechar{2019}、 476 | % \unicodechar{201C}、 477 | % \unicodechar{201D}、 478 | % \unicodechar{2025}、 479 | % \unicodechar{2026}、 480 | % \unicodechar{2E3A}, 481 | % 所以要根据语言设置正确的字体。 482 | % \footnote{\url{https://github.com/CTeX-org/ctex-kit/issues/389}} 483 | % 所以要根据语言设置正确的字体。 484 | % \begin{macrocode} 485 | \newcommand\cjc@setchinese{% 486 | \xeCJKResetPunctClass 487 | } 488 | \newcommand\cjc@setenglish{% 489 | \xeCJKDeclareCharClass{HalfLeft}{"2018, "201C}% 490 | \xeCJKDeclareCharClass{HalfRight}{% 491 | "00B7, "2019, "201D, "2013, "2014, "2025, "2026, "2E3A% 492 | }% 493 | } 494 | \newcommand\cjc@setdefaultlanguage{% 495 | \ifcjc@chinese 496 | \cjc@setchinese 497 | \else 498 | \cjc@setenglish 499 | \fi 500 | } 501 | % \end{macrocode} 502 | % 503 | % 504 | % \subsection{纸张和页面} 505 | % 使用 \pkg{geometry} 宏包设置纸张和页面。 506 | % 507 | % 纸张:A4; 508 | % 509 | % 页面设置:上、下 2.6 cm,左、右 2 cm,页眉 1.7 cm,页脚 1.7 cm。 510 | % 511 | % 注意这里指的是页眉顶部到纸张顶部的距离为 1.7 cm, 512 | % 所以 $\text{footskip} = \SI{2.6}{cm} - \SI{1.7}{cm} = \SI{0.9}{cm}$ 513 | % 514 | % \begin{macrocode} 515 | \geometry{ 516 | paper = a4paper, 517 | vmargin = 2.6cm, 518 | hmargin = 2cm, 519 | headheight = 0.75cm, 520 | headsep = 0.15cm, 521 | twocolumn = true, 522 | columnsep = 0.75cm, 523 | } 524 | % \end{macrocode} 525 | % 526 | % 使用 \pkg{fancy} 需要先调用 |\pagestyle{fancy}| 再修改 \cs{sectionmark}。 527 | % \begin{macrocode} 528 | \pagestyle{fancy} 529 | \let\sectionmark\@gobble 530 | \renewcommand\headrulewidth{0.4\p@} 531 | % \end{macrocode} 532 | % 533 | % 页眉与该部分的章标题相同,宋体 10.5 磅(五号)居中。 534 | % 页码:宋体 10.5 磅、页面下脚居中。 535 | % \begin{macrocode} 536 | \newcommand\cjc@hf@font{\small} 537 | % \end{macrocode} 538 | % 539 | % 重定义默认的 |plain| page style,会显示页眉和页脚。 540 | % \begin{macrocode} 541 | \newcommand\cjc@number{1} 542 | \newcommand\cjc@volume{1} 543 | \fancypagestyle{main}{% 544 | \fancyhf{}% 545 | \fancyhead[LO]{\cjc@hf@font \cjc@number{} 期}% 546 | \fancyhead[CO]{\cjc@hf@font 作者名等:论文题目}% 547 | \fancyhead[RO,LE]{\cjc@hf@font\thepage}% 548 | \fancyhead[CE]{\cjc@hf@font 计算机学报}% 549 | \fancyhead[RE]{\cjc@hf@font \the\year{} 年}% 550 | } 551 | \pagestyle{main} 552 | % \end{macrocode} 553 | % 554 | % |headings| 只有页眉,没有页脚,用于研究生的符号说明和本科生的 front matter。 555 | % \begin{macrocode} 556 | \fancypagestyle{plain}{% 557 | \fancyhf{}% 558 | \fancyhead[L]{\cjc@hf@font 第 \cjc@volume{} 卷\quad 第 \cjc@number{} 期\\\the\year{} 年 \the\month{} 月}% 559 | \fancyhead[C]{\cjc@hf@font 计算机学报\\CHINESE JOURNAL OF COMPUTERS}% 560 | \fancyhead[R]{\cjc@hf@font Vol. \cjc@volume\quad No. \cjc@number\\\cjc@doi}% 561 | } 562 | % \end{macrocode} 563 | % 564 | % 565 | % \subsection{标题} 566 | % 567 | % \begin{macro}{\cjcsetup} 568 | % \begin{macrocode} 569 | \newcommand\cjc@clc{*****} 570 | \newcommand\cjc@doi{10.1000/182} 571 | \newcommand\cjcsetup{\kvsetkeys{cjc}} 572 | \kv@set@family@handler{cjc}{\expandafter\gdef\csname cjc@#1\endcsname{#2}} 573 | % \kv@define@key{cjc}{affiliations}{\kvsetkeys{aff}{#1}} 574 | % \kv@set@family@handler{aff}{% 575 | % \kv@define@key{affname}{name}{% 576 | % \expandafter\gdef\csname cjc@aff@#1@name\endcsname{##1}% 577 | % }% 578 | % \kv@define@key{affname}{name*}{% 579 | % \expandafter\gdef\csname cjc@aff@#1@en@name\endcsname{##1}% 580 | % }% 581 | % \kvsetkeys{affname}{#2}% 582 | % } 583 | % \kv@define@key{author}{name}{#1} 584 | % \kv@define@key{author}{name*}{} 585 | % \kv@define@key{author}{affiliations}{} 586 | % \kv@define@key{author}{bio}{} 587 | % \kv@define@key{author}{email}{} 588 | \newcommand\cjc@author{% 589 | % \@for\a:=\cjc@authors\do{% 590 | % \kvsetkeysexpandafter{author}{\a}% 591 | % }% 592 | } 593 | % \end{macrocode} 594 | % \end{macro} 595 | % 596 | % \begin{macro}{\maketitle} 597 | % 定义命令用于录入信息。 598 | % \begin{macrocode} 599 | \def\@maketitle{% 600 | \newpage 601 | \null 602 | \cjc@make@zh@title 603 | \cjc@make@en@title 604 | } 605 | \def\cjc@make@zh@title{% 606 | \vspace*{20\bp@}% 607 | \begingroup 608 | \centering 609 | \heiti\zihao{2}\cjc@title\par 610 | \endgroup 611 | \vspace*{7.8\bp@}% 612 | \begingroup 613 | \zihao{-5}% 614 | \textbf{摘\quad 要}\quad\cjc@abstract\par 615 | 关键词\quad\cjc@keywords\par 616 | 中图法分类号\quad\cjc@clc\qquad 617 | DOI 号\quad\cjc@doi\par 618 | \endgroup 619 | } 620 | \def\cjc@make@en@title{% 621 | \vspace*{12\bp@}% 622 | \begingroup 623 | \centering 624 | \bfseries\zihao{4}\@nameuse{cjc@title*}\par 625 | \endgroup 626 | \vspace{5\bp@}% 627 | \begingroup 628 | \zihao{-5}% 629 | \textbf{Abstract}\quad\@nameuse{cjc@abstract*}\par 630 | \textbf{Key words}\quad\@nameuse{cjc@keywords*}\par 631 | \endgroup 632 | } 633 | % \end{macrocode} 634 | % \end{macro} 635 | % 636 | % 637 | % \subsection{摘要} 638 | % 639 | % \begin{environment}{abstract} 640 | % \begin{macrocode} 641 | \renewenvironment{abstract}{% 642 | \if@twocolumn 643 | \section*{\abstractname}% 644 | \else 645 | \small 646 | \begin{center}% 647 | {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}% 648 | \end{center}% 649 | \quotation 650 | \fi} 651 | {\if@twocolumn\else\endquotation\fi} 652 | % \end{macrocode} 653 | % \end{environment} 654 | % 655 | % 656 | % \subsection{章节标题} 657 | % 658 | % 用 \pkg{ctex} 的接口设置全部章节标题格式。 659 | % 660 | % 一级标题:4 号黑体,段前 8 磅,段后 8 磅。 661 | % \begin{macrocode} 662 | \ctexset{ 663 | section = { 664 | format = \heiti\zihao{4}, 665 | beforeskip = 8\bp@, 666 | afterskip = 8\bp@, 667 | }, 668 | % \end{macrocode} 669 | % 670 | % 二级标题:5 号黑体,段前 0.25 行,段后 0.25 行。 671 | % \begin{macrocode} 672 | subsection = { 673 | format = \heiti\zihao{5}, 674 | beforeskip = 2.625\bp@, 675 | afterskip = 2.625\bp@, 676 | }, 677 | % \end{macrocode} 678 | % 679 | % 三级节标题:5 号宋体,段前段后 0 磅。 680 | % \begin{macrocode} 681 | subsubsection = { 682 | format = \zihao{5}, 683 | beforeskip = \z@, 684 | afterskip = \z@, 685 | }, 686 | } 687 | % \end{macrocode} 688 | % 689 | % 690 | % \subsection{正文} 691 | % 692 | % \cs{sloppy} 可以减少“overfull boxes”。 693 | % \begin{macrocode} 694 | \sloppy 695 | % \end{macrocode} 696 | % 697 | % 禁止扩大段间距。(\href{https://github.com/ustctug/ustcthesis/issues/209}{ 698 | % ustctug/ustcthesis\#209}) 699 | % \begin{macrocode} 700 | \raggedbottom 701 | % \end{macrocode} 702 | % 703 | % 段间距 0 磅。 704 | % \begin{macrocode} 705 | \setlength{\parskip}{\z@} 706 | % \end{macrocode} 707 | % 708 | % URL 的字体设为保持原样。 709 | % \begin{macrocode} 710 | \urlstyle{same} 711 | % \end{macrocode} 712 | % 713 | % 使用 \pkg{xurl} 宏包的方法,增加 URL 可断行的位置。 714 | % \begin{macrocode} 715 | \def\UrlBreaks{% 716 | \do\/% 717 | \do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l% 718 | \do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z% 719 | \do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L% 720 | \do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X\do\Y\do\Z% 721 | \do0\do1\do2\do3\do4\do5\do6\do7\do8\do9\do=\do/\do.\do:% 722 | \do\*\do\-\do\~\do\'\do\"\do\-} 723 | \Urlmuskip=0mu plus 0.1mu 724 | % \end{macrocode} 725 | % 726 | % 727 | % \subsection{浮动体} 728 | % 729 | % \LaTeX{} 对放置浮动体的要求比较强,这里按照 UK TeX FAQ 的建议 730 | % \footnote{\url{https://texfaq.org/FAQ-floats}} 对其适当放宽。 731 | % \begin{macrocode} 732 | \renewcommand\topfraction{.85} 733 | \renewcommand\bottomfraction{.7} 734 | \renewcommand\textfraction{.15} 735 | \renewcommand\floatpagefraction{.66} 736 | \renewcommand\dbltopfraction{.66} 737 | \renewcommand\dblfloatpagefraction{.66} 738 | \setcounter{topnumber}{9} 739 | \setcounter{bottomnumber}{9} 740 | \setcounter{totalnumber}{20} 741 | \setcounter{dbltopnumber}{9} 742 | % \end{macrocode} 743 | % 744 | % 修改默认的浮动体描述符为 |htb|。 745 | % \begin{macrocode} 746 | \def\fps@figure{htb} 747 | \def\fps@table{htb} 748 | % \end{macrocode} 749 | % 750 | % 用 \pkg{caption} 宏包设置图、表的格式: 751 | % 752 | % 图片说明字体为小 5 号。 753 | % 754 | % 表号、表题置于表的上方,宋体 10.5 磅居中,单倍行距,段前 6 磅,段后 6 磅, 755 | % 表号与表题文字之间空一字,表号、表题加粗。 756 | % 表注左缩进两字,续行悬挂缩进左对齐,两端对齐。 757 | % \begin{macrocode} 758 | % \setlength{\floatsep}{6\bp@} 759 | % \setlength{\textfloatsep}{6\bp@} 760 | % \setlength{\intextsep}{6\bp@} 761 | \DeclareCaptionLabelSeparator{zhspace}{\hspace{\ccwd}} 762 | \captionsetup{ 763 | justification = centerlast, 764 | font = small, 765 | labelsep = zhspace, 766 | skip = 6\bp@, 767 | figureposition = bottom, 768 | tableposition = top, 769 | } 770 | \DeclareCaptionFont{heiti}{\heiti} 771 | \captionsetup[table]{ 772 | font = {heiti,small}, 773 | } 774 | % \end{macrocode} 775 | % 776 | % 777 | % \subsection{数学符号} 778 | % 779 | % 根据中文的数学排印习惯进行设置: 780 | % 781 | % \begin{macro}{\ldots} 782 | % 省略号一律居中,所以 \cs{ldots} 不再居于底部。 783 | % \begin{macrocode} 784 | \ifcjc@chinese 785 | \def\mathellipsis{\cdots} 786 | \fi 787 | % \end{macrocode} 788 | % \end{macro} 789 | % 790 | % \begin{macro}{\le} 791 | % \begin{macro}{\ge} 792 | % 小于等于号、大于等于号要使用倾斜的字形。 793 | % \begin{macrocode} 794 | \protected\def\le{\leqslant} 795 | \protected\def\ge{\geqslant} 796 | \AtBeginDocument{% 797 | \renewcommand\leq{\leqslant}% 798 | \renewcommand\geq{\geqslant}% 799 | } 800 | % \end{macrocode} 801 | % \end{macro} 802 | % \end{macro} 803 | % 804 | % \begin{macro}{\int} 805 | % 积分号的上下限默认置于上下两侧。 806 | % \begin{macrocode} 807 | \removenolimits{% 808 | \int\iint\iiint\iiiint\oint\oiint\oiiint 809 | \intclockwise\varointclockwise\ointctrclockwise\sumint 810 | \intbar\intBar\fint\cirfnint\awint\rppolint 811 | \scpolint\npolint\pointint\sqint\intlarhk\intx 812 | \intcap\intcup\upint\lowint 813 | } 814 | % \end{macrocode} 815 | % \end{macro} 816 | % 817 | % \begin{macro}{\Re} 818 | % \begin{macro}{\Im} 819 | % 实部、虚部操作符使用罗马体 $\mathrm{Re}$、$\mathrm{Im}$ 而不是 fraktur 体 820 | % $\Re$、$\Im$。 821 | % \begin{macrocode} 822 | \AtBeginDocument{% 823 | \renewcommand\Re{\operatorname{Re}}% 824 | \renewcommand\Im{\operatorname{Im}}% 825 | } 826 | % \end{macrocode} 827 | % \end{macro} 828 | % \end{macro} 829 | % 830 | % \begin{macro}{\nabla} 831 | % \cs{nabla} 使用粗正体。 832 | % \begin{macrocode} 833 | \AtBeginDocument{% 834 | \renewcommand\nabla{\mbfnabla}% 835 | } 836 | % \end{macrocode} 837 | % \end{macro} 838 | % 839 | % \begin{macro}{\bm} 840 | % \begin{macro}{\boldsymbol} 841 | % 兼容旧的粗体命令:\pkg{bm} 的 \cs{bm} 和 \pkg{amsmath} 的 \cs{boldsymbol}。 842 | % \begin{macrocode} 843 | \newcommand\bm{\symbf} 844 | \renewcommand\boldsymbol{\symbf} 845 | % \end{macrocode} 846 | % \end{macro} 847 | % \end{macro} 848 | % 849 | % \begin{macro}{\square} 850 | % 兼容 \pkg{amssymb} 中的命令。 851 | % \begin{macrocode} 852 | \newcommand\square{\mdlgwhtsquare} 853 | % \end{macrocode} 854 | % \end{macro} 855 | % 856 | % 提供一些方便的命令: 857 | % \begin{macrocode} 858 | \newcommand\upe{\symup{e}} 859 | \newcommand\upi{\symup{i}} 860 | \newcommand\dif{\mathop{}\!\mathrm{d}} 861 | \DeclareMathOperator*{\argmax}{arg\,max} 862 | \DeclareMathOperator*{\argmin}{arg\,min} 863 | % \end{macrocode} 864 | % 865 | % 866 | % \subsubsection{数学定理} 867 | % 868 | % \begin{macrocode} 869 | \newtheoremstyle{cjc} 870 | {\z@}{\z@} 871 | {}{2\ccwd} 872 | {\bfseries}{.} 873 | {\ccwd}{} 874 | \theoremstyle{cjc} 875 | % \end{macrocode} 876 | % 定义新的定理 877 | % \begin{macrocode} 878 | \newcommand\cjc@assertionname{断言} 879 | \newcommand\cjc@assumptionname{假设} 880 | \newcommand\cjc@axiomname{公理} 881 | \newcommand\cjc@corollaryname{推论} 882 | \newcommand\cjc@definitionname{定义} 883 | \newcommand\cjc@examplename{例} 884 | \newcommand\cjc@lemmaname{引理} 885 | \newcommand\cjc@proofname{证明} 886 | \newcommand\cjc@propositionname{命题} 887 | \newcommand\cjc@remarkname{注} 888 | \newcommand\cjc@theoremname{定理} 889 | \newtheorem{theorem} {\cjc@theoremname} 890 | \newtheorem{assertion} [theorem]{\cjc@assertionname} 891 | \newtheorem{axiom} [theorem]{\cjc@axiomname} 892 | \newtheorem{corollary} [theorem]{\cjc@corollaryname} 893 | \newtheorem{lemma} [theorem]{\cjc@lemmaname} 894 | \newtheorem{proposition}[theorem]{\cjc@propositionname} 895 | \newtheorem{assumption} {\cjc@assumptionname} 896 | \newtheorem{definition} {\cjc@definitionname} 897 | \newtheorem{example} {\cjc@examplename} 898 | \newtheorem*{remark} {\cjc@remarkname} 899 | % \end{macrocode} 900 | % \pkg{amsthm} 单独定义了 proof 环境,这里重新定义以满足格式要求。 901 | % 原本模仿 \pkg{amsthm} 写成 |\item[\hskip\labelsep\hskip2\ccwd #1\hskip\ccwd]|, 902 | % 但是却会多出一些间隙。 903 | % \begin{macrocode} 904 | \DeclareRobustCommand{\qed}{证毕.} 905 | \renewenvironment{proof}[1][\proofname]{\par 906 | \textbf{\proofname}.\quad 907 | }{% 908 | \par\raggedleft\qed\par 909 | } 910 | % \end{macrocode} 911 | % 912 | % 913 | % \subsection{参考文献} 914 | % 915 | % \begin{environment}{thebibliography} 916 | % 参考文献列表格式:宋体 10.5 磅,行距 20 磅,续行缩进两字,左对齐。 917 | % \begin{macrocode} 918 | \renewcommand\bibfont{\fontsize{7.5\bp@}{14\bp@}\linespread{1}\selectfont} 919 | \renewcommand\@biblabel[1]{[#1]\hfill} 920 | % \end{macrocode} 921 | % \end{environment} 922 | % 923 | % 924 | % \subsection{其他宏包的设置} 925 | % 926 | % 这些宏包并非格式要求,但是为了方便同学们使用,在这里进行简单设置。 927 | % \begin{macrocode} 928 | \newcommand\cjc@atendpackage{\csname ctex_at_end_package:nn\endcsname} 929 | % \end{macrocode} 930 | % 931 | % 932 | % \subsubsection{\pkg{hyperref} 宏包} 933 | % 934 | % \begin{macrocode} 935 | \cjc@atendpackage{hyperref}{ 936 | \hypersetup{ 937 | bookmarksnumbered = true, 938 | bookmarksopen = true, 939 | bookmarksopenlevel = 1, 940 | linktoc = all, 941 | unicode = true, 942 | psdextra = true, 943 | hidelinks, 944 | } 945 | % \end{macrocode} 946 | % 947 | % 填写 PDF 元信息。 948 | % \begin{macrocode} 949 | \AtBeginDocument{% 950 | \hypersetup{ 951 | pdftitle = \@title, 952 | pdfauthor = \@author, 953 | }% 954 | } 955 | % \end{macrocode} 956 | % 957 | % 在 PDF 字符串中去掉换行,以减少 \pkg{hyperref} 的警告信息。 958 | % \begin{macrocode} 959 | \pdfstringdefDisableCommands{ 960 | \let\\\@empty 961 | \let\hspace\@gobble 962 | } 963 | % \end{macrocode} 964 | % 965 | % \pkg{hyperref} 与 \pkg{unicode-math} 存在一些兼容性问题,见 966 | % \href{https://github.com/ustctug/ustcthesis/issues/223}{ 967 | % ustctug/ustcthesis\#223} 和 968 | % \href{https://github.com/ho-tex/hyperref/pull/90}{ho-tex/hyperref\#90}。 969 | % \begin{macrocode} 970 | \@ifpackagelater{hyperref}{2019/04/27}{}{% 971 | \g@addto@macro\psdmapshortnames{\let\mu\textmugreek}% 972 | } 973 | % \end{macrocode} 974 | % 975 | % 设置中文的 \cs{autoref}。 976 | % \footnote{\url{https://tex.stackexchange.com/a/66150/82731}} 977 | % \begin{macrocode} 978 | \ifcjc@chinese 979 | \def\equationautorefname~#1\null{公式~(#1)\null} 980 | \def\footnoteautorefname{脚注} 981 | \def\itemautorefname~#1\null{第~#1 项\null} 982 | \def\figureautorefname{图} 983 | \def\tableautorefname{表} 984 | \def\appendixautorefname{附录} 985 | \def\sectionautorefname~#1\null{第~#1 节\null} 986 | \def\subsectionautorefname~#1\null{第~#1 节\null} 987 | \def\subsubsectionautorefname~#1\null{第~#1 节\null} 988 | \def\theoremautorefname{定理} 989 | \def\HyRef@autopageref#1{\hyperref[{#1}]{第~\pageref*{#1} 页}} 990 | \fi 991 | } 992 | % \end{macrocode} 993 | % 994 | % 995 | % \subsubsection{\pkg{siunitx} 宏包} 996 | % 997 | % \begin{macrocode} 998 | \cjc@atendpackage{siunitx}{ 999 | \sisetup{ 1000 | group-minimum-digits = 4, 1001 | separate-uncertainty = true, 1002 | inter-unit-product = \ensuremath{{}\cdot{}}, 1003 | } 1004 | \ifcjc@chinese 1005 | \sisetup{ 1006 | list-final-separator = { 和 }, 1007 | list-pair-separator = { 和 }, 1008 | range-phrase = {~}, 1009 | } 1010 | \fi 1011 | } 1012 | % \end{macrocode} 1013 | % 1014 | % \Finale 1015 | \endinput 1016 | % \Finale 1017 | \endinput 1018 | -------------------------------------------------------------------------------- /latexmkrc: -------------------------------------------------------------------------------- 1 | $pdf_mode = 5; 2 | $go_mode = 1; 3 | 4 | $pdflatex = "pdflatex -file-line-error -halt-on-error -interaction=nonstopmode -synctex=1 %O %S"; 5 | $xelatex = "xelatex -file-line-error -halt-on-error -interaction=nonstopmode -no-pdf -synctex=1 %O %S"; 6 | $xdvipdfmx = "xdvipdfmx -q -E -o %D %O %S"; 7 | 8 | $bibtex_use = 1.5; 9 | 10 | $clean_ext = "hd synctex.gz xdv"; 11 | 12 | $makeindex = "makeindex -s gind.ist %O -o %D %S"; 13 | add_cus_dep('glo', 'gls', 0, 'glo2gls'); 14 | sub glo2gls { 15 | system("makeindex -s gglo.ist -o \"$_[0].gls\" \"$_[0].glo\""); 16 | } 17 | push @generated_exts, "glo", "gls"; 18 | -------------------------------------------------------------------------------- /main.tex: -------------------------------------------------------------------------------- 1 | % !TeX encoding = UTF-8 2 | % !TeX program = xelatex 3 | % !TeX spellcheck = en_US 4 | 5 | \documentclass{cjc} 6 | 7 | \usepackage{booktabs} 8 | \usepackage{siunitx} 9 | \usepackage{hyperref} 10 | 11 | 12 | 13 | \begin{document} 14 | 15 | \cjcsetup{ 16 | title = {题目}, 17 | title* = {Title}, 18 | authors = { 19 | { 20 | name = {作者名 1}, 21 | name* = {Name 1}, 22 | affiliations = {aff1}, 23 | bio = {性别,xxxx年生,学历,职称,主要研究领域为*****、****}, 24 | email = {***@***.***}, 25 | }, 26 | { 27 | name = {作者名 2}, 28 | name* = {Name 2}, 29 | affiliations = {aff2, aff3}, 30 | bio = {性别,xxxx年生,学历,职称,主要研究领域为*****、****}, 31 | email = {***@***.***}, 32 | }, 33 | { 34 | name = {作者名 3}, 35 | name* = {Name 3}, 36 | affiliations = {aff3}, 37 | bio = {性别,xxxx年生,学历,职称,主要研究领域为*****、****}, 38 | email = {***@***.***}, 39 | }, 40 | }, 41 | affiliations = { 42 | aff1 = { 43 | name = {单位全名 部门(系)全名, 市(或直辖市) 国家名 邮政编码}, 44 | name* = {Department of ****, University, City ZipCode, Country}, 45 | }, 46 | aff2 = { 47 | name = {单位全名 部门(系)全名, 市(或直辖市) 国家名 邮政编码}, 48 | name* = {Department of ****, University, City ZipCode, Country}, 49 | }, 50 | aff3 = { 51 | name = {单位全名 部门(系)全名, 市(或直辖市) 国家名 邮政编码}, 52 | name* = {Department of ****, University, City ZipCode, Country}, 53 | }, 54 | }, 55 | abstract = { 56 | 中文摘要内容置于此处(英文摘要中要有这些内容),字体为小5号宋体。 57 | 摘要贡献部分,要有数据支持,不要出现“...大大提高”、“...显著改善”等描述, 58 | 正确的描述是“比…提高X\%”、 “在…上改善X\%”。 59 | }, 60 | % 中文关键字与英文关键字对应且一致,应有5-7个关键词 61 | keywords = {关键词, 关键词, 关键词, 关键词}, 62 | abstract* = {Abstract}, 63 | % 中文关键字与英文关键字对应且一致,不要用英文缩写 64 | keywords* = {key word, key word, key word, key word}, 65 | } 66 | 67 | \maketitle 68 | 69 | 70 | 71 | \section{一级标题} 72 | 73 | 对投稿的基本要求: 74 | 75 | (1)研究性论文主体应包括引言(重点论述研究的科学问题、意义、解决思路、价值、 76 | 贡献等)、相关工作(为与引言部分独立的一个章节)、主要成果论述、关键实现技术、 77 | 验证(对比实验或理论证明)、结论(结束语)等内容;系统实现或实验应有关键点的详细论述,以便读者能够重复实现论文所述成果。实验应有具体的实验环境设置、全面细致的数据对比分析。 78 | 79 | (2)综述应包括引言、问题与挑战、研究现状分析、未来研究方向、结论等内容。以分析、对比为主,避免堆砌文献或一般性介绍、叙述。 80 | 81 | (3)定理证明、公式推导、大篇幅的数学论述、原始数据,放到论文最后的附录中。 82 | 83 | 稿件提交时的基本要求: 84 | 85 | (1)本模板中要求的各项内容正确齐全,无遗漏; 86 | 87 | (2)语句通顺,无中文、英文语法错误,易于阅读理解,符号使用正确,图、表清晰无误; 88 | 89 | (3)在学术、技术上,论文内容正确无误,各项内容确定。 90 | 91 | \subsection{二级标题} 92 | 93 | \subsubsection{三级标题} 94 | 95 | 正文部分, 字体为5号宋体。 96 | 97 | 文件排版采用 TeX Live。 98 | 99 | 正文文字要求语句通顺,无语法错误,结构合理,条理清楚,不影响审稿人、读者阅读理解全文内容。以下几类问题请作者们特别注意: 100 | 101 | 1)文章题目应明确反映文章的思想和方法;文字流畅,表述清楚; 102 | 103 | 2)中文文字、英文表达无语法错误; 104 | 105 | 3)公式中无符号、表达式的疏漏,没有同一个符号表示两种意思的情况; 106 | 107 | 4)数学中使用的符号、函数名用斜体; 108 | 109 | 5)使用的量符合法定计量单位标准; 110 | 111 | 6)矢量为黑体,标量为白体; 112 | 113 | 7)变量或表示变化的量用斜体; 114 | 115 | 8)图表规范,量、线、序无误,位置正确(图表必须在正文中有所表述后出现,即…如图1所示)(注意纵、横坐标应有坐标名称和刻度值)。 116 | 117 | 9)列出的参考文献必须在文中按顺序引用,即参考文献顺序与引用顺序一致,各项信息齐全(格式见参考文献部分); 118 | 119 | 10)首次出现的缩写需写明全称,首次出现的符号需作出解释。 120 | 121 | 11)图的图例说明、坐标说明全部用中文或量符号。 122 | 123 | 12)图应为矢量图。 124 | 125 | 13)表中表头文字采用中文。 126 | 127 | 14)公式尺寸: 128 | 129 | 标准:10.5磅 130 | 131 | 下标/上标:5.8磅 132 | 133 | 次下标/上标:4.5磅 134 | 135 | 符号:16磅 136 | 137 | 次符号:10.5磅 138 | 139 | 15)组合单位采用标准格式,如:“pJ/bit/m4”应为“\si{pJ/(bit.m^4)}” 140 | 141 | 142 | \begin{theorem} 143 | 定理内容。 144 | “定义”、“假设”、“公理”、“引理”等的排版格式与此相同,详细定理证明、公式可放在附录中。 145 | \end{theorem} 146 | 147 | \begin{proof} 148 | 证明过程. 149 | \end{proof} 150 | 151 | \begin{figure}[htb] 152 | \centering 153 | \includegraphics[width=\linewidth]{example-fig.pdf} 154 | \caption{图片说明 *字体为小 5 号,图片应为黑白图,图中的子图要有子图说明*} 155 | \end{figure} 156 | 157 | \begin{table}[htb] 158 | \centering 159 | \caption{表说明 *表说明采用黑体*} 160 | \small 161 | \begin{tabular}{cc} 162 | \toprule 163 | 示例表格 & 第一行为表头,表头要有内容 \\ 164 | \midrule 165 | & \\ 166 | \midrule 167 | & \\ 168 | \bottomrule 169 | \end{tabular} 170 | \end{table} 171 | 172 | % \begin{procedure} 173 | % 定理内容。 174 | % “定义”、“假设”、“公理”、“引理”等的排版格式与此相同,详细定理证明、公式可放在附录中。 175 | % \end{procedure} 176 | 177 | % \begin{algorithm} 178 | % 定理内容。 179 | % “定义”、“假设”、“公理”、“引理”等的排版格式与此相同,详细定理证明、公式可放在附录中。 180 | % \end{algorithm} 181 | 182 | 183 | 184 | \section*{致谢} 185 | 186 | 致谢内容。 187 | 188 | 189 | \nocite{*} 190 | 191 | \bibliographystyle{cjc} 192 | \bibliography{refs} 193 | 194 | 195 | 196 | \appendix 197 | 198 | \section{} 199 | 200 | 附录内容置于此处,字体为小5号宋体。附录内容包括:详细的定理证明、公式推导、原始数据等 201 | 202 | 203 | 204 | % \begin{background} 205 | % *论文背景介绍为英文,字体为小5号Times New Roman体* 206 | 207 | % 论文后面为400单词左右的英文背景介绍。介绍的内容包括: 208 | 209 | % 本文研究的问题属于哪一个领域的什么问题。该类问题目前国际上解决到什么程度。 210 | 211 | % 本文将问题解决到什么程度。 212 | 213 | % 课题所属的项目。 214 | 215 | % 项目的意义。 216 | 217 | % 本研究群体以往在这个方向上的研究成果。 218 | 219 | % 本文的成果是解决大课题中的哪一部分,如果涉及863/973以及其项目、基金、研究计划,注意这些项目的英文名称应书写正确。 220 | % \end{background} 221 | 222 | \end{document} 223 | -------------------------------------------------------------------------------- /refs.bib: -------------------------------------------------------------------------------- 1 | @article{article_example, 2 | author = {作者}, 3 | title = {题目}, 4 | journal = {刊名(全称)}, 5 | year = {年}, 6 | number = {卷}, 7 | volume = {期}, 8 | pages = {页码}, 9 | } 10 | 11 | @inproceedings{inproceedings_example, 12 | author = {作者}, 13 | title = {文章题目}, 14 | booktitle = {Proceedings of the ... (会议名称)}, 15 | address = {会议召开城市, 会议召开城市所在国家}, 16 | year = {年}, 17 | pages = {页码}, 18 | } 19 | 20 | @incollection{incollection_example, 21 | author = {作者}, 22 | title = {文章题目}, 23 | editor = {编者}, 24 | booktitle = {文集标题}, 25 | address = {出版地}, 26 | publisher = {出版社}, 27 | year = {出版年}, 28 | pages = {页码}, 29 | } 30 | 31 | @book{book_example, 32 | author = {作者}, 33 | title = {书名}, 34 | edition = {版次(初版不写)}, 35 | address = {出版社地点}, 36 | publisher = {出版社}, 37 | year = {出版年}, 38 | } 39 | 40 | @phdthesis{phdthesis_example, 41 | author = {作者}, 42 | title = {文章题目}, 43 | school = {单位名称}, 44 | address = {单位地点}, 45 | year = {年}, 46 | } 47 | 48 | @mastersthesis{mastersthesis_example, 49 | author = {作者}, 50 | title = {文章题目}, 51 | school = {单位名称}, 52 | address = {单位地点}, 53 | year = {年}, 54 | } 55 | 56 | @techreport{techreport_example, 57 | author = {作者}, 58 | title = {文章题目}, 59 | address = {单位地点}, 60 | institution = {单位}, 61 | number = {报告编号}, 62 | year = {年}, 63 | } 64 | 65 | @patent{patent_example, 66 | author = {专利拥有人}, 67 | title = {专利名称, 专利授权国家}, 68 | date = {专利授权日期}, 69 | } 70 | --------------------------------------------------------------------------------