From cac1f99f7d65e4d3c8bc7575c30f6b1bc605a683 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 12 Sep 2021 03:05:00 +0000 Subject: CTAN sync 202109120304 --- macros/unicodetex/latex/njuthesis/LICENSE | 415 +++++++++++++++++++++ macros/unicodetex/latex/njuthesis/README.md | 29 ++ .../unicodetex/latex/njuthesis/figure/njulogo.pdf | Bin 0 -> 21738 bytes .../latex/njuthesis/figure/njuname-large.jpg | Bin 0 -> 817068 bytes .../unicodetex/latex/njuthesis/figure/njuname.pdf | Bin 0 -> 12747 bytes macros/unicodetex/latex/njuthesis/njuthesis.cls | 96 +++++ macros/unicodetex/latex/njuthesis/njuthesis.pdf | Bin 0 -> 1468177 bytes .../latex/njuthesis/profile/abstract.sty | 136 +++++++ .../latex/njuthesis/profile/components.sty | 173 +++++++++ .../unicodetex/latex/njuthesis/profile/cover.sty | 251 +++++++++++++ macros/unicodetex/latex/njuthesis/profile/font.sty | 219 +++++++++++ .../latex/njuthesis/profile/packages.sty | 71 ++++ macros/unicodetex/latex/njuthesis/profile/page.sty | 54 +++ .../latex/njuthesis/profile/reference.sty | 68 ++++ 14 files changed, 1512 insertions(+) create mode 100644 macros/unicodetex/latex/njuthesis/LICENSE create mode 100644 macros/unicodetex/latex/njuthesis/README.md create mode 100644 macros/unicodetex/latex/njuthesis/figure/njulogo.pdf create mode 100644 macros/unicodetex/latex/njuthesis/figure/njuname-large.jpg create mode 100644 macros/unicodetex/latex/njuthesis/figure/njuname.pdf create mode 100644 macros/unicodetex/latex/njuthesis/njuthesis.cls create mode 100644 macros/unicodetex/latex/njuthesis/njuthesis.pdf create mode 100644 macros/unicodetex/latex/njuthesis/profile/abstract.sty create mode 100644 macros/unicodetex/latex/njuthesis/profile/components.sty create mode 100644 macros/unicodetex/latex/njuthesis/profile/cover.sty create mode 100644 macros/unicodetex/latex/njuthesis/profile/font.sty create mode 100644 macros/unicodetex/latex/njuthesis/profile/packages.sty create mode 100644 macros/unicodetex/latex/njuthesis/profile/page.sty create mode 100644 macros/unicodetex/latex/njuthesis/profile/reference.sty (limited to 'macros/unicodetex') diff --git a/macros/unicodetex/latex/njuthesis/LICENSE b/macros/unicodetex/latex/njuthesis/LICENSE new file mode 100644 index 0000000000..4db9b5af29 --- /dev/null +++ b/macros/unicodetex/latex/njuthesis/LICENSE @@ -0,0 +1,415 @@ +The LaTeX Project Public License +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +LPPL Version 1.3c 2008-05-04 + +Copyright 1999 2002-2008 LaTeX3 Project + Everyone is allowed to distribute verbatim copies of this + license document, but modification of it is not allowed. + + +PREAMBLE +======== + +The LaTeX Project Public License (LPPL) is the primary license under +which the LaTeX kernel and the base LaTeX packages are distributed. + +You may use this license for any work of which you hold the copyright +and which you wish to distribute. This license may be particularly +suitable if your work is TeX-related (such as a LaTeX package), but +it is written in such a way that you can use it even if your work is +unrelated to TeX. + +The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', +below, gives instructions, examples, and recommendations for authors +who are considering distributing their works under this license. + +This license gives conditions under which a work may be distributed +and modified, as well as conditions under which modified versions of +that work may be distributed. + +We, the LaTeX3 Project, believe that the conditions below give you +the freedom to make and distribute modified versions of your work +that conform with whatever technical specifications you wish while +maintaining the availability, integrity, and reliability of +that work. If you do not see how to achieve your goal while +meeting these conditions, then read the document `cfgguide.tex' +and `modguide.tex' in the base LaTeX distribution for suggestions. + + +DEFINITIONS +=========== + +In this license document the following terms are used: + + `Work' + Any work being distributed under this License. + + `Derived Work' + Any work that under any applicable law is derived from the Work. + + `Modification' + Any procedure that produces a Derived Work under any applicable + law -- for example, the production of a file containing an + original file associated with the Work or a significant portion of + such a file, either verbatim or with modifications and/or + translated into another language. + + `Modify' + To apply any procedure that produces a Derived Work under any + applicable law. + + `Distribution' + Making copies of the Work available from one person to another, in + whole or in part. Distribution includes (but is not limited to) + making any electronic components of the Work accessible by + file transfer protocols such as FTP or HTTP or by shared file + systems such as Sun's Network File System (NFS). + + `Compiled Work' + A version of the Work that has been processed into a form where it + is directly usable on a computer system. This processing may + include using installation facilities provided by the Work, + transformations of the Work, copying of components of the Work, or + other activities. Note that modification of any installation + facilities provided by the Work constitutes modification of the Work. + + `Current Maintainer' + A person or persons nominated as such within the Work. If there is + no such explicit nomination then it is the `Copyright Holder' under + any applicable law. + + `Base Interpreter' + A program or process that is normally needed for running or + interpreting a part or the whole of the Work. + + A Base Interpreter may depend on external components but these + are not considered part of the Base Interpreter provided that each + external component clearly identifies itself whenever it is used + interactively. Unless explicitly specified when applying the + license to the Work, the only applicable Base Interpreter is a + `LaTeX-Format' or in the case of files belonging to the + `LaTeX-format' a program implementing the `TeX language'. + + + +CONDITIONS ON DISTRIBUTION AND MODIFICATION +=========================================== + +1. Activities other than distribution and/or modification of the Work +are not covered by this license; they are outside its scope. In +particular, the act of running the Work is not restricted and no +requirements are made concerning any offers of support for the Work. + +2. You may distribute a complete, unmodified copy of the Work as you +received it. Distribution of only part of the Work is considered +modification of the Work, and no right to distribute such a Derived +Work may be assumed under the terms of this clause. + +3. You may distribute a Compiled Work that has been generated from a +complete, unmodified copy of the Work as distributed under Clause 2 +above, as long as that Compiled Work is distributed in such a way that +the recipients may install the Compiled Work on their system exactly +as it would have been installed if they generated a Compiled Work +directly from the Work. + +4. If you are the Current Maintainer of the Work, you may, without +restriction, modify the Work, thus creating a Derived Work. You may +also distribute the Derived Work without restriction, including +Compiled Works generated from the Derived Work. Derived Works +distributed in this manner by the Current Maintainer are considered to +be updated versions of the Work. + +5. If you are not the Current Maintainer of the Work, you may modify +your copy of the Work, thus creating a Derived Work based on the Work, +and compile this Derived Work, thus creating a Compiled Work based on +the Derived Work. + +6. If you are not the Current Maintainer of the Work, you may +distribute a Derived Work provided the following conditions are met +for every component of the Work unless that component clearly states +in the copyright notice that it is exempt from that condition. Only +the Current Maintainer is allowed to add such statements of exemption +to a component of the Work. + + a. If a component of this Derived Work can be a direct replacement + for a component of the Work when that component is used with the + Base Interpreter, then, wherever this component of the Work + identifies itself to the user when used interactively with that + Base Interpreter, the replacement component of this Derived Work + clearly and unambiguously identifies itself as a modified version + of this component to the user when used interactively with that + Base Interpreter. + + b. Every component of the Derived Work contains prominent notices + detailing the nature of the changes to that component, or a + prominent reference to another file that is distributed as part + of the Derived Work and that contains a complete and accurate log + of the changes. + + c. No information in the Derived Work implies that any persons, + including (but not limited to) the authors of the original version + of the Work, provide any support, including (but not limited to) + the reporting and handling of errors, to recipients of the + Derived Work unless those persons have stated explicitly that + they do provide such support for the Derived Work. + + d. You distribute at least one of the following with the Derived Work: + + 1. A complete, unmodified copy of the Work; + if your distribution of a modified component is made by + offering access to copy the modified component from a + designated place, then offering equivalent access to copy + the Work from the same or some similar place meets this + condition, even though third parties are not compelled to + copy the Work along with the modified component; + + 2. Information that is sufficient to obtain a complete, + unmodified copy of the Work. + +7. If you are not the Current Maintainer of the Work, you may +distribute a Compiled Work generated from a Derived Work, as long as +the Derived Work is distributed to all recipients of the Compiled +Work, and as long as the conditions of Clause 6, above, are met with +regard to the Derived Work. + +8. The conditions above are not intended to prohibit, and hence do not +apply to, the modification, by any method, of any component so that it +becomes identical to an updated version of that component of the Work as +it is distributed by the Current Maintainer under Clause 4, above. + +9. Distribution of the Work or any Derived Work in an alternative +format, where the Work or that Derived Work (in whole or in part) is +then produced by applying some process to that format, does not relax or +nullify any sections of this license as they pertain to the results of +applying that process. + +10. a. A Derived Work may be distributed under a different license + provided that license itself honors the conditions listed in + Clause 6 above, in regard to the Work, though it does not have + to honor the rest of the conditions in this license. + + b. If a Derived Work is distributed under a different license, that + Derived Work must provide sufficient documentation as part of + itself to allow each recipient of that Derived Work to honor the + restrictions in Clause 6 above, concerning changes from the Work. + +11. This license places no restrictions on works that are unrelated to +the Work, nor does this license place any restrictions on aggregating +such works with the Work by any means. + +12. Nothing in this license is intended to, or may be used to, prevent +complete compliance by all parties with all applicable laws. + + +NO WARRANTY +=========== + +There is no warranty for the Work. Except when otherwise stated in +writing, the Copyright Holder provides the Work `as is', without +warranty of any kind, either expressed or implied, including, but not +limited to, the implied warranties of merchantability and fitness for a +particular purpose. The entire risk as to the quality and performance +of the Work is with you. Should the Work prove defective, you assume +the cost of all necessary servicing, repair, or correction. + +In no event unless required by applicable law or agreed to in writing +will The Copyright Holder, or any author named in the components of the +Work, or any other party who may distribute and/or modify the Work as +permitted above, be liable to you for damages, including any general, +special, incidental or consequential damages arising out of any use of +the Work or out of inability to use the Work (including, but not limited +to, loss of data, data being rendered inaccurate, or losses sustained by +anyone as a result of any failure of the Work to operate with any other +programs), even if the Copyright Holder or said author or said other +party has been advised of the possibility of such damages. + + +MAINTENANCE OF THE WORK +======================= + +The Work has the status `author-maintained' if the Copyright Holder +explicitly and prominently states near the primary copyright notice in +the Work that the Work can only be maintained by the Copyright Holder +or simply that it is `author-maintained'. + +The Work has the status `maintained' if there is a Current Maintainer +who has indicated in the Work that they are willing to receive error +reports for the Work (for example, by supplying a valid e-mail +address). It is not required for the Current Maintainer to acknowledge +or act upon these error reports. + +The Work changes from status `maintained' to `unmaintained' if there +is no Current Maintainer, or the person stated to be Current +Maintainer of the work cannot be reached through the indicated means +of communication for a period of six months, and there are no other +significant signs of active maintenance. + +You can become the Current Maintainer of the Work by agreement with +any existing Current Maintainer to take over this role. + +If the Work is unmaintained, you can become the Current Maintainer of +the Work through the following steps: + + 1. Make a reasonable attempt to trace the Current Maintainer (and + the Copyright Holder, if the two differ) through the means of + an Internet or similar search. + + 2. If this search is successful, then enquire whether the Work + is still maintained. + + a. If it is being maintained, then ask the Current Maintainer + to update their communication data within one month. + + b. If the search is unsuccessful or no action to resume active + maintenance is taken by the Current Maintainer, then announce + within the pertinent community your intention to take over + maintenance. (If the Work is a LaTeX work, this could be + done, for example, by posting to comp.text.tex.) + + 3a. If the Current Maintainer is reachable and agrees to pass + maintenance of the Work to you, then this takes effect + immediately upon announcement. + + b. If the Current Maintainer is not reachable and the Copyright + Holder agrees that maintenance of the Work be passed to you, + then this takes effect immediately upon announcement. + + 4. If you make an `intention announcement' as described in 2b. above + and after three months your intention is challenged neither by + the Current Maintainer nor by the Copyright Holder nor by other + people, then you may arrange for the Work to be changed so as + to name you as the (new) Current Maintainer. + + 5. If the previously unreachable Current Maintainer becomes + reachable once more within three months of a change completed + under the terms of 3b) or 4), then that Current Maintainer must + become or remain the Current Maintainer upon request provided + they then update their communication data within one month. + +A change in the Current Maintainer does not, of itself, alter the fact +that the Work is distributed under the LPPL license. + +If you become the Current Maintainer of the Work, you should +immediately provide, within the Work, a prominent and unambiguous +statement of your status as Current Maintainer. You should also +announce your new status to the same pertinent community as +in 2b) above. + + +WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE +====================================================== + +This section contains important instructions, examples, and +recommendations for authors who are considering distributing their +works under this license. These authors are addressed as `you' in +this section. + +Choosing This License or Another License +---------------------------------------- + +If for any part of your work you want or need to use *distribution* +conditions that differ significantly from those in this license, then +do not refer to this license anywhere in your work but, instead, +distribute your work under a different license. You may use the text +of this license as a model for your own license, but your license +should not refer to the LPPL or otherwise give the impression that +your work is distributed under the LPPL. + +The document `modguide.tex' in the base LaTeX distribution explains +the motivation behind the conditions of this license. It explains, +for example, why distributing LaTeX under the GNU General Public +License (GPL) was considered inappropriate. Even if your work is +unrelated to LaTeX, the discussion in `modguide.tex' may still be +relevant, and authors intending to distribute their works under any +license are encouraged to read it. + +A Recommendation on Modification Without Distribution +----------------------------------------------------- + +It is wise never to modify a component of the Work, even for your own +personal use, without also meeting the above conditions for +distributing the modified component. While you might intend that such +modifications will never be distributed, often this will happen by +accident -- you may forget that you have modified that component; or +it may not occur to you when allowing others to access the modified +version that you are thus distributing it and violating the conditions +of this license in ways that could have legal implications and, worse, +cause problems for the community. It is therefore usually in your +best interest to keep your copy of the Work identical with the public +one. Many works provide ways to control the behavior of that work +without altering any of its licensed components. + +How to Use This License +----------------------- + +To use this license, place in each of the components of your work both +an explicit copyright notice including your name and the year the work +was authored and/or last substantially modified. Include also a +statement that the distribution and/or modification of that +component is constrained by the conditions in this license. + +Here is an example of such a notice and statement: + + %% pig.dtx + %% Copyright 2005 M. Y. Name + % + % This work may be distributed and/or modified under the + % conditions of the LaTeX Project Public License, either version 1.3 + % of this license or (at your option) any later version. + % The latest version of this license is in + % http://www.latex-project.org/lppl.txt + % and version 1.3 or later is part of all distributions of LaTeX + % version 2005/12/01 or later. + % + % This work has the LPPL maintenance status `maintained'. + % + % The Current Maintainer of this work is M. Y. Name. + % + % This work consists of the files pig.dtx and pig.ins + % and the derived file pig.sty. + +Given such a notice and statement in a file, the conditions +given in this license document would apply, with the `Work' referring +to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being +generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' +referring to any `LaTeX-Format', and both `Copyright Holder' and +`Current Maintainer' referring to the person `M. Y. Name'. + +If you do not want the Maintenance section of LPPL to apply to your +Work, change `maintained' above into `author-maintained'. +However, we recommend that you use `maintained', as the Maintenance +section was added in order to ensure that your Work remains useful to +the community even when you can no longer maintain and support it +yourself. + +Derived Works That Are Not Replacements +--------------------------------------- + +Several clauses of the LPPL specify means to provide reliability and +stability for the user community. They therefore concern themselves +with the case that a Derived Work is intended to be used as a +(compatible or incompatible) replacement of the original Work. If +this is not the case (e.g., if a few lines of code are reused for a +completely different task), then clauses 6b and 6d shall not apply. + + +Important Recommendations +------------------------- + + Defining What Constitutes the Work + + The LPPL requires that distributions of the Work contain all the + files of the Work. It is therefore important that you provide a + way for the licensee to determine which files constitute the Work. + This could, for example, be achieved by explicitly listing all the + files of the Work near the copyright notice of each file or by + using a line such as: + + % This work consists of all files listed in manifest.txt. + + in that place. In the absence of an unequivocal list it might be + impossible for the licensee to determine what is considered by you + to comprise the Work and, in such a case, the licensee would be + entitled to make reasonable conjectures as to which files comprise + the Work. diff --git a/macros/unicodetex/latex/njuthesis/README.md b/macros/unicodetex/latex/njuthesis/README.md new file mode 100644 index 0000000000..d7c4cb33aa --- /dev/null +++ b/macros/unicodetex/latex/njuthesis/README.md @@ -0,0 +1,29 @@ +# NJU Thesis + +[![njuthesis](https://img.shields.io/badge/njuthesis-latex-blue)](https://git.nju.edu.cn/nju-lug/nju-latex-templates) +[![overleaf](https://img.shields.io/badge/overleaf-supported-brightgreen)](https://tex.nju.edu.cn) + +## Overview + +This is A LaTex Template for Nanjing University Bachelor Thesis. The Template needs `xelatex` or `lualatex`. + +## License + +----- + This work may be distributed and/or modified under the conditions of + the [LaTeX Project Public License](http://www.latex-project.org/lppl.txt), + either version 1.3c of this license or (at your option) any later + version. +----- + +## Contributing + +If you find a problem with the template, please submit an issue or PR in Github + +## Wiki + +Please see [Chinese wiki](https://github.com/nju-lug/NJUThesis/wiki)。 + +----- + +Copyright © NJU-LUG diff --git a/macros/unicodetex/latex/njuthesis/figure/njulogo.pdf b/macros/unicodetex/latex/njuthesis/figure/njulogo.pdf new file mode 100644 index 0000000000..a298271f5b Binary files /dev/null and b/macros/unicodetex/latex/njuthesis/figure/njulogo.pdf differ diff --git a/macros/unicodetex/latex/njuthesis/figure/njuname-large.jpg b/macros/unicodetex/latex/njuthesis/figure/njuname-large.jpg new file mode 100644 index 0000000000..b69db06921 Binary files /dev/null and b/macros/unicodetex/latex/njuthesis/figure/njuname-large.jpg differ diff --git a/macros/unicodetex/latex/njuthesis/figure/njuname.pdf b/macros/unicodetex/latex/njuthesis/figure/njuname.pdf new file mode 100644 index 0000000000..150958a0ec Binary files /dev/null and b/macros/unicodetex/latex/njuthesis/figure/njuname.pdf differ diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.cls b/macros/unicodetex/latex/njuthesis/njuthesis.cls new file mode 100644 index 0000000000..d8d8f57f3a --- /dev/null +++ b/macros/unicodetex/latex/njuthesis/njuthesis.cls @@ -0,0 +1,96 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesExplClass{njuthesis}{2021-09-11}{0.7.3}{NJU Thesis LaTeX Template} + +% 通过类传递参数 +\RequirePackage{l3keys2e} + +\LoadClass[ + a4paper, + twoside, + UTF8, + scheme=chinese, + linespread=1.625,% laTex默认1.2行距,word默认行距是1.3,要求1.5倍word行距,故1.5/1.2*1.3 = 1.625 + fontset=none, + zihao=-4 + ]{ctexbook}[2018/04/01] + +% 定义模板键值 +% 用于格式控制的键值 +\keys_define:nn { nju } +{ + titlelength .int_set:N = \nju_titlelength, + titlelength .initial:n = 1, + + secondmentor .bool_set:N = \nju_second_mentor, + secondmentor .initial:n = false, + + degree .tl_set:N = \nju_degree, + degree .initial:n = UG, + + type .tl_set:N = \nju_type, + type .initial:n = thesis, + + systemfont .bool_set:N = \nju_systemfont, + systemfont .initial:n = true, + + customlatinfont .tl_set:N = \nju_customlatinfont, + customlatinfont .initial:n = windows, + + customchinesefont .tl_set:N = \nju_customchinesefont, + customchinesefont .initial:n = windows, + + info .meta:nn = { nju / info } { #1 } +} + +\keys_define:nn { nju / info } +{ + % 题目 + TitleA .tl_set:N = \nju_title_a, + TitleB .tl_set:N = \nju_title_b, + TitleC .tl_set:N = \nju_title_c, + TitleEN .tl_set:N = \nju_title_en, + + % 年级学号姓名 + Grade .tl_set:N = \nju_grade, + StudentID .tl_set:N = \nju_student_id, + StudentName .tl_set:N = \nju_student_name, + StudentNameEN .tl_set:N = \nju_student_name_en, + + % 院系专业方向 + Department .tl_set:N = \nju_department, + DepartmentEN .tl_set:N = \nju_department_en, + Major .tl_set:N = \nju_major, + MajorEN .tl_set:N = \nju_major_en, + Field .tl_set:N = \nju_field, + FieldEN .tl_set:N = \nju_field_en, + + % 导师 + MentorA .tl_set:N = \nju_mentor_a, + MentorAEN .tl_set:N = \nju_mentor_a_en, + MentorATitle .tl_set:N = \nju_mentor_a_title, + MentorATitleEN .tl_set:N = \nju_mentor_a_title_en, + + % 第二导师 + MentorB .tl_set:N = \nju_mentor_b, + MentorBEN .tl_set:N = \nju_mentor_b_en, + MentorBTitle .tl_set:N = \nju_mentor_b_title, + MentorBTitleEN .tl_set:N = \nju_mentor_b_title_en, + + % 日期 + SubmitDate .tl_set:N = \nju_submit_date, + DefenseDate .tl_set:N = \nju_defense_date, +} + +\NewDocumentCommand \njusetup { m } +{ \keys_set:nn { nju } { #1 } } + +\ProcessKeysOptions { nju } + +% 输入配置文件 +\RequirePackage{profile/packages} +\RequirePackage{profile/font} +\RequirePackage{profile/page} +\RequirePackage{profile/reference} +\RequirePackage{profile/components} +\RequirePackage{profile/cover} +\RequirePackage{profile/abstract} diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.pdf b/macros/unicodetex/latex/njuthesis/njuthesis.pdf new file mode 100644 index 0000000000..11b1922dea Binary files /dev/null and b/macros/unicodetex/latex/njuthesis/njuthesis.pdf differ diff --git a/macros/unicodetex/latex/njuthesis/profile/abstract.sty b/macros/unicodetex/latex/njuthesis/profile/abstract.sty new file mode 100644 index 0000000000..37814cef13 --- /dev/null +++ b/macros/unicodetex/latex/njuthesis/profile/abstract.sty @@ -0,0 +1,136 @@ +\ProvidesExplPackage{profile/abstract}{2021-09-11}{0.7.0}{NJU Thesis abstract design} + +% 判断学位 +\str_if_eq:eeTF {\nju_degree} { ug } +{ + % 本科摘要环境 + \NewDocumentEnvironment{abstract} {} + {% + \pagestyle{plain} + \pagenumbering{Roman} + % \phantomsection\addcontentsline{toc}{chapter}{中文摘要} % 将摘要插入目录和pdf书签 + \pdfbookmark[0]{中文摘要}{中文摘要} % 将摘要插入pdf书签,与上一行不可共存 + \begin{center} + \kaishu\zihao{-2}{\textbf{\uuline{南京大学本科生毕业论文(设计、作品)中文摘要}}} + \end{center} + {\bgroup + \kaishu\zihao{-4} + \tl_set:Nn \tabcolsep {0pt} + \tl_set:Nn \arraystretch {0.8} + \noindent + 题目: \nju_title \\ + 院系: \nju_department \\ + 专业: \nju_major \\ + 本科生姓名: \nju_student_name \\ + 指导教师(姓名、职称):\nju_mentor_full \\ + 摘要: + \egroup + } + \kaishu\zihao{-4}\par% + }{% + \newpage + } + + % 中文关键词 + \NewDocumentCommand \keywords {m} {% + \par\vspace{2ex}\noindent% + {\kaishu\zihao{-4}\makebox[4em][s]{关键词{:}}}~{#1}% + } + + % 英文摘要 + \NewDocumentEnvironment{englishabstract} {} + {% + \pagestyle{plain} + % \phantomsection\addcontentsline{toc}{chapter}{英文摘要} % 将摘要插入目录和pdf书签 + \pdfbookmark[0]{英文摘要}{英文摘要} % 将摘要插入pdf书签,与上一行不可共存 + \begin{center} + \kaishu\zihao{-2}{\textbf{\uuline{南京大学本科生毕业论文(设计、作品)英文摘要}}} + \end{center} + { + \bgroup + THESIS: ~~\nju_title_en \\ + DEPARTMENT: ~~\nju_department_en \\ + SPECIALIZATION: ~~\nju_major_en \\ + UNDERGRADUATE:~~\nju_student_name_en \\ + MENTOR:~~\nju_mentor_full_en \\ + ABSTRACT: + \egroup + } + \zihao{-4}\par% + }{% + \cleardoublepage + \newpage + } + + % 英文关键词 + \NewDocumentCommand \englishkeywords {m} {% + \par\vspace{2ex}\noindent% + {KEYWORDS{:}}~~{#1}% + } +} +{ + % 摘要环境 + \NewDocumentEnvironment{abstract} {} + {% + \pagestyle{plain} + \pagenumbering{Roman} + % \phantomsection\addcontentsline{toc}{chapter}{中文摘要} % 将摘要插入目录和pdf书签 + \pdfbookmark[0]{中文摘要}{中文摘要} % 将摘要插入pdf书签,与上一行不可共存 + \begin{center} + \kaishu\zihao{-2}{\textbf{\uuline{南京大学研究生毕业论文中文摘要首页用纸}}} + \end{center} + + \bgroup + \kaishu\zihao{4} + \tl_set:Nn \tabcolsep {0pt} + \tl_set:Nn \arraystretch {0.8} + \noindent + % 毕业论文题目:\ \uline{\nju_title} \\ % 下划线有问题 + 毕业论文题目:\ \nju_title \\ + \uline{\makebox[9em]{\nju_major}}专业\uline{\makebox[3em]{\nju_grade}}级 + \str_if_eq:eeTF {\nju_degree} { d } {博}{硕} + 士生姓名:\uline{\hfill\nju_student_name\hfill} \\ + 指导教师(姓名、职称):\uline{\hfill\nju_mentor_full\hfill}\par + \egroup + + \kaishu\zihao{4}\par% + }{% + \newpage + } + + % 中文关键词 + \NewDocumentCommand \keywords {m} {% + \par\vspace{2ex}\noindent% + {\kaishu\zihao{4}\makebox[4em][s]{关键词{:}}}~{#1}% + } + + % 英文摘要 + \NewDocumentEnvironment{englishabstract} {} + {% + \pagestyle{plain} + % \phantomsection\addcontentsline{toc}{chapter}{英文摘要} % 将摘要插入目录和pdf书签 + \pdfbookmark[0]{英文摘要}{英文摘要} % 将摘要插入pdf书签,与上一行不可共存 + \begin{center} + \kaishu\zihao{-2}{\textbf{\uuline{南京大学研究生毕业论文英文摘要首页用纸}}} + \end{center} + { + \bgroup + \zihao{4} + THESIS: ~~\nju_title_en \\ + SPECIALIZATION: ~~\nju_major_en \\ + POSTGRADUATE:~~\nju_student_name_en \\ + MENTOR:~~\nju_mentor_full_en\par + \egroup + } + \zihao{4}\par% + }{% + \cleardoublepage + \newpage + } + + % 英文关键词 + \NewDocumentCommand \englishkeywords {m} {% + \par\vspace{2ex}\noindent% + {KEYWORDS{:}}~~{#1}% + } +} diff --git a/macros/unicodetex/latex/njuthesis/profile/components.sty b/macros/unicodetex/latex/njuthesis/profile/components.sty new file mode 100644 index 0000000000..4a24fe4f59 --- /dev/null +++ b/macros/unicodetex/latex/njuthesis/profile/components.sty @@ -0,0 +1,173 @@ +\ProvidesExplPackage{profile/components}{2021-09-11}{0.6.0}{NJU Thesis components configuration} + +% 图表位置调整 +\floatsetup[lstlisting]{ % Captions for lstlistings + capposition=above,% + margins=centering,% + floatwidth=\textwidth% +} +\floatsetup[figure]{ % Captions for figures + capposition=bottom,% + margins=centering,% + floatwidth=\textwidth% +} +\floatsetup[table]{ % Captions for tables + capposition=above,% + margins=centering,% + floatwidth=\textwidth% +} + +% 代码样式 +\lstset{ + basicstyle=\ttfamily\linespread{1}\small\selectfont, + keywordstyle=\bfseries,% use bold style for keywords + commentstyle=\rmfamily\itshape,% use italic style for comments + stringstyle=\ttfamily,% 字符串风格 + flexiblecolumns,% ? + numbers=left,% left-aligned numbering + showspaces=false,% hide markers for spaces + showstringspaces=false, + captionpos=t,% place the caption at the top + % frame=lrtb,% show all four sides of the frame + % linewidth=.8\textwidth, + % breakatwhitespace=true, + breaklines=true, + xleftmargin=2em,xrightmargin=2em,% set the width of the code environment +} + +\lstdefinestyle{LaTeX}{ + language=TeX, + morekeywords={begin, caption, label, mathrm, frac, toprule, midrule, bottomrule, includegraphics} +} + +% 图表标题样式 +\DeclareCaptionFont{songticap}{\zihao{5}\bf\songti} +\captionsetup{ + font=small,% + labelfont=songticap, + textfont=songticap, + strut=no,% + hypcap=true, % Links point to the top of the figure + % indention=0pt, % Suppress indentation + % % parindent=0pt, % Suppress space between paragraphs + aboveskip=6pt, % Increase the space between the figure and the caption + belowskip=6pt, % Increase the space between the caption and the table +} + +% list configuration +\renewcommand{\labelitemi}{\tiny$\blacktriangleright$} +\renewcommand{\labelitemii}{\textbullet} + +\setlist[itemize]{noitemsep} +\setlist[enumerate]{noitemsep} +\setlist[description]{noitemsep} + +% 数学环境 +\declaretheoremstyle[ + %spaceabove=.5\thm@preskip, + %spacebelow=.5\thm@postskip, + headfont=\bf\songti,%\scshape, + notefont=\songti,% notebraces={ (}{)}, + bodyfont=\songti, + %headformat={\NAME\space\NUMBER\space\NOTE}, + headpunct={}, + %postheadspace={.5em plus .1em minus .1em}, + %prefoothook={\hfill\qedsymbol} + ]{njuthm} + +\theoremstyle{njuthm} + +\let\oldproofname=\proofname +\renewcommand*{\proofname}{\rm\bf\songti{\oldproofname}} % 修改证明环境标题 + +\declaretheorem[ + name=算法, + style=njuthm, + refname={算法,算法}, + Refname={算法,算法}, + % numberwithin=section, +]{algorithm} +\declaretheorem[ + name=假设, + style=njuthm, + refname={假设,假设}, + Refname={假设,假设}, + % numberwithin=section, +]{assumption} +\declaretheorem[ + name=公理, + style=njuthm, + refname={公理,公理}, + Refname={公理,公理}, + % numberwithin=section, +]{axiom} +\declaretheorem[ + name=结论, + style=njuthm, + refname={结论,结论}, + Refname={结论,结论}, + % numberwithin=section, +]{conclusion} +\declaretheorem[ + name=条件, + style=njuthm, + refname={条件,条件}, + Refname={条件,条件}, + % numberwithin=section, +]{condition} +\declaretheorem[ + name=推论, + style=njuthm, + refname={推论,推论}, + Refname={推论,推论}, + % numberwithin=section, +]{corollary} +\declaretheorem[ + name=定义, + style=njuthm, + refname={定义,定义}, + Refname={定义,定义}, + % numberwithin=section, +]{definition} +\declaretheorem[ + name=例, + style=njuthm, + refname={例,例}, + Refname={例,例}, + % numberwithin=section, +]{example} +\declaretheorem[ + name=引理, + style=njuthm, + refname={引理,引理}, + Refname={引理,引理}, + % numberwithin=section, +]{lemma} +\declaretheorem[ + name=性质, + style=njuthm, + refname={性质,性质}, + Refname={性质,性质}, + % numberwithin=section, +]{property} +\declaretheorem[ + name=命题, + style=njuthm, + refname={命题,命题}, + Refname={命题,命题}, + % numberwithin=section, +]{proposition} +\declaretheorem[ + name=注解, + style=njuthm, + refname={注解,注解}, + Refname={注解,注解}, + % numberwithin=section, +]{remark} +\declaretheorem[ + name=定理, + style=njuthm, + refname={定理,定理}, + Refname={定理,定理}, + numberwithin=section, +]{theorem} diff --git a/macros/unicodetex/latex/njuthesis/profile/cover.sty b/macros/unicodetex/latex/njuthesis/profile/cover.sty new file mode 100644 index 0000000000..8293e64780 --- /dev/null +++ b/macros/unicodetex/latex/njuthesis/profile/cover.sty @@ -0,0 +1,251 @@ +\ProvidesExplPackage{profile/cover}{2021-09-11}{0.7.0}{NJU Thesis cover design} + +% 拼合标题 +\tl_const:Nn \nju_title {\nju_title_a \nju_title_b \nju_title_c} + +% 拼合导师 +\bool_if:NTF \nju_second_mentor +{ + \tl_const:Nn \nju_mentor_full + { + \nju_mentor_a\ \nju_mentor_a_title + \ \ \nju_mentor_b\ \nju_mentor_b_title + } + \tl_const:Nn \nju_mentor_full_en + { + \nju_mentor_a_en\ \nju_mentor_a_title_en + \ \ \nju_mentor_b_en\ \nju_mentor_b_title_en + } +} +{ + \tl_const:Nn \nju_mentor_full + { + \nju_mentor_a\ \nju_mentor_a_title + } + \tl_const:Nn \nju_mentor_full_en + { + \nju_mentor_a_en\ \nju_mentor_a_title_en + } +} + +% 封面下划线 +\cs_new:Npn \nju_cover_underline_ug:nn #1 #2 { + \uline{\makebox[#1]{\rm\songti#2}} +} +\cs_new:Npn \nju_cover_underline_g:n #1 { + \uline{\makebox[215pt]{\rm\kaishu#1}} +} + +% 封面表格边框 +\cs_new:Npn \nju_coverbox_ug:n #1 { + \makebox[4.2em][s]{#1} +} +\cs_new:Npn \nju_coverbox_g:n #1 { + \makebox[6em][s]{#1\hspace{1em}} +} + +% 判断学位 +\str_if_eq:eeTF {\nju_degree} { ug } +{ \tl_const:Nn \nju_degree_name {本\hfill 科\hfill } } % 本科 +{ + % 本科以外都是研究生 + \tl_const:Nn \nju_degree_name {研\hfill 究\hfill 生\hfill } + + % 研究生类别 + \str_case_e:nn { \nju_degree } + { + { mg } { \tl_const:Nn \nju_degree_title {硕士} } + { mf } { \tl_const:Nn \nju_degree_title {硕士专业} } + { d } { \tl_const:Nn \nju_degree_title {博士} } + } +} + +% 判断类型 +\str_if_eq:eeTF {\nju_type} {thesis} +{\tl_const:Nn \nju_type_name {\nju_degree_name 毕\hfill 业\hfill 论\hfill 文}} +{\tl_const:Nn \nju_type_name {\nju_degree_name 毕\hfill 业\hfill 设\hfill 计}} + +% 封面信息栏 本科 +\tl_new:N \nju_printcoverinfo_ug +\tl_set:Nn \nju_printcoverinfo_ug { + \begin{tabular}{p{4.2em}c} + \nju_coverbox_ug:n {院\hfill 系} + & \nju_cover_underline_ug:nn {250pt}{\nju_department}\\ + \nju_coverbox_ug:n {专\hfill 业} + & \nju_cover_underline_ug:nn {250pt}{\nju_major}\\ + + % 标题换行 + \int_case:nn {\nju_titlelength} + { + { 1 } { + \nju_coverbox_ug:n {题\hfill 目} + & \nju_cover_underline_ug:nn {250pt}{\bf{\nju_title_a}} \\ } + { 2 } { + \nju_coverbox_ug:n {题\hfill 目} + & \nju_cover_underline_ug:nn {250pt}{\bf{\nju_title_a}} \\ + & \nju_cover_underline_ug:nn {250pt}{\bf{\nju_title_b}} \\ } + { 3 } { + \nju_coverbox_ug:n {题\hfill 目} + & \nju_cover_underline_ug:nn {250pt}{\bf{\nju_title_a}} \\ + & \nju_cover_underline_ug:nn {250pt}{\bf{\nju_title_b}} \\ + & \nju_cover_underline_ug:nn {250pt}{\bf{\nju_title_c}} \\} + } + \end{tabular}\\ + + \begin{tabular}{p{4.2em}cp{4.2em}c} + \nju_coverbox_ug:n {年\hfill 级} + & \nju_cover_underline_ug:nn {90pt}{\nju_grade} + & \nju_coverbox_ug:n {学\hfill 号} + & \nju_cover_underline_ug:nn {90pt}{\nju_student_id}\\ + \end{tabular}\\ + + \begin{tabular}{p{4.2em}c} + \nju_coverbox_ug:n {学\hfill 生\hfill 姓\hfill 名} + & \nju_cover_underline_ug:nn {250pt}{\nju_student_name} + \end{tabular}\\ + \begin{tabular}{p{4.2em}cp{4.2em}c} + \nju_coverbox_ug:n {导\hfill 师} + & \nju_cover_underline_ug:nn {90pt}{\nju_mentor_a} + & \nju_coverbox_ug:n {职\hfill 称} + & \nju_cover_underline_ug:nn {90pt}{\nju_mentor_a_title}\\ + + % 第二导师 + \bool_if:NTF \nju_second_mentor + { + \nju_coverbox_ug:n {第\hfill 二\hfill 导\hfill 师} + & \nju_cover_underline_ug:nn {90pt}{\nju_mentor_b} + & \nju_coverbox_ug:n {职\hfill 称} + & \nju_cover_underline_ug:nn {90pt}{\nju_mentor_b_title}\\ + } + {} + \end{tabular}\\ + + \begin{tabular}{p{4.2em}c} + \nju_coverbox_ug:n {提\hfill 交\hfill 日\hfill 期} + & \nju_cover_underline_ug:nn {250pt}{\nju_submit_date}\\ + \end{tabular} +} + +% 封面信息栏 研究生 +\tl_new:N \nju_printcoverinfo_g +\tl_set:Nn \nju_printcoverinfo_g { + \begin{tabular}{p{6em}c} + % 标题换行 + \int_case:nn {\nju_titlelength} + { + { 1 } { + \nju_coverbox_g:n {论\hfill 文\hfill 题\hfill 目} + & \nju_cover_underline_g:n {\nju_title_a} \\ } + { 2 } { + \nju_coverbox_g:n {论\hfill 文\hfill 题\hfill 目} + & \nju_cover_underline_g:n {\nju_title_a} \\ + & \nju_cover_underline_g:n {\nju_title_b} \\ } + { 3 } { + \nju_coverbox_g:n {论\hfill 文\hfill 题\hfill 目} + & \nju_cover_underline_g:n {\nju_title_a} \\ + & \nju_cover_underline_g:n {\nju_title_b} \\ + & \nju_cover_underline_g:n {\nju_title_c} \\} + } + + \nju_coverbox_g:n {作\hfill 者\hfill 姓\hfill 名} + & \nju_cover_underline_g:n {\nju_student_name}\\ + \nju_coverbox_g:n {专\hfill 业\hfill 名\hfill 称} + & \nju_cover_underline_g:n {\nju_major}\\ + \nju_coverbox_g:n {研\hfill 究\hfill 方\hfill 向} + & \nju_cover_underline_g:n {\nju_field}\\ + \nju_coverbox_g:n {指\hfill 导\hfill 教\hfill 师} + & \nju_cover_underline_g:n {\nju_mentor_full}\\ + \end{tabular} +} + +% 绘制封面命令 +\tl_new:N \nju_printcover_ug % 本科封面 +\tl_new:N \nju_printcover_g % 研究生封面 + +% 本科封面 +\tl_set:Nn \nju_printcover_ug { + \thispagestyle{empty} + \pagenumbering{Roman} + % Start + \pdfbookmark{封面}{封面} % 将封面插入pdf书签 + \begin{spacing}{1.25} + \vskip 0mm + \hspace{-10mm} + \includegraphics[height=3cm]{njulogo}\smallskip + \begin{center} + \includegraphics[height=3.35cm]{njuname} + \vskip 10mm + {\zihao{1}\makebox[9em][s]{\bf{\songti\nju_type_name}}} + \vfill + \vskip\stretch{0} + {\bgroup + \kaishu\zihao{3} + \def\tabcolsep{1pt} + \def\arraystretch{1.5} + \nju_printcoverinfo_ug % 绘制信息框 + \egroup} + \vfill + \end{center} + \end{spacing} + \cleardoublepage + \vfill + % \newpage +} + +% 研究生封面 +\tl_set:Nn \nju_printcover_g { + \thispagestyle{empty} + \pagenumbering{Roman} + % Start + \pdfbookmark{封面}{封面} % 将封面插入pdf书签 + \begin{spacing}{1.25} + \begin{center} + \hspace{0pt} \vskip 5mm + \includegraphics[height=1.9cm]{njulogo} + \vskip 10mm + \includegraphics[height=1.9cm]{njuname-large} + \vskip 15mm + {\zihao{1}\makebox[10em][s]{\bf{\kaishu\nju_type_name}}} + \vskip 5mm + {\zihao{1}\bf{\kaishu{(申请\nju_degree_title 学位)}}} + \par\vfill + \vskip\stretch{0} + {\bgroup + \bf\kaishu\zihao{3} + \def\tabcolsep{1pt} + \def\arraystretch{1.5} + \vskip 10mm + \nju_printcoverinfo_g % 绘制信息框 + \egroup} + \vfill + \vskip 10mm + \bf\kaishu\zihao{4}\nju_submit_date + \vskip 15mm + \end{center} + \end{spacing} + + \newpage % 封面背面 + \thispagestyle{empty} + \begin{spacing}{1.625} + % TODO: 等待调整格式 + \hspace{0pt} \vfill + {\bgroup + \bf\kaishu\zihao{3} + \makebox[6em][s]{学\hfill 号}:\nju_student_id + \par + \makebox[6em][s]{论文答辩日期}:\nju_defense_date + \par + \makebox[6em][s]{指\hfill 导\hfill 教\hfill 师}:\hspace{50mm}(签字) + \par + \egroup} + \vskip 15mm + \end{spacing} + \cleardoublepage +} + +% 重定义maketitle生成封面 +\RenewDocumentCommand \maketitle {} {% + \str_if_eq:eeTF {\nju_degree} { ug } + { \nju_printcover_ug } % 本科封面 + { \nju_printcover_g } % 研究生封面 +} diff --git a/macros/unicodetex/latex/njuthesis/profile/font.sty b/macros/unicodetex/latex/njuthesis/profile/font.sty new file mode 100644 index 0000000000..d939fb4842 --- /dev/null +++ b/macros/unicodetex/latex/njuthesis/profile/font.sty @@ -0,0 +1,219 @@ +\ProvidesExplPackage{profile/font}{2021-09-11}{0.7.0}{NJU Thesis font configuration} + +% \RequireXeTeX +% \RequireLuaTeX + +% 设置西文字体 +\NewDocumentCommand\set_latin_fontset_windows{}{ + \setmainfont{Times~New~Roman} + \setsansfont{Arial} + \setmonofont{Courier~New}[Scale=MatchLowercase] +} + +\NewDocumentCommand\set_latin_fontset_macos{}{ + \setmainfont{Times~New~Roman} + \setsansfont{Arial} + \setmonofont{Menlo}[Scale=MatchLowercase] +} + +\NewDocumentCommand\set_latin_fontset_gyre{}{ + \setmainfont{texgyretermes}[ + Extension=.otf, + UprightFont=*-regular, + BoldFont=*-bold, + ItalicFont=*-italic, + BoldItalicFont=*-bolditalic] + \setsansfont{texgyreheros}[ + Extension=.otf, + UprightFont=*-regular, + BoldFont=*-bold, + ItalicFont=*-italic, + BoldItalicFont=*-bolditalic] + \setmonofont{texgyrecursor}[ + Extension=.otf, + UprightFont=*-regular, + BoldFont=*-bold, + ItalicFont=*-italic, + BoldItalicFont=*-bolditalic, + Scale=MatchLowercase, + Ligatures=CommonOff] +} + +% 设置中文字体 +\NewDocumentCommand\set_chinese_fontset_windows{}{ + \setCJKmainfont{SimSun}[ + AutoFakeBold=2.17, + ItalicFont=KaiTi] + \setCJKsansfont{SimHei} + \setCJKmonofont{FangSong} + \setCJKfamilyfont{zhsong}{SimSun}[AutoFakeBold=2.17] + \setCJKfamilyfont{zhhei}{SimHei} + \setCJKfamilyfont{zhfs}{FangSong} + \setCJKfamilyfont{zhkai}{KaiTi}[AutoFakeBold=2.17] + \setCJKfamilyfont{zhnewhei}{Microsoft~YaHei}[BoldFont=Microsoft~YaHei~Bold] +} + +\NewDocumentCommand\set_chinese_fontset_macos{}{ + \msg_redirect_name:nnn {fontspec} {no-script} {info} % 移除 does not contain script "CJK" 警告 + \setCJKmainfont{Songti~SC~Light}[ + BoldFont=Songti~SC~Bold, + ItalicFont=Kaiti~SC, + BoldItalicFont=Kaiti~SC~Bold] + \setCJKsansfont{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium] + \setCJKmonofont{STFangsong} + \setCJKfamilyfont{zhsong}{Songti~SC~Light}[BoldFont=Songti~SC~Bold] + \setCJKfamilyfont{zhhei}{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium] + \setCJKfamilyfont{zhfs}{STFangsong} + \setCJKfamilyfont{zhkai}{Kaiti~SC}[BoldFont=Kaiti~SC~Bold] + \setCJKfamilyfont{zhnewhei}{PingFang~SC} +} + +\NewDocumentCommand\set_chinese_fontset_fandol{}{ + \msg_redirect_name:nnn {fontspec} {no-script} {info} % 移除 does not contain script "CJK" 警告 + \setCJKmainfont{FandolSong-Regular}[ + Extension=.otf, + BoldFont=FandolSong-Bold, + ItalicFont=FandolKai-Regular] + \setCJKsansfont{FandolHei-Regular}[ + Extension=.otf, + BoldFont=FandolHei-Bold] + \setCJKmonofont{FandolFang-Regular}[Extension=.otf] + \setCJKfamilyfont{zhsong}{FandolSong-Regular}[ + Extension=.otf, + BoldFont=FandolSong-Bold] + \setCJKfamilyfont{zhhei}{FandolHei-Regular}[ + Extension=.otf, + BoldFont=FandolHei-Bold] + \setCJKfamilyfont{zhfs}{FandolFang-Regular}[Extension=.otf] + \setCJKfamilyfont{zhkai}{FandolKai-Regular}[ + Extension=.otf, + AutoFakeBold=2.17] +} + +% 方正字符集 +\NewDocumentCommand\set_chinese_fontset_founder{}{ + % FZSSK 方正书宋(简繁扩展) http://www.foundertype.com/index.php/FontInfo/index/id/151 免费商用 + % FZXBSK 方正小标宋(简繁扩展) http://www.foundertype.com/index.php/FontInfo/index/id/164 设计师非商免费 + % FZKTK 方正楷体(简繁扩展) http://www.foundertype.com/index.php/FontInfo/index/id/137 免费商用 + \setCJKmainfont{FZSSK}[ + Extension=.ttf, + BoldFont=FZXBSK, + ItalicFont=FZKTK] + % FZXH1K 方正细黑一(简繁扩展) http://www.foundertype.com/index.php/FontInfo/index/id/161 设计师非商免费 + % FZHTK 方正黑体(简繁扩展) http://www.foundertype.com/index.php/FontInfo/index/id/131 免费商用 + \setCJKsansfont{FZXH1K}[ + Extension=.ttf, + BoldFont=FZHTK] + % FZFSK 方正仿宋(简繁扩展) http://www.foundertype.com/index.php/FontInfo/index/id/128 + \setCJKmonofont{FZFSK}[Extension=.ttf] + + \setCJKfamilyfont{zhsong}{FZSSK}[ + Extension=.ttf, + BoldFont=FZXBSK] + \setCJKfamilyfont{zhhei}{FZHTK}[ + Extension=.ttf, + AutoFakeBold=2.17] + \setCJKfamilyfont{zhfs}{FZFSK}[Extension=.ttf] + \setCJKfamilyfont{zhkai}{FZKTK}[Extension=.ttf] + % FZYouHK_508R 方正悠黑508R(简繁扩展) http://www.foundertype.com/index.php/FontInfo/index/id/244 设计师非商免费 + % FZYouHK_511M 方正悠黑511M(简繁扩展) http://www.foundertype.com/index.php/FontInfo/index/id/244 设计师非商免费 + \setCJKfamilyfont{zhnewhei}{FZYouHK_508R}[ + Extension=.ttf, + BoldFont=FZYouHK_511M] +} + +\NewDocumentCommand\set_chinese_fontset_noto{}{ + % 思源宋体 https://www.google.com/get/noto/#serif-hans + \setCJKmainfont[ + UprightFont=NotoSerifCJKsc-Regular, + BoldFont=NotoSerifCJKsc-Bold, + ItalicFont=NotoSerifCJKsc-Regular, + BoldItalicFont=NotoSerifCJKsc-Bold, + ItalicFeatures=FakeSlant, + BoldItalicFeatures=FakeSlant]{Noto~Serif~CJK~SC} + + % 思源黑体 https://www.google.com/get/noto/#sans-hans + \setCJKsansfont[ + UprightFont=NotoSansCJKsc-Regular, + BoldFont=NotoSansCJKsc-Bold, + ItalicFont=NotoSansCJKsc-Regular, + BoldItalicFont=NotoSansCJKsc-Bold, + ItalicFeatures=FakeSlant, + BoldItalicFeatures=FakeSlant]{Noto~Sans~CJK~SC} + + % 包含于上述思源黑体 + \setCJKmonofont[ + UprightFont=NotoSansMonoCJKsc-Regular, + BoldFont=NotoSansMonoCJKsc-Bold, + ItalicFont=NotoSansMonoCJKsc-Regular, + BoldItalicFont=NotoSansMonoCJKsc-Bold, + ItalicFeatures=FakeSlant, + BoldItalicFeatures=FakeSlant]{Noto~Sans~Mono~SC} + + \setCJKfamilyfont{zhsong}{Noto~Serif~CJK~SC} + \setCJKfamilyfont{zhhei}{Noto~Sans~CJK~SC} + + % 方正楷体、方正仿宋为免费商用字体,且支持CJK字符集 + % 方正仿宋 http://www.foundertype.com/index.php/FontInfo/index/id/128.html + % 方正楷体 http://www.foundertype.com/index.php/FontInfo/index/id/137.html + \setCJKfamilyfont{zhfs}{方正仿宋简体}[AutoFakeBold=2.17] + \setCJKfamilyfont{zhkai}{方正楷体简体}[AutoFakeBold=2.17] +} + +% 字体判断 +\bool_if:NTF \nju_systemfont +% 根据操作系统自动选择相应字体 +{ + % 检测是否是 Windows + \sys_if_platform_windows:TF + { + \set_latin_fontset_windows + \set_chinese_fontset_windows + } + { + % 检测是否是 macOS + \ctex_if_platform_macos:TF + { + \set_latin_fontset_macos + \set_chinese_fontset_macos + } + % 其余系统一律使用自由字体 + { + \set_latin_fontset_gyre + \set_chinese_fontset_fandol + } + } +} +{ + % 如果用户需要自定义字体 + % 此处需要使用\str_case_e而不是\str_case使宏展开为字符串 + \str_case_e:nn { \nju_customlatinfont } + { + { windows } { \set_latin_fontset_windows } + { macos } { \set_latin_fontset_macos } + { gyre } { \set_latin_fontset_gyre } + { null } {} + } + \str_case_e:nn { \nju_customchinesefont } + { + { windows } { \set_chinese_fontset_windows } + { macos } { \set_chinese_fontset_macos } + { gyre } { \set_chinese_fontset_gyre } + { founder } { \set_chinese_fontset_founder } + { noto } { \set_chinese_fontset_noto } + { null } {} + } +} +% 选择其他字体,请确保相应字体已安装 + +% 设置数学字体 (XITS, 或者 STIX, 与 Times New Roman 最为相近) +% \setmathfont{STIXTwoMath-Regular}[Extension = .otf] +\setmathfont{XITSMath-Regular}[ + BoldFont = XITSMath-Bold, + Extension = .otf] + +\NewDocumentCommand\songti{}{\CJKfamily{zhsong}} +\NewDocumentCommand\heiti{}{\CJKfamily{zhhei}} +\NewDocumentCommand\fangsong{}{\CJKfamily{zhfs}} +\NewDocumentCommand\kaishu{}{\CJKfamily{zhkai}} +% \NewDocumentCommand\lishu{}{\CJKfamily{zhli}} diff --git a/macros/unicodetex/latex/njuthesis/profile/packages.sty b/macros/unicodetex/latex/njuthesis/profile/packages.sty new file mode 100644 index 0000000000..029488b787 --- /dev/null +++ b/macros/unicodetex/latex/njuthesis/profile/packages.sty @@ -0,0 +1,71 @@ +\ProvidesExplPackage{profile/packages}{2021-09-11}{0.6.0}{NJU Thesis packages used} + +\RequirePackage{expl3} +\RequirePackage{ifxetex} +\RequirePackage{fontspec} +\RequirePackage[ + top=2.5cm, + bottom=2.5cm, + left=3.2cm, + right=3.2cm +]{geometry} +\RequirePackage{ifthen} +\RequirePackage{xparse} +% \RequirePackage{etoolbox} +\RequirePackage{titlesec} % 修改章节标题功能由CTeX提供 +\RequirePackage{titletoc} +% \RequirePackage{appendix} % 定义附录样式 +\RequirePackage{fancyhdr} % 调整页眉页脚 +\RequirePackage[hyphens]{url} % generate better linebreaks in the url +% \RequirePackage[normalem]{ulem} % 绘制下划线 +% \RequirePackage{soul} % 用不起来 +% \RequirePackage{soulutf8} +\RequirePackage{dashundergaps} +\RequirePackage{setspace} +\RequirePackage{lastpage} +\RequirePackage{emptypage} % 清除空白页的页码 +\RequirePackage{listings} % 代码环境 +\RequirePackage{enumitem} % 用于修改列表环境 +\RequirePackage{caption} +\RequirePackage{floatrow} % 用于图表等页面元素的定位 +\RequirePackage{booktabs} % 用于绘制三线表 +\RequirePackage{multirow} % Cells occupying multiple rows in tables +\RequirePackage{multicol} % Multiple columns in dictionary +\RequirePackage{siunitx} % 用于书写单位符号 +\RequirePackage[version=4]{mhchem} % 用于绘制分子式 +\RequirePackage{hologo} % 用于生成可以被插入书签的LaTeX logo +% \RequirePackage{needspace} % Required to prevent page break right after a sectioning command +% \RequirePackage{xspace} % Better print trailing whitespace +\sys_if_engine_xetex:T{ + \RequirePackage{microtype}} +% \sys_if_engine_luatex:T{ +% \RequirePackage{emoji} +% \setemojifont{Segoe UI Emoji} % For windows. +% % Shipped with the best `grinning-face-with-sweat' support. +% % Use `Apple Color Emoji' for macos +% % or `Noto Color Emoji' if you prefer. +% } + +\RequirePackage{blindtext} % 生成用于测试的大段无意义英文文字 +\RequirePackage{zhlipsum} % 生成用于测试的大段无意义中文文字 +% \RequirePackage{showframe} % 加载以后展示内容边界 + +\RequirePackage{amsmath} % Must be loaded before unicode-math +\RequirePackage{amsthm} % Mathematical environments +\RequirePackage{mathtools} % Mathematical tools to use with amsmath +\RequirePackage{thmtools} % Theorem styles +\RequirePackage[ + warnings-off={% 消除与mathtools合用产生的警告 + mathtools-colon, + mathtools-overbracket} + ]{unicode-math} % Math fonts in xetex or luatex + +\RequirePackage{graphicx} +\DeclareGraphicsExtensions{.pdf,.eps,.jpg,.png} +\graphicspath{{figure/}} % 图片路径 +\RequirePackage{wrapfig} % Wrap text around figures + +% 必须以该顺序加载以下三个包 +% \RequirePackage{varioref} +\RequirePackage[hidelinks,bookmarksnumbered=true]{hyperref} +\RequirePackage[capitalise,nameinlink,noabbrev]{cleveref} diff --git a/macros/unicodetex/latex/njuthesis/profile/page.sty b/macros/unicodetex/latex/njuthesis/profile/page.sty new file mode 100644 index 0000000000..e926fa73ea --- /dev/null +++ b/macros/unicodetex/latex/njuthesis/profile/page.sty @@ -0,0 +1,54 @@ +\ProvidesExplPackage{profile/page}{2021-09-11}{0.6.0}{NJU Thesis page layout} + +% 论文页码 页脚居中、五号阿拉伯数字(新罗马体)连续编码 +\fancypagestyle{njuplain}{% + \fancyhead{} + \fancyfoot[C]{\zihao{5}\thepage} +} +% the header line +\tl_set:Nn \headrulewidth {0pt} +% the footer line +\tl_set:Nn \footrulewidth {0pt} + +\AtBeginDocument{\pagestyle{njuplain}} % 无页眉页脚 + +% ctex格式设置 +% 目录标题 三号宋体加粗 +% 各部分标题 四号黑体 +\ctexset{ + contentsname = \songti\bfseries\zihao{3}目\hspace{2em} 录, + chapter/format = \zihao{4}\heiti\centering, + section/format = \zihao{4}\heiti\raggedright, + subsection/format = \zihao{4}\heiti\raggedright, + subsubsection/format = \zihao{4}\heiti\raggedright +} + +% 重定义目录中章节标题样式 +% 目录内容中章的标题 四号黑体 +% 目录中其他内容 小四号宋体 +\titlecontents{chapter}% 标题级别 + [5em]% 标题左间距 + {\heiti\zihao{4}\vspace{10pt}}% 标题格式 + {\contentslabel{4em}}% 标题标志 + {\hspace*{-4em}}% 无序号标题 + {~\titlerule*[0.6pc]{$.$}~\contentspage}% 指引线与页码 + +\titlecontents{section} + [5em] + {\zihao{-4}\vspace{0pt}} + {\contentslabel{2.5em}} + {\hspace*{-4em}} + {~\titlerule*[0.6pc]{$.$}~\contentspage} + +\titlecontents{subsection} + [8em] + {\zihao{-4}\vspace{0pt}} + {\contentslabel{3em}} + {\hspace*{-4em}} + {~\titlerule*[0.6pc]{$.$}~\contentspage} + +% 将目录页插入pdf书签 +\let\savedtableofcontents\tableofcontents +\renewcommand{\tableofcontents}{% + \pdfbookmark{目录}{目录} + \savedtableofcontents} diff --git a/macros/unicodetex/latex/njuthesis/profile/reference.sty b/macros/unicodetex/latex/njuthesis/profile/reference.sty new file mode 100644 index 0000000000..4087f9f561 --- /dev/null +++ b/macros/unicodetex/latex/njuthesis/profile/reference.sty @@ -0,0 +1,68 @@ +\ProvidesExplPackage{profile/reference}{2021-09-11}{0.6.0}{NJU Thesis bibliography and reference} + +% biblatex设置 +\RequirePackage[ + style=gb7714-2015, + %style=numeric-comp, + %citestyle=authortitle-icomp, + % citestyle=numeric-comp, + %bibstyle=authoryear, + % bibstyle=numeric, + sorting=none, + %sorting=nyt, + %sortcites=true, + %autocite=footnote, + backend=biber, % Compile the bibliography with biber + hyperref=true, + backref=false, + citecounter=true, + pagetracker=true, + citetracker=true, + ibidtracker=context, + autopunct=true, + autocite=plain, + % gbpub=false, % Uncomment if you do NOT want '[S.l. : s.n.]' in reference entries, GitHub Issue (#47) + % gbnamefmt=lowercase, % Uncomment if you do NOT want uppercase author names in reference entries, GitHub Issue (#23) +]{biblatex} + +% Remove some unwanted entries from the bibliography +\AtEveryBibitem{ + \clearfield{abstract} + \clearfield{issn} + \clearfield{isbn} + \clearfield{archivePrefix} + \clearfield{arxivId} + \clearfield{pmid} + \clearfield{eprint} + \ifentrytype{online}{}{\ifentrytype{misc}{}{\clearfield{url}}} + % \ifentrytype{book}{\clearfield{doi}}{} +} + +% 修改标签名称 +\crefdefaultlabelformat{#2#1#3\,} % 默认在名称后面添加空格 + +\crefname{figure}{图}{图} +\crefname{table}{表}{表} +% \crefname{equation}{公式}{公式} +\crefformat{equation}{公式~#2#1#3~} % 删除公式编号的括号 + +\crefformat{chapter}{第#2#1#3章} +\crefformat{section}{第~#2#1#3~节} +\crefformat{subsection}{第~#2#1#3~小节} +\crefformat{subsubsection}{第~#2#1#3~小节} +% \crefname{chapter}{§}{§} +% \crefname{section}{§}{§} +% \crefname{subsection}{§}{§} +% \crefname{subsubsection}{§}{§} +\crefname{appendix}{附录}{附录} + +% \crefname{definition}{定义}{定义} +% \crefname{axiom}{公理}{公理} +% \crefname{property}{性质}{性质} +% \crefname{proposition}{命题}{命题} +% \crefname{lemma}{引理}{引理} +% \crefname{corollary}{推论}{推论} +% \crefname{remark}{注解}{注解} +% \crefname{condition}{条件}{条件} +% \crefname{conclusion}{结论}{结论} +% \crefname{assumption}{假设}{假设} -- cgit v1.2.3