diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/bibtex/bst/shtthesis/shtthesis-gbt7714-plain.bst | 2017 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/shtthesis/CHANGELOG.md | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/shtthesis/LICENSE | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/shtthesis/README.md | 19 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/shtthesis/reference.bib | 159 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.pdf | bin | 2817574 -> 2168060 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.tex | 518 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/shtthesis/shtthesis.cls | 999 |
8 files changed, 1117 insertions, 2607 deletions
diff --git a/Master/texmf-dist/bibtex/bst/shtthesis/shtthesis-gbt7714-plain.bst b/Master/texmf-dist/bibtex/bst/shtthesis/shtthesis-gbt7714-plain.bst deleted file mode 100644 index 038e8416a2f..00000000000 --- a/Master/texmf-dist/bibtex/bst/shtthesis/shtthesis-gbt7714-plain.bst +++ /dev/null @@ -1,2017 +0,0 @@ -%% -%% This is file `gbt7714-plain.bst', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% gbt7714.dtx (with options: `2015,authoryear') -%% ------------------------------------------------------------------- -%% GB/T 7714-2015 BibTeX Style -%% https://github.com/CTeX-org/gbt7714-bibtex-style -%% Version: 2019/01/02 v1.1 -%% ------------------------------------------------------------------- -%% Copyright (C) 2016-2019 by Zeping Lee <zepinglee AT gmail.com> -%% ------------------------------------------------------------------- -%% This file may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3c -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% https://www.latex-project.org/lppl.txt -%% and version 1.3c or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. -%% ------------------------------------------------------------------- - -INTEGERS { - uppercase.name - max.num.authors - period.between.author.year - sentence.case.title - link.title - show.mark - slash.for.extraction - in.booktitle - italic.jounal - bold.journal.volume - show.missing.address.publisher - show.url - show.doi - show.note -} - -FUNCTION {load.config} -{ - #1 'uppercase.name := - #3 'max.num.authors := - #0 'period.between.author.year := - #1 'sentence.case.title := - #0 'link.title := - #1 'show.mark := - #1 'slash.for.extraction := - #0 'in.booktitle := - #0 'italic.jounal := - #0 'bold.journal.volume := - #0 'show.missing.address.publisher := - #1 'show.url := - #1 'show.doi := - #0 'show.note := -} - -ENTRY - { address - author - booktitle - date - doi - edition - editor - howpublished - institution - journal - key - language - mark - medium - note - number - organization - pages - publisher - school - series - title - translator - url - urldate - volume - year - } - { entry.lang entry.is.electronic entry.numbered } - { label extra.label sort.label short.list entry.mark entry.url } - -INTEGERS { output.state before.all mid.sentence after.sentence after.block after.slash } - -INTEGERS { lang.zh lang.ja lang.en lang.ru lang.other } - -INTEGERS { charptr len } - -FUNCTION {init.state.consts} -{ #0 'before.all := - #1 'mid.sentence := - #2 'after.sentence := - #3 'after.block := - #4 'after.slash := - #3 'lang.zh := - #4 'lang.ja := - #1 'lang.en := - #2 'lang.ru := - #0 'lang.other := -} - -FUNCTION {bbl.anonymous} -{ entry.lang lang.zh = - { "佚名" } - { "Anon" } - if$ -} - -FUNCTION {bbl.space} -{ entry.lang lang.zh = - { "\ " } - { " " } - if$ -} - -FUNCTION {bbl.et.al} -{ entry.lang lang.zh = - { "等" } - { entry.lang lang.ja = - { "他" } - { entry.lang lang.ru = - { "идр" } - { "et~al." } - if$ - } - if$ - } - if$ -} - -FUNCTION {citation.et.al} -{ entry.lang lang.zh = - { "等" } - { "{\bibetal}" } - if$ -} - -FUNCTION {citation.and} { "{\biband}" } - -FUNCTION {bbl.colon} { ": " } - -FUNCTION {bbl.wide.space} { "\quad " } - -FUNCTION {bbl.slash} { "//\allowbreak " } - -FUNCTION {bbl.sine.loco} -{ entry.lang lang.zh = - { "[出版地不详]" } - { "[S.l.]" } - if$ -} - -FUNCTION {bbl.sine.nomine} -{ entry.lang lang.zh = - { "[出版者不详]" } - { "[s.n.]" } - if$ -} - -FUNCTION {bbl.sine.loco.sine.nomine} -{ entry.lang lang.zh = - { "[出版地不详: 出版者不详]" } - { "[S.l.: s.n.]" } - if$ -} - -FUNCTION {not} -{ { #0 } - { #1 } - if$ -} - -FUNCTION {and} -{ 'skip$ - { pop$ #0 } - if$ -} - -FUNCTION {or} -{ { pop$ #1 } - 'skip$ - if$ -} - -STRINGS { s t } - -FUNCTION {output.nonnull} -{ 's := - output.state mid.sentence = - { ", " * write$ } - { output.state after.block = - { add.period$ write$ - newline$ - "\newblock " write$ - } - { output.state before.all = - 'write$ - { output.state after.slash = - { bbl.slash * write$ - newline$ - } - { add.period$ " " * write$ } - if$ - } - if$ - } - if$ - mid.sentence 'output.state := - } - if$ - s -} - -FUNCTION {output} -{ duplicate$ empty$ - 'pop$ - 'output.nonnull - if$ -} - -FUNCTION {output.after} -{ 't := - duplicate$ empty$ - 'pop$ - { 's := - output.state mid.sentence = - { t * write$ } - { output.state after.block = - { add.period$ write$ - newline$ - "\newblock " write$ - } - { output.state before.all = - 'write$ - { output.state after.slash = - { bbl.slash * write$ } - { add.period$ " " * write$ } - if$ - } - if$ - } - if$ - mid.sentence 'output.state := - } - if$ - s - } - if$ -} - -FUNCTION {output.check} -{ 't := - duplicate$ empty$ - { pop$ "empty " t * " in " * cite$ * warning$ } - 'output.nonnull - if$ -} - -FUNCTION {fin.entry} -{ add.period$ - write$ - newline$ -} - -FUNCTION {new.block} -{ output.state before.all = - 'skip$ - { output.state after.slash = - 'skip$ - { after.block 'output.state := } - if$ - } - if$ -} - -FUNCTION {new.sentence} -{ output.state after.block = - 'skip$ - { output.state before.all = - 'skip$ - { output.state after.slash = - 'skip$ - { after.sentence 'output.state := } - if$ - } - if$ - } - if$ -} - -FUNCTION {new.slash} -{ output.state before.all = - 'skip$ - { slash.for.extraction - { after.slash 'output.state := } - { after.block 'output.state := } - if$ - } - if$ -} - -FUNCTION {new.block.checka} -{ empty$ - 'skip$ - 'new.block - if$ -} - -FUNCTION {new.block.checkb} -{ empty$ - swap$ empty$ - and - 'skip$ - 'new.block - if$ -} - -FUNCTION {new.sentence.checka} -{ empty$ - 'skip$ - 'new.sentence - if$ -} - -FUNCTION {new.sentence.checkb} -{ empty$ - swap$ empty$ - and - 'skip$ - 'new.sentence - if$ -} - -FUNCTION {field.or.null} -{ duplicate$ empty$ - { pop$ "" } - 'skip$ - if$ -} - -FUNCTION {italicize} -{ duplicate$ empty$ - { pop$ "" } - { "\textit{" swap$ * "}" * } - if$ -} - -INTEGERS { byte second.byte } - -INTEGERS { char.lang tmp.lang } - -STRINGS { tmp.str } - -FUNCTION {get.str.lang} -{ 'tmp.str := - lang.other 'tmp.lang := - #1 'charptr := - tmp.str text.length$ #1 + 'len := - { charptr len < } - { tmp.str charptr #1 substring$ chr.to.int$ 'byte := - byte #128 < - { charptr #1 + 'charptr := - byte #64 > byte #91 < and byte #96 > byte #123 < and or - { lang.en 'char.lang := } - { lang.other 'char.lang := } - if$ - } - { tmp.str charptr #1 + #1 substring$ chr.to.int$ 'second.byte := - byte #224 < - { charptr #2 + 'charptr := - byte #207 > byte #212 < and - byte #212 = second.byte #176 < and or - { lang.ru 'char.lang := } - { lang.other 'char.lang := } - if$ - } - { byte #240 < - { charptr #3 + 'charptr := - byte #227 > byte #234 < and - { lang.zh 'char.lang := } - { byte #227 = - { second.byte #143 > - { lang.zh 'char.lang := } - { second.byte #128 > second.byte #132 < and - { lang.ja 'char.lang := } - { lang.other 'char.lang := } - if$ - } - if$ - } - { byte #239 = - second.byte #163 > second.byte #172 < and and - { lang.zh 'char.lang := } - { lang.other 'char.lang := } - if$ - } - if$ - } - if$ - } - { charptr #4 + 'charptr := - byte #240 = second.byte #159 > and - { lang.zh 'char.lang := } - { lang.other 'char.lang := } - if$ - } - if$ - } - if$ - } - if$ - char.lang tmp.lang > - { char.lang 'tmp.lang := } - 'skip$ - if$ - } - while$ - tmp.lang -} - -FUNCTION {check.entry.lang} -{ author field.or.null - title field.or.null * - get.str.lang -} - -FUNCTION {set.entry.lang} -{ language empty$ - { check.entry.lang } - { language "english" = language "american" = or language "british" = or - { lang.en } - { language "chinese" = - { lang.zh } - { language "japanese" = - { lang.ja } - { language "russian" = - { lang.ru } - { check.entry.lang } - if$ - } - if$ - } - if$ - } - if$ - } - if$ - 'entry.lang := -} - -FUNCTION {set.entry.numbered} -{ type$ "patent" = - type$ "standard" = or - type$ "techreport" = or - { #1 'entry.numbered := } - { #0 'entry.numbered := } - if$ -} - -INTEGERS { nameptr namesleft numnames name.lang } - -FUNCTION {format.names} -{ 's := - #1 'nameptr := - s num.names$ 'numnames := - numnames 'namesleft := - { namesleft #0 > } - { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't := - nameptr max.num.authors > - { bbl.et.al - #1 'namesleft := - } - { t "others" = - { bbl.et.al } - { t get.str.lang 'name.lang := - name.lang lang.en = - { t #1 "{vv~}{ll}{~f{~}}" format.name$ - uppercase.name - { "u" change.case$ } - 'skip$ - if$ - t #1 "{, jj}" format.name$ * - } - { t #1 "{ll}{ff}" format.name$ } - if$ - } - if$ - } - if$ - nameptr #1 > - { ", " swap$ * * } - 'skip$ - if$ - nameptr #1 + 'nameptr := - namesleft #1 - 'namesleft := - } - while$ -} - -FUNCTION {format.key} -{ empty$ - { key field.or.null } - { "" } - if$ -} - -FUNCTION {format.authors} -{ author empty$ not - { author format.names } - { "empty author in " cite$ * warning$ - bbl.anonymous - } - if$ -} - -FUNCTION {format.editors} -{ editor empty$ - { "" } - { editor format.names } - if$ -} - -FUNCTION {format.translators} -{ translator empty$ - { "" } - { translator format.names - entry.lang lang.zh = - { translator num.names$ #3 > - { "译" * } - { ", 译" * } - if$ - } - 'skip$ - if$ - } - if$ -} - -FUNCTION {format.full.names} -{'s := - #1 'nameptr := - s num.names$ 'numnames := - numnames 'namesleft := - { namesleft #0 > } - { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't := - t get.str.lang 'name.lang := - name.lang lang.en = - { t #1 "{vv~}{ll}" format.name$ 't := } - { t #1 "{ll}{ff}" format.name$ 't := } - if$ - nameptr #1 > - { - namesleft #1 > - { ", " * t * } - { - numnames #2 > - { "," * } - 'skip$ - if$ - t "others" = - { " et~al." * } - { " and " * t * } - if$ - } - if$ - } - 't - if$ - nameptr #1 + 'nameptr := - namesleft #1 - 'namesleft := - } - while$ -} - -FUNCTION {author.editor.full} -{ author empty$ - { editor empty$ - { "" } - { editor format.full.names } - if$ - } - { author format.full.names } - if$ -} - -FUNCTION {author.full} -{ author empty$ - { "" } - { author format.full.names } - if$ -} - -FUNCTION {editor.full} -{ editor empty$ - { "" } - { editor format.full.names } - if$ -} - -FUNCTION {make.full.names} -{ type$ "book" = - type$ "inbook" = - or - 'author.editor.full - { type$ "collection" = - type$ "proceedings" = - or - 'editor.full - 'author.full - if$ - } - if$ -} - -FUNCTION {output.bibitem} -{ newline$ - "\bibitem[{" write$ - label write$ - ")" make.full.names duplicate$ short.list = - { pop$ } - { * } - if$ - "}]{" * write$ - cite$ write$ - "}" write$ - newline$ - "" - before.all 'output.state := -} - -FUNCTION {change.sentence.case} -{ entry.lang lang.en = - { "t" change.case$ } - 'skip$ - if$ -} - -FUNCTION {add.link} -{ url empty$ not - { "\href{" url * "}{" * swap$ * "}" * } - { doi empty$ not - { "\href{http://dx.doi.org/" doi * "}{" * swap$ * "}" * } - 'skip$ - if$ - } - if$ -} - -FUNCTION {format.title} -{ title empty$ - { "" } - { title - sentence.case.title - 'change.sentence.case - 'skip$ - if$ - entry.numbered number empty$ not and - { bbl.colon * number * } - 'skip$ - if$ - link.title - 'add.link - 'skip$ - if$ - } - if$ -} - -FUNCTION {tie.or.space.connect} -{ duplicate$ text.length$ #3 < - { "~" } - { " " } - if$ - swap$ * * -} - -FUNCTION {either.or.check} -{ empty$ - 'pop$ - { "can't use both " swap$ * " fields in " * cite$ * warning$ } - if$ -} - -FUNCTION {is.digit} -{ duplicate$ empty$ - { pop$ #0 } - { chr.to.int$ - duplicate$ "0" chr.to.int$ < - { pop$ #0 } - { "9" chr.to.int$ > - { #0 } - { #1 } - if$ - } - if$ - } - if$ -} - -FUNCTION {is.number} -{ 's := - s empty$ - { #0 } - { s text.length$ 'charptr := - { charptr #0 > - s charptr #1 substring$ is.digit - and - } - { charptr #1 - 'charptr := } - while$ - charptr not - } - if$ -} - -FUNCTION {format.volume} -{ volume empty$ not - { volume is.number - { entry.lang lang.zh = - { "第 " volume * " 卷" * } - { "volume" volume tie.or.space.connect } - if$ - } - { volume } - if$ - } - { "" } - if$ -} - -FUNCTION {format.number} -{ number empty$ not - { number is.number - { entry.lang lang.zh = - { "第 " number * " 册" * } - { "number" number tie.or.space.connect } - if$ - } - { number } - if$ - } - { "" } - if$ -} - -FUNCTION {format.volume.number} -{ volume empty$ not - { format.volume } - { format.number } - if$ -} - -FUNCTION {format.title.vol.num} -{ title - sentence.case.title - 'change.sentence.case - 'skip$ - if$ - entry.numbered - { number empty$ not - { bbl.colon * number * } - 'skip$ - if$ - } - { format.volume.number 's := - s empty$ not - { bbl.colon * s * } - 'skip$ - if$ - } - if$ -} - -FUNCTION {format.series.vol.num.title} -{ format.volume.number 's := - series empty$ not - { series - sentence.case.title - 'change.sentence.case - 'skip$ - if$ - entry.numbered - { bbl.wide.space * } - { bbl.colon * - s empty$ not - { s * bbl.wide.space * } - 'skip$ - if$ - } - if$ - title * - sentence.case.title - 'change.sentence.case - 'skip$ - if$ - entry.numbered number empty$ not and - { bbl.colon * number * } - 'skip$ - if$ - } - { format.title.vol.num } - if$ - link.title - 'add.link - 'skip$ - if$ -} - -FUNCTION {format.booktitle.vol.num} -{ booktitle - entry.numbered - 'skip$ - { format.volume.number 's := - s empty$ not - { bbl.colon * s * } - 'skip$ - if$ - } - if$ -} - -FUNCTION {format.series.vol.num.booktitle} -{ format.volume.number 's := - series empty$ not - { series bbl.colon * - entry.numbered not s empty$ not and - { s * bbl.wide.space * } - 'skip$ - if$ - booktitle * - } - { format.booktitle.vol.num } - if$ - in.booktitle - { duplicate$ empty$ not entry.lang lang.en = and - { "In: " swap$ * } - 'skip$ - if$ - } - 'skip$ - if$ -} - -FUNCTION {format.journal} -{ journal - italic.jounal - 'italicize - 'skip$ - if$ -} - -FUNCTION {set.entry.mark} -{ entry.mark empty$ not - 'pop$ - { mark empty$ not - { pop$ mark 'entry.mark := } - { 'entry.mark := } - if$ - } - if$ -} - -FUNCTION {format.mark} -{ show.mark - { medium empty$ not - { entry.mark "/" * medium * 'entry.mark := } - { entry.is.electronic - { entry.mark "/OL" * 'entry.mark := } - 'skip$ - if$ - } - if$ - "\allowbreak[" entry.mark * "]" * - } - { "" } - if$ -} - -FUNCTION {num.to.ordinal} -{ duplicate$ text.length$ 'charptr := - duplicate$ charptr #1 substring$ 's := - s "1" = - { "st" * } - { s "2" = - { "nd" * } - { s "3" = - { "rd" * } - { "th" * } - if$ - } - if$ - } - if$ -} - -FUNCTION {format.edition} -{ edition empty$ - { "" } - { edition is.number - { entry.lang lang.zh = - { edition " 版" * } - { edition num.to.ordinal " ed." * } - if$ - } - { entry.lang lang.en = - { edition change.sentence.case 's := - s "Revised" = s "Revised edition" = or - { "Rev. ed." } - { s " ed." *} - if$ - } - { edition } - if$ - } - if$ - } - if$ -} - -FUNCTION {format.publisher} -{ publisher empty$ not - { publisher } - { school empty$ not - { school } - { organization empty$ not - { organization } - { institution empty$ not - { institution } - { "" } - if$ - } - if$ - } - if$ - } - if$ -} - -FUNCTION {format.address.publisher} -{ address empty$ not - { address - format.publisher empty$ not - { bbl.colon * format.publisher * } - { entry.is.electronic not show.missing.address.publisher and - { bbl.colon * bbl.sine.nomine * } - 'skip$ - if$ - } - if$ - } - { entry.is.electronic not show.missing.address.publisher and - { format.publisher empty$ not - { bbl.sine.loco bbl.colon * format.publisher * } - { bbl.sine.loco.sine.nomine } - if$ - } - { format.publisher empty$ not - { format.publisher } - { "" } - if$ - } - if$ - } - if$ -} - -FUNCTION {extract.before.dash} -{ duplicate$ empty$ - { pop$ "" } - { 's := - #1 'charptr := - s text.length$ #1 + 'len := - { charptr len < - s charptr #1 substring$ "-" = not - and - } - { charptr #1 + 'charptr := } - while$ - s #1 charptr #1 - substring$ - } - if$ -} - -FUNCTION {extract.after.dash} -{ duplicate$ empty$ - { pop$ "" } - { 's := - #1 'charptr := - s text.length$ #1 + 'len := - { charptr len < - s charptr #1 substring$ "-" = not - and - } - { charptr #1 + 'charptr := } - while$ - { charptr len < - s charptr #1 substring$ "-" = - and - } - { charptr #1 + 'charptr := } - while$ - s charptr global.max$ substring$ - } - if$ -} - -FUNCTION {contains.dash} -{ duplicate$ empty$ - { pop$ #0 } - { 's := - { s empty$ not - s #1 #1 substring$ "-" = not - and - } - { s #2 global.max$ substring$ 's := } - while$ - s empty$ not - } - if$ -} - -FUNCTION {format.year} -{ year empty$ not - { year extract.before.dash } - { date empty$ not - { date extract.before.dash } - { "empty year in " cite$ * warning$ - urldate empty$ not - { "[" urldate extract.before.dash * "]" * } - { "" } - if$ - } - if$ - } - if$ - extra.label * -} - -FUNCTION {format.date} -{ type$ "patent" = type$ "newspaper" = or - date empty$ not and - { date } - { year } - if$ -} - -FUNCTION {format.editdate} -{ date empty$ not - { "\allowbreak(" date * ")" * } - { "" } - if$ -} - -FUNCTION {format.urldate} -{ urldate empty$ not entry.is.electronic and - { "\allowbreak[" urldate * "]" * } - { "" } - if$ -} - -FUNCTION {hyphenate} -{ 't := - "" - { t empty$ not } - { t #1 #1 substring$ "-" = - { "-" * - { t #1 #1 substring$ "-" = } - { t #2 global.max$ substring$ 't := } - while$ - } - { t #1 #1 substring$ * - t #2 global.max$ substring$ 't := - } - if$ - } - while$ -} - -FUNCTION {format.pages} -{ pages empty$ - { "" } - { pages hyphenate } - if$ -} - -FUNCTION {format.journal.volume} -{ volume empty$ not - { bold.journal.volume - { "\textbf{" volume * "}" * } - { volume } - if$ - } - { "" } - if$ -} - -FUNCTION {format.journal.number} -{ number empty$ not - { "\penalty0 (" number * ")" * } - { "" } - if$ -} - -FUNCTION {format.journal.pages} -{ pages empty$ - { "" } - { ":\penalty0 " pages hyphenate * } - if$ -} - -FUNCTION {format.periodical.year.volume.number} -{ year empty$ not - { year extract.before.dash } - { "empty year in periodical " cite$ * warning$ } - if$ - volume empty$ not - { ", " * volume extract.before.dash * } - 'skip$ - if$ - number empty$ not - { "\penalty0 (" * number extract.before.dash * ")" * } - 'skip$ - if$ - year contains.dash - { "--" * - year extract.after.dash empty$ - volume extract.after.dash empty$ and - number extract.after.dash empty$ and not - { year extract.after.dash empty$ not - { year extract.after.dash * } - { year extract.before.dash * } - if$ - volume empty$ not - { ", " * volume extract.after.dash * } - 'skip$ - if$ - number empty$ not - { "\penalty0 (" * number extract.after.dash * ")" * } - 'skip$ - if$ - } - 'skip$ - if$ - } - 'skip$ - if$ -} - -FUNCTION {check.url} -{ url empty$ not - { "\url{" url * "}" * 'entry.url := - #1 'entry.is.electronic := - } - { howpublished empty$ not - { howpublished #1 #5 substring$ "\url{" = - { howpublished 'entry.url := - #1 'entry.is.electronic := - } - 'skip$ - if$ - } - { note empty$ not - { note #1 #5 substring$ "\url{" = - { note 'entry.url := - #1 'entry.is.electronic := - } - 'skip$ - if$ - } - 'skip$ - if$ - } - if$ - } - if$ -} - -FUNCTION {format.url} -{ entry.url empty$ not - { new.block entry.url } - { "" } - if$ -} - -FUNCTION {check.doi} -{ doi empty$ not - { #1 'entry.is.electronic := } - 'skip$ - if$ -} - -FUNCTION {is.in.url} -{ 's := - s empty$ - { #1 } - { entry.url empty$ - { #0 } - { s text.length$ 'len := - entry.url text.length$ 'charptr := - { entry.url charptr len substring$ s = not - charptr #0 > - and - } - { charptr #1 - 'charptr := } - while$ - charptr - } - if$ - } - if$ -} - -FUNCTION {format.doi} -{ "" - doi empty$ not show.doi and - { "" 's := - doi 't := - #0 'numnames := - { t empty$ not} - { t #1 #1 substring$ 'tmp.str := - tmp.str "," = tmp.str " " = or t #2 #1 substring$ empty$ or - { t #2 #1 substring$ empty$ - { s tmp.str * 's := } - 'skip$ - if$ - s empty$ s is.in.url or - 'skip$ - { numnames #1 + 'numnames := - numnames #1 > - { ", " * } - { "DOI: " * } - if$ - "\doi{" s * "}" * * - } - if$ - "" 's := - } - { s tmp.str * 's := } - if$ - t #2 global.max$ substring$ 't := - } - while$ - 's := - s empty$ not - { new.block s } - { "" } - if$ - } - 'skip$ - if$ -} - -FUNCTION {check.electronic} -{ "" 'entry.url := - #0 'entry.is.electronic := - 'check.doi - 'skip$ - if$ - 'check.url - 'skip$ - if$ - medium empty$ not - { medium "MT" = medium "DK" = or medium "CD" = or medium "OL" = or - { #1 'entry.is.electronic := } - 'skip$ - if$ - } - 'skip$ - if$ -} - -FUNCTION {format.note} -{ note empty$ not show.note and - { note } - { "" } - if$ -} - -FUNCTION {empty.misc.check} -{ author empty$ title empty$ - year empty$ - and and - key empty$ not and - { "all relevant fields are empty in " cite$ * warning$ } - 'skip$ - if$ -} - -FUNCTION {monograph} -{ output.bibitem - author empty$ not - { format.authors } - { editor empty$ not - { format.editors } - { "empty author and editor in " cite$ * warning$ - bbl.anonymous - } - if$ - } - if$ - output - new.block - format.series.vol.num.title "title" output.check - "M" set.entry.mark - format.mark "" output.after - new.block - format.translators output - new.sentence - format.edition output - new.block - format.address.publisher output - format.year "year" output.check - format.pages bbl.colon output.after - format.urldate "" output.after - format.url output - format.doi output - new.block - format.note output - fin.entry -} - -FUNCTION {incollection} -{ output.bibitem - format.authors output - author format.key output - new.block - format.title "title" output.check - "M" set.entry.mark - format.mark "" output.after - new.block - format.translators output - new.slash - format.editors output - new.block - format.series.vol.num.booktitle "booktitle" output.check - new.block - format.edition output - new.block - format.address.publisher output - format.year "year" output.check - format.pages bbl.colon output.after - format.urldate "" output.after - format.url output - format.doi output - new.block - format.note output - fin.entry -} - -FUNCTION {periodical} -{ output.bibitem - format.authors output - author format.key output - new.block - format.title "title" output.check - "J" set.entry.mark - format.mark "" output.after - new.block - format.periodical.year.volume.number output - new.block - format.address.publisher output - format.date "year" output.check - format.urldate "" output.after - format.url output - format.doi output - new.block - format.note output - fin.entry -} - -FUNCTION {article} -{ output.bibitem - format.authors output - author format.key output - new.block - format.title "title" output.check - "J" set.entry.mark - format.mark "" output.after - new.block - format.journal "journal" output.check - format.date "year" output.check - format.journal.volume output - format.journal.number "" output.after - format.journal.pages "" output.after - format.urldate "" output.after - format.url output - format.doi output - new.block - format.note output - fin.entry -} - -FUNCTION {patent} -{ output.bibitem - format.authors output - author format.key output - new.block - format.title "title" output.check - "P" set.entry.mark - format.mark "" output.after - new.block - format.date "year" output.check - format.urldate "" output.after - format.url output - format.doi output - new.block - format.note output - fin.entry -} - -FUNCTION {electronic} -{ #1 #1 check.electronic - #1 'entry.is.electronic := - output.bibitem - format.authors output - author format.key output - new.block - format.series.vol.num.title "title" output.check - "EB" set.entry.mark - format.mark "" output.after - new.block - format.address.publisher output - date empty$ - { format.date output } - 'skip$ - if$ - format.pages bbl.colon output.after - format.editdate "" output.after - format.urldate "" output.after - format.url output - format.doi output - new.block - format.note output - fin.entry -} - -FUNCTION {misc} -{ journal empty$ not - 'article - { booktitle empty$ not - 'incollection - { publisher empty$ not - 'monograph - { entry.is.electronic - 'electronic - { "Z" set.entry.mark - monograph - } - if$ - } - if$ - } - if$ - } - if$ - empty.misc.check -} - -FUNCTION {archive} -{ "A" set.entry.mark - misc -} - -FUNCTION {book} { monograph } - -FUNCTION {booklet} { book } - -FUNCTION {collection} -{ "G" set.entry.mark - monograph -} - -FUNCTION {database} -{ "DB" set.entry.mark - electronic -} - -FUNCTION {dataset} -{ "DS" set.entry.mark - electronic -} - -FUNCTION {inbook} { book } - -FUNCTION {inproceedings} -{ "C" set.entry.mark - incollection -} - -FUNCTION {conference} { inproceedings } - -FUNCTION {map} -{ "CM" set.entry.mark - misc -} - -FUNCTION {manual} { monograph } - -FUNCTION {mastersthesis} -{ "D" set.entry.mark - monograph -} - -FUNCTION {newspaper} -{ "N" set.entry.mark - article -} - -FUNCTION {online} -{ "EB" set.entry.mark - electronic -} - -FUNCTION {phdthesis} { mastersthesis } - -FUNCTION {proceedings} -{ "C" set.entry.mark - monograph -} - -FUNCTION {software} -{ "CP" set.entry.mark - electronic -} - -FUNCTION {standard} -{ "S" set.entry.mark - misc -} - -FUNCTION {techreport} -{ "R" set.entry.mark - misc -} - -FUNCTION {unpublished} -{ "Z" set.entry.mark - misc -} - -FUNCTION {default.type} { misc } - -MACRO {jan} {"January"} - -MACRO {feb} {"February"} - -MACRO {mar} {"March"} - -MACRO {apr} {"April"} - -MACRO {may} {"May"} - -MACRO {jun} {"June"} - -MACRO {jul} {"July"} - -MACRO {aug} {"August"} - -MACRO {sep} {"September"} - -MACRO {oct} {"October"} - -MACRO {nov} {"November"} - -MACRO {dec} {"December"} - -MACRO {acmcs} {"ACM Computing Surveys"} - -MACRO {acta} {"Acta Informatica"} - -MACRO {cacm} {"Communications of the ACM"} - -MACRO {ibmjrd} {"IBM Journal of Research and Development"} - -MACRO {ibmsj} {"IBM Systems Journal"} - -MACRO {ieeese} {"IEEE Transactions on Software Engineering"} - -MACRO {ieeetc} {"IEEE Transactions on Computers"} - -MACRO {ieeetcad} - {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} - -MACRO {ipl} {"Information Processing Letters"} - -MACRO {jacm} {"Journal of the ACM"} - -MACRO {jcss} {"Journal of Computer and System Sciences"} - -MACRO {scp} {"Science of Computer Programming"} - -MACRO {sicomp} {"SIAM Journal on Computing"} - -MACRO {tocs} {"ACM Transactions on Computer Systems"} - -MACRO {tods} {"ACM Transactions on Database Systems"} - -MACRO {tog} {"ACM Transactions on Graphics"} - -MACRO {toms} {"ACM Transactions on Mathematical Software"} - -MACRO {toois} {"ACM Transactions on Office Information Systems"} - -MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} - -MACRO {tcs} {"Theoretical Computer Science"} - -FUNCTION {sortify} -{ purify$ - "l" change.case$ -} - -FUNCTION {chop.word} -{ 's := - 'len := - s #1 len substring$ = - { s len #1 + global.max$ substring$ } - 's - if$ -} - -FUNCTION {format.lab.name} -{ "{vv~}{ll}{, jj}{, ff}" format.name$ - duplicate$ get.str.lang 'name.lang := - name.lang lang.zh = name.lang lang.ja = or - { #1 "{ll}{ff}" format.name$ } - { #1 "{vv~}{ll}" format.name$ } - if$ -} - -FUNCTION {format.lab.names} -{ 's := - s #1 format.lab.name - s num.names$ #2 = name.lang lang.en = name.lang lang.ru = or and - { s #2 format.lab.name 't := - t "others" = - { bbl.space * citation.et.al * } - { " " * citation.and * " " * t * } - if$ - } - { s num.names$ #1 > - { bbl.space * citation.et.al * } - 'skip$ - if$ - } - if$ -} - -FUNCTION {author.key.label} -{ author empty$ - { key empty$ - { cite$ #1 #3 substring$ } - 'key - if$ - } - { author format.lab.names } - if$ -} - -FUNCTION {author.editor.key.label} -{ author empty$ - { editor empty$ - { key empty$ - { cite$ #1 #3 substring$ } - 'key - if$ - } - { editor format.lab.names } - if$ - } - { author format.lab.names } - if$ -} - -FUNCTION {author.key.organization.label} -{ author empty$ - { key empty$ - { organization empty$ - { cite$ #1 #3 substring$ } - { "The " #4 organization chop.word #3 text.prefix$ } - if$ - } - 'key - if$ - } - { author format.lab.names } - if$ -} - -FUNCTION {editor.key.organization.label} -{ editor empty$ - { key empty$ - { organization empty$ - { cite$ #1 #3 substring$ } - { "The " #4 organization chop.word #3 text.prefix$ } - if$ - } - 'key - if$ - } - { editor format.lab.names } - if$ -} - -FUNCTION {calc.short.authors} -{ type$ "book" = - type$ "inbook" = - or - 'author.editor.key.label - { type$ "collection" = - type$ "proceedings" = - or - { editor empty$ not - 'editor.key.organization.label - 'author.key.organization.label - if$ - } - 'author.key.label - if$ - } - if$ - 'short.list := -} - -FUNCTION {calc.label} -{ calc.short.authors - short.list - "(" - * - format.year duplicate$ empty$ - short.list key field.or.null = or - { pop$ "" } - 'skip$ - if$ - * - 'label := -} - -FUNCTION {sort.language.label} -{ entry.lang lang.zh = - { "a zh " } - { entry.lang lang.ja = - { "b ja " } - { entry.lang lang.en = - { "c en " } - { entry.lang lang.ru = - { "d ru " } - { "e other " } - if$ - } - if$ - } - if$ - } - if$ -} - -FUNCTION {sort.format.names} -{ 's := - #1 'nameptr := - "" - s num.names$ 'numnames := - numnames 'namesleft := - { namesleft #0 > } - { - s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := - nameptr #1 > - { - " " * - namesleft #1 = t "others" = and - { "zzzzz" * } - { numnames #2 > nameptr #2 = and - { "zz" * year field.or.null * " " * } - 'skip$ - if$ - t sortify * - } - if$ - } - { t sortify * } - if$ - nameptr #1 + 'nameptr := - namesleft #1 - 'namesleft := - } - while$ -} - -FUNCTION {sort.format.title} -{ 't := - "A " #2 - "An " #3 - "The " #4 t chop.word - chop.word - chop.word - sortify - #1 global.max$ substring$ -} - -FUNCTION {anonymous.sort} -{ entry.lang lang.zh = - { "yi4 ming2" } - { "anon" } - if$ -} - -FUNCTION {warn.empty.key} -{ entry.lang lang.zh = - { "empty key in " cite$ * warning$ } - 'skip$ - if$ -} - -FUNCTION {author.sort} -{ key empty$ - { warn.empty.key - author empty$ - { anonymous.sort } - { author sort.format.names } - if$ - } - { key sortify } - if$ -} - -FUNCTION {author.editor.sort} -{ key empty$ - { warn.empty.key - author empty$ - { editor empty$ - { anonymous.sort } - { editor sort.format.names } - if$ - } - { author sort.format.names } - if$ - } - { key sortify } - if$ -} - -FUNCTION {author.organization.sort} -{ key empty$ - { warn.empty.key - author empty$ - { organization empty$ - { anonymous.sort } - { "The " #4 organization chop.word sortify } - if$ - } - { author sort.format.names } - if$ - } - { key sortify } - if$ -} - -FUNCTION {editor.organization.sort} -{ key empty$ - { warn.empty.key - editor empty$ - { organization empty$ - { anonymous.sort } - { "The " #4 organization chop.word sortify } - if$ - } - { editor sort.format.names } - if$ - } - { key sortify } - if$ -} - -FUNCTION {presort} -{ set.entry.lang - set.entry.numbered - show.url show.doi check.electronic - calc.label - label sortify - " " - * - sort.language.label - type$ "book" = - type$ "inbook" = - or - 'author.editor.sort - { type$ "collection" = - type$ "proceedings" = - or - 'editor.organization.sort - 'author.sort - if$ - } - if$ - * - " " - * - year field.or.null sortify - * - " " - * - cite$ - * - #1 entry.max$ substring$ - 'sort.label := - sort.label * - #1 entry.max$ substring$ - 'sort.key$ := -} - -STRINGS { longest.label last.label next.extra } - -INTEGERS { longest.label.width last.extra.num number.label } - -FUNCTION {initialize.longest.label} -{ "" 'longest.label := - #0 int.to.chr$ 'last.label := - "" 'next.extra := - #0 'longest.label.width := - #0 'last.extra.num := - #0 'number.label := -} - -FUNCTION {forward.pass} -{ last.label label = - { last.extra.num #1 + 'last.extra.num := - last.extra.num int.to.chr$ 'extra.label := - } - { "a" chr.to.int$ 'last.extra.num := - "" 'extra.label := - label 'last.label := - } - if$ - number.label #1 + 'number.label := -} - -FUNCTION {reverse.pass} -{ next.extra "b" = - { "a" 'extra.label := } - 'skip$ - if$ - extra.label 'next.extra := - extra.label - duplicate$ empty$ - 'skip$ - { "{\natexlab{" swap$ * "}}" * } - if$ - 'extra.label := - label extra.label * 'label := -} - -FUNCTION {bib.sort.order} -{ sort.label 'sort.key$ := -} - -FUNCTION {begin.bib} -{ preamble$ empty$ - 'skip$ - { preamble$ write$ newline$ } - if$ - "\begin{thebibliography}{" number.label int.to.str$ * "}" * - write$ newline$ - "\providecommand{\natexlab}[1]{#1}" - write$ newline$ - "\providecommand{\url}[1]{#1}" - write$ newline$ - "\expandafter\ifx\csname urlstyle\endcsname\relax\relax\else" - write$ newline$ - " \urlstyle{same}\fi" - write$ newline$ - show.doi - { "\providecommand{\href}[2]{\url{#2}}" - write$ newline$ - "\providecommand{\doi}[1]{\href{https://doi.org/#1}{#1}}" - write$ newline$ - } - 'skip$ - if$ -} - -FUNCTION {end.bib} -{ newline$ - "\end{thebibliography}" write$ newline$ -} - -READ - -EXECUTE {init.state.consts} - -EXECUTE {load.config} - -ITERATE {presort} - -SORT - -EXECUTE {initialize.longest.label} - -ITERATE {forward.pass} - -REVERSE {reverse.pass} - -ITERATE {bib.sort.order} - -SORT - -EXECUTE {begin.bib} - -ITERATE {call.type$} - -EXECUTE {end.bib} diff --git a/Master/texmf-dist/doc/latex/shtthesis/CHANGELOG.md b/Master/texmf-dist/doc/latex/shtthesis/CHANGELOG.md index 4c25a665ca3..135a61987a1 100644 --- a/Master/texmf-dist/doc/latex/shtthesis/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/shtthesis/CHANGELOG.md @@ -2,6 +2,14 @@ `sht-thesis` 项目派生于 `ucasthesis`,一个在 GPLv3 License 下分发的项目。根据该许可证条款,`sht-thesis` 项目列出基于 `ucasthesis` (commit `faad94b` 之后) 的所有修改条目: +## 2020-06-23 +> Release: v0.3.0 + +1. (试验性地)支持本科论文排版; +2. 将参考文献后端改为 biblatex; +3. 添加编号定理、证明等常用数学环境; +4. 将学位指定从 `\shtsetup` 移至类选项; + ## 2020-06-05 项目名称改为 shtthesis,并完全重构项目结构。 diff --git a/Master/texmf-dist/doc/latex/shtthesis/LICENSE b/Master/texmf-dist/doc/latex/shtthesis/LICENSE index ff622a9d075..cec6f6b1f8b 100644 --- a/Master/texmf-dist/doc/latex/shtthesis/LICENSE +++ b/Master/texmf-dist/doc/latex/shtthesis/LICENSE @@ -631,7 +631,7 @@ to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - sht-thesis, a LaTeX template for thesis writing in ShanghaiTech University. + shtthesis, an unofficial LaTeX thesis template for ShanghaiTech University. Copyright (C) 2020 Li Rundong <rundong.001@gmail.com> This program is free software: you can redistribute it and/or modify @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - sht-thesis Copyright (C) 2020 Li Rundong <rundong.001@gmail.com> + shtthesis Copyright (C) 2020 Li Rundong <rundong.001@gmail.com> This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/Master/texmf-dist/doc/latex/shtthesis/README.md b/Master/texmf-dist/doc/latex/shtthesis/README.md index cbb743db2a7..582318cdbf8 100644 --- a/Master/texmf-dist/doc/latex/shtthesis/README.md +++ b/Master/texmf-dist/doc/latex/shtthesis/README.md @@ -1,9 +1,12 @@ # ShangHaiTech university THESIS (shtthesis) -![Build](https://github.com/lirundong/sht-thesis/workflows/Build/badge.svg) +[![Action status](https://github.com/lirundong/sht-thesis/workflows/Build/badge.svg)](https://github.com/lirundong/shtthesis/actions) +[![CTAN version](https://img.shields.io/ctan/v/shtthesis)](https://ctan.org/pkg/shtthesis) +[![GitHub release](https://img.shields.io/github/v/release/lirundong/shtthesis)](https://github.com/lirundong/shtthesis/releases/latest) +[![GitHub downloads](https://img.shields.io/github/downloads/lirundong/shtthesis/total)](https://github.com/lirundong/shtthesis/releases) -`shtthesis` project, forked from [`ucasthesis`](https://github.com/mohuangrui/ucasthesis), is an **unofficial** LaTeX thesis template for ShanghaiTech University and satisfies all format requirements in 《上海科技大学研究生学位论文撰写规范(初稿)》. The user just need to set `\documentclass{shtthesis}` and to setup mandatory information via `\shtsetup`, then his or her thesis document will be typeset properly: +`shtthesis` project, forked from [`ucasthesis`](https://github.com/mohuangrui/ucasthesis), is an **unofficial** LaTeX thesis template for ShanghaiTech University and satisfies all format requirements of graduate/undergraduate thesis. The user just need to set `\documentclass{shtthesis}` and to setup mandatory information via `\shtsetup`, then his or her thesis document will be typeset properly: ```latex -\documentclass{shtthesis} +\documentclass[master]{shtthesis} \shtsetup{ title = {论文标题}, @@ -19,10 +22,13 @@ ## Get the Template - Stable version: - - GitHub Release: please refer to [release](https://github.com/lirundong/sht-thesis/releases) page, and download required files based on release information - - CTAN: TODO + - CTAN (**strongly recommended**): [`shtthesis`](https://ctan.org/pkg/shtthesis) package on CTAN can be installed via `tlmgr` for TeX Live and MacTeX users: + ```bash + tlmgr install shtthesis + ``` - Note that `shtthesis` package in CTAN does not include the university logo file. Please download [`shanghaitech-logo.pdf`](shanghaitech-logo.pdf) from this repository and put it in the root of your project folder. + **Note**: `shtthesis` package on CTAN does not include the university logo file. Please download [`shanghaitech-logo.pdf`](https://github.com/lirundong/shtthesis/raw/master/shanghaitech-logo.pdf) from this repository and put it in the root of your project directory. + - GitHub Release: please refer to [release](https://github.com/lirundong/sht-thesis/releases) page, and download required files based on release information - Develop version: directly clone the GitHub repo ```bash git clone https://github.com/lirundong/sht-thesis.git @@ -47,5 +53,4 @@ After cloning or downloading this template, please ## License - The copyright of ShanghaiTech University logo (`shanghaitech-logo.pdf`) is owned by ShanghaiTech University -- `shtthesis-gbt7714-plain.bst` is modified from [gbt7714](https://github.com/CTeX-org/gbt7714-bibtex-style) project and is licensed under LaTeX Project Public License v1.3c, see [lppl-1.3c](https://www.latex-project.org/lppl/lppl-1-3c.txt) for details - The rest of `shtthesis` project is licensed under GNU Public License v3, see [LICENSE](LICENSE) for details diff --git a/Master/texmf-dist/doc/latex/shtthesis/reference.bib b/Master/texmf-dist/doc/latex/shtthesis/reference.bib deleted file mode 100644 index f7bbcaf919c..00000000000 --- a/Master/texmf-dist/doc/latex/shtthesis/reference.bib +++ /dev/null @@ -1,159 +0,0 @@ -@book{wikibook2014latex, - title={http://en.wikibooks.org/wiki/LaTeX}, - author={Wikibook}, - year={2014}, - publisher={On-line Resources} -} -@book{lamport1986document, - title={Document Preparation System}, - author={Lamport, Leslie}, - year={1986}, - publisher={Addison-Wesley Reading, MA} -} -@article{chen2005zhulu, - title={著录文后参考文献的规则及注意事项}, - author={陈浩元}, - key={Chen Hao Yuan}, - journal={编辑学报}, - volume={17}, - number={6}, - pages={413--415}, - year={2005} -} -@book{chu2004tushu, - title={图书馆数字参考咨询服务研究}, - author={初景利}, - key={Chu Jing Li}, - year={2004}, - address={北京}, - publisher={北京图书馆出版社} -} -@article{stamerjohanns2009mathml, - title={{MathML}-aware article conversion from {LaTeX}}, - author={Stamerjohanns, Heinrich and Ginev, Deyan and David, Catalin and Misev, Dimitar and Zamdzhiev, Vladimir and Kohlhase, Michael}, - journal={Towards a Digital Mathematics Library}, - volume={16}, - number={2}, - pages={109--120}, - year={2009}, - publisher={Masaryk University Press} -} -@article{betts2005aging, - title={Aging reduces center-surround antagonism in visual motion processing}, - author={Betts, Lisa R and Taylor, Christopher P}, - journal={Neuron}, - volume={45}, - number={3}, - pages={361--366}, - year={2005}, - publisher={Elsevier} -} - -@article{bravo1990comparative, - title={Comparative study of visual inter and intrahemispheric cortico-cortical connections in five native Chilean rodents}, - author={Bravo, Hermes and Olavarria, Jaime}, - journal={Anatomy and embryology}, - volume={181}, - number={1}, - pages={67--73}, - year={1990}, - publisher={Springer} -} -@book{hls2012jinji, - author = {哈里森·沃尔德伦}, - key = {Haliseng Woerdelun}, - translator = {谢远涛}, - title = {经济数学与金融数学}, - address = {北京}, - publisher = {中国人民大学出版社}, - year = {2012}, - pages = {235--236}, -} -@proceedings{niu2013zonghe, - editor = {牛志明 and 斯温兰德 and 雷光春}, - key = {Niu Zhi Ming Siwenlande Lei Guang Chun}, - title = {综合湿地管理国际研讨会论文集}, - address = {北京}, - publisher = {海洋出版社}, - year = {2013}, -} -@incollection{chen1980zhongguo, - author = {陈晋镳 and 张惠民 and 朱士兴 and 赵震 and - 王振刚}, - key = {Chen Jing Ao Zhang Hui Ming Zhu Shi Xing Zhao Zhen Wang Zhen Gang}, - title = {蓟县震旦亚界研究}, - editor = {中国地质科学院天津地质矿产研究所}, - booktitle = {中国震旦亚界}, - address = {天津}, - publisher = {天津科学技术出版社}, - year = {1980}, - pages = {56--114}, -} -@article{yuan2012lana, - author = {袁训来 and 陈哲 and 肖书海}, - key = {Yuan xun lai Chen zhe Xiao shu Hai}, - title = {蓝田生物群: 一个认识多细胞生物起源和早期演化的新窗口 -- 篇一}, - journal = {科学通报}, - year = {2012}, - volume = {57}, - number = {34}, - pages = {3219}, -} -@article{yuan2012lanb, - author = {袁训来 and 陈哲 and 肖书海}, - key = {Yuan xun lai Chen zhe Xiao shu Hai}, - title = {蓝田生物群: 一个认识多细胞生物起源和早期演化的新窗口 -- 篇二}, - journal = {科学通报}, - year = {2012}, - volume = {57}, - number = {34}, - pages = {3219}, -} -@article{yuan2012lanc, - author = {袁训来 and 陈哲 and 肖书海}, - key = {Yuan xun lai Chen zhe Xiao shu Hai}, - title = {蓝田生物群: 一个认识多细胞生物起源和早期演化的新窗口 -- 篇三}, - journal = {科学通报}, - year = {2012}, - volume = {57}, - number = {34}, - pages = {3219}, -} -@article{walls2013drought, - author = {Walls, Susan C. and Barichivich, William J. and Brown, Mary - E.}, - title = {Drought, deluge and declines: the impact of precipitation - extremes on amphibians in a changing climate}, - journal = {Biology}, - year = {2013}, - volume = {2}, - number = {1}, - pages = {399--418}, - urldate = {2013-11-04}, - url = {http://www.mdpi.com/2079-7737/2/1/399}, - doi = {10.3390/biology2010399}, -} -@article{Bohan1928, - author = { ボハン, デ}, - title = { 過去及び現在に於ける英国と会 }, - journal = { 日本時報 }, - year = { 1928 }, - volume = { 17 }, - pages = { 5-9 }, - edition = { 9 }, - hyphenation = { japanese }, - language = { japanese } -} - -@article{Dubrovin1906, - author = { Дубровин, А. И }, - title = { Открытое письмо Председателя Главного Совета Союза Русского Народа Санкт-Петербургскому Антонию, Первенствующему члену Священного Синода }, - journal = { Вече }, - year = { 1906 }, - volume = { }, - edition = { 97 }, - month = { 7 дек. 1906 }, - pages = { 1-3 }, - hyphenation = { russian }, - language = { russian } -} diff --git a/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.pdf b/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.pdf Binary files differindex 675e9169438..7ad2b160ca9 100644 --- a/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.pdf +++ b/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.pdf diff --git a/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.tex b/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.tex index 467f72fd2e3..bacc45a16f0 100644 --- a/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.tex +++ b/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.tex @@ -1,12 +1,27 @@ -\documentclass{shtthesis} - +% shtthesis, an unofficial LaTeX thesis template for ShanghaiTech University. +% Copyright (C) 2020 Li Rundong <rundong.001@gmail.com> +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <https://www.gnu.org/licenses/> + +% graduate setup +\documentclass[master]{shtthesis} \shtsetup{ - degree = {master}, degree-name = {工学硕士}, degree-name* = {Master~of~Science~in~Engineering}, secret-level = {白给}, - title = {\ShtThesis~v\version~使用说明}, - title* = {A~User's~Guide\\to\\\ShtThesis~v\version}, + title = {\ShtThesis{}~v\version{}~使用说明}, + title* = {A~User's~Guide\\to\\\ShtThesis{}~v\version{}}, keywords = {上海科技大学,学位论文,\LaTeX{}}, keywords* = {ShanghaiTech~University, Thesis, \LaTeX{}}, author = {李润东}, @@ -19,9 +34,31 @@ supervisor-institution = {上海科技大学信息科学与技术学院}, discipline-level-1 = {计算机科学与技术}, discipline-level-1* = {Computer~Science~and~Technology}, + bib-resource = {reference.bib}, } -\definecolor{shtred}{RGB}{146,46,23} +% undergraduate setup +% \documentclass[bachelor, comfort]{shtthesis} +% \shtsetup{ +% title = {\ShtThesis{}~v\version{}\\使用说明}, +% title* = {A~User's~Guide~to\\\ShtThesis{}~v\version{}}, +% keywords = {上海科技大学,学位论文,\LaTeX{}}, +% keywords* = {ShanghaiTech~University, Thesis, \LaTeX{}}, +% date = {2020~年~06~月}, +% date* = {06~/~2020}, +% author = {李润东}, +% author* = {Rundong~Li}, +% author-id = {36273800}, +% entrance-year = {2017}, +% institution = {信息科学与技术学院}, +% institution* = {School~of~Information~Science~and~Technology}, +% supervisor = {范睿}, +% supervisor* = {Rui~Fan}, +% discipline = {计算机科学与技术}, +% discipline* = {Computer~Science~and~Technology}, +% bib-resource = {reference.bib}, +% } + % `latex' and `shell' environments are adapted from `thuthesis' \usepackage{listings} \newcommand\prompt{\textup{\$}} @@ -53,6 +90,8 @@ framesep=3pt, rulesep=1pt, framerule=1pt, + frame=l, + rulecolor=\color{ShtRed}, backgroundcolor=\color{gray!5}, stringstyle=\color{green!40!black!100}, keywordstyle=\bfseries\color{blue!50!black}, @@ -61,82 +100,134 @@ } \lstdefinestyle{lstStyleShell}{% style=lstStyleBase, - frame=l, - rulecolor=\color{shtred}, language=bash} \lstdefinestyle{lstStyleLaTeX}{% style=lstStyleBase, - frame=l, - rulecolor=\color{shtred}, language=[LaTeX]TeX} \lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{} \lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{} \usepackage{hologo} -\usepackage{ifluatex} -\ifluatex - \ifthenelse{\equal{\currentfontset}{windows}}{ - \newfontface\EmojiFont{Segoe UI Emoji}[Renderer=HarfBuzz] - }{ - \ifthenelse{\equal{\currentfontset}{mac}}{ - \newfontface\EmojiFont{Apple Color Emoji}[Renderer=HarfBuzz] - }{ - \newfontface\EmojiFont{Noto Color Emoji}[Renderer=HarfBuzz] - } - } +\ifluahbtex + \usepackage{emoji} \else - \providecommand{\EmojiFont}{\emph{Current \LaTeX{} engine does not support Emoji}} + \providecommand{\emoji}[1]{ \fbox{\emph{#1}} } \fi -\providecommand{\emoji}[1]{% - \begingroup% - \ifluatex% - \EmojiFont #1% - \else% - \EmojiFont% - \fi% - \endgroup% -} -\IfFontExistsTF{Times New Roman}{ - \providefontfamily\timesnewroman{Times New Roman} -}{ - \providecommand{\timesnewroman}{\emph{Times New Roman missing}} -} -\IfFontExistsTF{Times}{ - \providefontfamily\timesfamily{Times} -}{ - \providecommand{\timesfamily}{\emph{Times missing}} -} -\IfFontExistsTF{XITS-Regular.otf}{ - \providefontfamily\xitsfamily{XITS-Regular.otf} -}{ - \providecommand{\xitsfamily}{\emph{XITS missing}} -} \usepackage{subcaption} \usepackage{ctable} -\usepackage{bicaption} +\usepackage[list=off]{bicaption} \captionsetup[figure][bi-second]{name=Figure} \captionsetup[table][bi-second]{name=Table} +\makeatletter + \def\ifundergraduate{\ifsht@undergraduate} + \def\ifgraduate{\ifsht@graduate} +\makeatother + +\begin{filecontents}{reference.bib} +@article{stamerjohanns2009mathml, + title={{MathML}-aware article conversion from {LaTeX}}, + author={Stamerjohanns, Heinrich and Ginev, Deyan and David, Catalin and Misev, Dimitar and Zamdzhiev, Vladimir and Kohlhase, Michael}, + journal={Towards a Digital Mathematics Library}, + volume={16}, + number={2}, + pages={109--120}, + year={2009}, + publisher={Masaryk University Press} +} +@article{bravo1990comparative, + title={Comparative study of visual inter and intrahemispheric cortico-cortical connections in five native Chilean rodents}, + author={Bravo, Hermes and Olavarria, Jaime}, + journal={Anatomy and embryology}, + volume={181}, + number={1}, + pages={67--73}, + year={1990}, + publisher={Springer} +} +@proceedings{niu2013zonghe, + editor = {牛志明 and 斯温兰德 and 雷光春}, + key = {Niu Zhi Ming Siwenlande Lei Guang Chun}, + title = {综合湿地管理国际研讨会论文集}, + address = {北京}, + publisher = {海洋出版社}, + year = {2013}, +} +@incollection{chen1980zhongguo, + author = {陈晋镳 and 张惠民 and 朱士兴 and 赵震 and 王振刚}, + key = {Chen Jing Ao Zhang Hui Ming Zhu Shi Xing Zhao Zhen Wang Zhen Gang}, + title = {蓟县震旦亚界研究}, + editor = {中国地质科学院天津地质矿产研究所}, + booktitle = {中国震旦亚界}, + address = {天津}, + publisher = {天津科学技术出版社}, + year = {1980}, + pages = {56--114}, +} +@article{yuan2012lana, + author = {袁训来 and 陈哲 and 肖书海}, + key = {Yuan xun lai Chen zhe Xiao shu Hai}, + title = {蓝田生物群: 一个认识多细胞生物起源和早期演化的新窗口 -- 篇一}, + journal = {科学通报}, + year = {2012}, + volume = {57}, + number = {34}, + pages = {3219}, +} +@article{walls2013drought, + author = {Walls, Susan C. and Barichivich, William J. and Brown, Mary E.}, + title = {Drought, deluge and declines: the impact of precipitation extremes on amphibians in a changin climate}, + journal = {Biology}, + year = {2013}, + volume = {2}, + number = {1}, + pages = {399--418}, + urldate = {2013-11-04}, + url = {http://www.mdpi.com/2079-7737/2/1/399}, + doi = {10.3390/biology2010399}, +} +@article{Bohan1928, + author = { ボハン, デ}, + title = { 過去及び現在に於ける英国と会 }, + journal = { 日本時報 }, + year = { 1928 }, + volume = { 17 }, + pages = { 5-9 }, + edition = { 9 }, + hyphenation = { japanese }, + language = { japanese } +} +@online{bachelor2019, + author = {上海科技大学教学事务处}, + key = {shang hai ke ji da xue jiao xue shi wu chu}, + title = {本科毕业论文(设计)表格模板下载(任务书、封面、撰写模板等)}, + year = 2019, + url = {http://oaa.shanghaitech.edu.cn/2019/0321/c4666a41070/page.htm}, + urldate = {2020-06-17} +} +\end{filecontents} + \begin{document} \maketitle \frontmatter -\begin{abstract} - 本文档阐述 \shtthesis 的使用方法,包括其编译方式、文档类选项、文档类提供的功能及其他便于用户(\emph{也就是正在阅读这篇文档的您})快速撰写符合上海科技大学要求的学位论文的技术要点。 +\begin{abstract}[flattitle] + 本文档阐述 \shtthesis{} v\version{} 的使用方法,包括其编译方式、文档类选项以及提供的功能。希望能够帮助读者快速便捷地完成学位论文排版。 - \shtthesis 旨在以最简实现和最小依赖完整覆盖《上海科技大学研究生学位论文撰写规范(初稿)》的所有格式要求,且不为用户额外设限。从 v\version 起,仅需指定 documentclass 为 \shtthesis 即可满足基本排版要求。文档通过 \verb|\shtsetup| 命令统一设定学位论文信息,且仅提供满足格式需求的最少额外命令以保证兼容性。用户可根据自身撰文习惯,引入额外的宏包和命令完成学位论文撰写。 + \shtthesis{} 旨在以最简实现和最小依赖完整覆盖上海科技大学本科及研究生学位论文的所有格式要求,且不为用户额外设限。使用时仅需指定 documentclass 为 \shtthesis{} 即可满足基本排版要求。文档通过 \verb|\shtsetup| 命令统一设定学位论文信息,且仅提供满足格式需求的最少额外命令以保证兼容性。用户可根据自身撰文习惯,引入额外的宏包和命令完成学位论文撰写。 \end{abstract} -\begin{abstract*} - We elaborate on the usage of document class \shtthesis, including its compiling process, class options, provided functionalities, and other technical points to facilitate the user (that is, \emph{you}) to quickly develop their thesis to meet the format requirements of ShanghaiTech University. +\begin{abstract*}[flattitle] + We elaborate on the usage of document class \shtthesis{} v\version{}, including its compiling process, class options and provided functionalities. We hope this document can help the reader to quickly typeset his or her thesis. - \shtthesis is intended to cover all requirements in 《上海科技大学研究生学位论文撰写规范(初稿)》with minimal function set and introduce no restriction to the user. Beginning with v\version, specifying documentclass to \shtthesis is sufficient for the basic thesis typesetting requirements. This document class uses \verb|\shtsetup| to uniformly set up thesis information and only provides minimum auxiliary commands to meet all format requirements. The user can import other packages and functionalities according to their writing habits. + \shtthesis{} is intended to cover all format requirements of ShanghaiTech graduate/undergraduate thesis with minimal function set and introduce no restriction to the user. Specifying documentclass to \shtthesis{} is sufficient for the basic typesetting requirements. This document class uses \verb|\shtsetup| to uniformly set up mandatory information and only provides minimum auxiliary commands to meet all format requirements. Users can import other packages and functionalities according to their writing habits. \end{abstract*} \makeindices +\ifgraduate \begin{nomenclatures} \header[单位]{符号}{说明} \item[${m^{2} \cdot s^{-2} \cdot K^{-1}}$]{$R$}{the gas constant} @@ -162,64 +253,96 @@ \item{$\nabla$}{gradient operator} \item{$\delta^{\pm}$}{upwind-biased interpolation scheme} \end{nomenclatures} +\fi \mainmatter \chapter{模板介绍} -\shtthesis (\textbf{S}hang\textbf{h}ai\textbf{T}ech University \textbf{THESIS}) 是根据《上海科技大学研究生学位论文撰写规范(初稿)》(下文简称《规范》)编写的、适用于上海科技大学学位论文写作的\emph{非官方} \LaTeX 模板。目前版本(v\version)提供了博士、硕士学位论文排版选项,且能够自动生成用于盲审的匿名版以及最终提交的打印版论文。 +\shtthesis{} (\textbf{S}hang\textbf{h}ai\textbf{T}ech University \textbf{THESIS}) 是根据《上海科技大学研究生学位论文撰写规范(初稿)》和《上海科技大学本科毕业论文(设计)工作条例(试行)》(下文统一简称《规范》)编写的、适用于上海科技大学学位论文写作的\emph{非官方} \LaTeX 模板。目前版本(v\version{})提供了本科、硕士和博士学位论文排版选项,且能够自动生成用于盲审的匿名版以及最终提交的打印版论文。 + +本文档将尽量详细地阐释 \shtthesis{} 的使用方法和技巧。同时本文档直接使用 \shtthesis{} 排版,其源代码文件 \jobname.tex 也可以作为一个实际样例以供读者参考使用。 -这篇文档将尽量详细地阐释 \shtthesis 的使用方法和技巧。由于这篇文档直接使用 \shtthesis 排版,所以其源代码文件 \texttt{\jobname.tex} 也可以作为一个实际样例以供读者参考使用。 +我们计划在 \shtthesis{} 后续版本中加入本科学位论文的排版选项,因此亟需有上海科技大学本科论文排版经验的同学参与到 \shtthesis{} 项目中。我们也计划将该使用说明和模板文件 shtthesis.cls 使用 \textsf{DocStrip} 统一重构,并逐步向 \LaTeX3 迁移。我们非常希望得到用户宝贵的反馈和建议,若您有意为 \shtthesis{} 贡献 issues 和 pull requests,请移步至项目主页 \url{https://github.com/lirundong/shtthesis}。 -我们计划在 \shtthesis 后续版本中加入本科学位论文的排版选项,因此亟需有上海科技大学本科论文排版经验的同学参与到 \shtthesis 项目中。我们也计划将该使用说明和模板文件 \verb|shtthesis.cls| 统一重构为 \verb|.dtx| 文件。同时,我们也非常希望得到用户宝贵的反馈和建议。若您有意为 \shtthesis 贡献 issues 和 pull requests,请移步至项目主页 \url{https://github.com/lirundong/sht-thesis}。 +\section*{文档排版样式说明} +本文档针对各部分不同内容使用不同的排版样式:文档正文使用宋体和英文衬线体(serif),\emph{强调部分}使用\emph{楷体}和英文意大利体(\emph{italic}),宏包名称使用英文无衬线体(\textsf{sans serif},例如 \textsf{hyperref}),代码及选项使用英文等宽体(\texttt{typewriter})和\texttt{仿宋体}排版。 + +对于文中出现的命令说明,例如: +\begin{latex} +\foo[<bar>]{<baz>} +\end{latex} +其中,由 \verb|[]| 包裹的为命令的\emph{可选参数},由 \verb|{}| 包裹的为命令的\emph{必选参数},由 \verb|<>| 包裹的为\emph{参数名称}。在为某一参数赋值时,不必输入前后的尖括号\verb|<>|。例如,欲对 \verb|\foo| 命令设定参数 \verb|bar=this-arg|、\verb|baz=另一参数|: +\begin{latex} +\foo[this-arg]{另一参数} +\end{latex} \chapter{模板使用} \section{模板安装} -\shtthesis 提供的文档类型文件为 \verb|shtthesis.cls|,封面所需的上海科技大学校徽文件为 \verb|shanghaitech-logo.pdf|,参考文献 GBT-7714 格式文件为 \verb|shtthesis-gbt7714-plain.bst|,用户仅需将这三个文件拷贝至自己论文的工作目录下即可完成安装。假设用户的论文文件为 \verb|thesis.tex|,则工作目录中必要的文件包括: +\shtthesis{} 已经发布至 CTAN\footnote{\url{https://www.ctan.org/pkg/shtthesis}} 并已收录至 \TeX{} Live 中,推荐使用 \TeX{} Live 的包管理器 \verb|tlmgr| 直接安装: +\begin{shell} +`\prompt' tlmgr install shtthesis +\end{shell} +若当前发行版已包含 \shtthesis{},建议在使用前更新至 CTAN 上的最新版: +\begin{shell} +`\prompt' tlmgr update shtthesis +\end{shell} + +为避免版权问题,上传至 CTAN 的 \shtthesis{} 并不包含校徽文件,需要至项目主页下载 shanghaitech-logo.pdf\footnote{\url{https://github.com/lirundong/shtthesis/raw/master/shanghaitech-logo.pdf}}。假设用户的论文文档为 thesis.tex,参考文献数据库为 reference.bib (本文档的 bib 数据库由 \jobname.tex 自动生成),则需要将下载的校徽文件与它们放在同一目录下,下文称为\emph{工作目录}。工作目录中必要的文件包括: \begin{center} \begin{tabular}{ll} \toprule 文件名称 & 说明 \\ \midrule - \verb|shtthesis.cls| & 模板文档类文件 \\ - \verb|shanghaitech-logo.pdf| & 上海科技大学校徽 \\ - \verb|shtthesis-gbt7714-plain.bst| & 参考文献格式文件 \\ - \verb|thesis.tex| & 论文文件 \\ - \verb|reference.bib| & 参考文献默认文件名 \\ + thesis.tex & 论文文档 \\ + reference.bib & 参考文献数据库 \\ + shanghaitech-logo.pdf & 上海科技大学校徽 \\ \bottomrule \end{tabular} \end{center} -\paragraph{注意} -为避免版权问题,上传至 CTAN 的 \shtthesis 并不包含校徽文件。如果用户直接使用 \TeX{} Live 分发的 \shtthesis,则需要至项目主页下载校徽文件\footnote{校徽文件在 GitHub 项目下的链接为 \url{https://github.com/lirundong/shtthesis/raw/master/shanghaitech-logo.pdf}},并将 \verb|shanghaitech-logo.pdf| 与 \verb|thesis.tex| 放置在同一目录下。 - \section{文档编译} -\shtthesis 支持使用 \hologo{XeLaTeX} 和 \hologo{LuaLaTeX} 编译(注意,\emph{不支持} \hologo{pdfLaTeX})。尝试编译本文档的源代码 \texttt{\jobname.tex} 至 PDF 文件是了解 \shtthesis 编译流程最直观的方法。我们推荐在最新的 \hologo{TeX} Live 环境下,使用 \verb|latexmk| 工具进行编译。Windows 及 Linux 用户请下载安装 \hologo{TeX} Live (\url{https://www.tug.org/texlive/}),macOS 用户请下载安装 Mac\hologo{TeX} (\url{https://www.tug.org/mactex/})。不推荐在 overleaf 等在线平台编译使用 \shtthesis,项目主页不接受与 overleaf 相关的 issues。 +\shtthesis{} 支持使用 \hologo{XeLaTeX} 和 \hologo{LuaLaTeX} 编译(注意,\emph{不支持} \hologo{pdfLaTeX})。推荐在最新的 \hologo{TeX} Live 环境下,使用 \verb|latexmk| 工具进行编译。Windows 及 Linux 用户请下载安装 \hologo{TeX} Live (\url{https://www.tug.org/texlive/}),macOS 用户请下载安装 Mac\hologo{TeX} (\url{https://www.tug.org/mactex/})。\emph{非常不推荐}使用 $\mathbb{C}$\TeX 发行版(大人,时代变了\emoji{unamused}),也不推荐在 overleaf 等在线平台编译使用 \shtthesis{} (免费版用户编译时长被限制在 1 分钟,不一定能够编译完上百页的大论文)。项目主页不接受与 $\mathbb{C}$\TeX、overleaf 相关的 issues。 -在完成环境配置后,即可使用 \verb|latexmk| 工具完成编译。使用 \hologo{XeLaTeX} 引擎进行编译的命令为: +在完成环境配置后,即可使用 \verb|latexmk| 工具完成编译。打开终端(Windows 用户打开 CMD)切换至工作目录,使用 \hologo{XeLaTeX} 引擎进行编译: \begin{shell} `\prompt' latexmk -pdfxe \end{shell} -若使用 \hologo{LuaLaTeX} 引擎,则编译命令为: +若偏好使用 \hologo{LuaLaTeX} 引擎,则编译命令为: \begin{shell} `\prompt' latexmk -pdflua \end{shell} -一般来说,\hologo{XeLaTeX} 引擎的编译速度较快且占用资源较少,而 \hologo{LuaLaTeX} 引擎的编译结果似乎有更好的跨平台规范性。在 \shtthesis 开发过程中,曾出现过在 macOS 下 \hologo{XeLaTeX} 编译的 PDF 在 Windows 下无法打开,而 \hologo{LuaLaTeX} 编译结果正常的情况。若使用 LuaHB\hologo{TeX} 引擎编译,还可进一步使用 emoji 等特殊功能。例如:\emoji{ 👴🏻👴🏼👴🏽👴🏾👴🏿👴👨🏻🦳🎅🏻🦹🏻♂️🕵🏼♂️👨🏼⚕️👨🏼🌾👨🏼🍳👨🏼💼👨🏼🔧👨🏼🔬👨🏼🎨👨🏼🚒👨🏼✈️👨🏼⚖️🧔🏼🤵🏼🧙🏻♂️🧖🏼♂️👨🏼🌾👮🏼♂️👨🏼🏫👨🏼🚀}。LuaHB\hologo{TeX} 引擎是 \hologo{TeX} Live 2020 中 \hologo{LuaLaTeX} 的默认实现,在 \hologo{TeX} Live 2019 下使用 LuaHB\hologo{TeX} 的方法为: + +一般来说,\hologo{XeLaTeX} 引擎的编译速度较快且占用资源较少,而 \hologo{LuaLaTeX} 引擎的编译结果似乎有更好的跨平台规范性。在 \shtthesis{} 开发过程中,曾出现过在 macOS 下 \hologo{XeLaTeX} 编译的 PDF 在 Windows 下无法打开,而 \hologo{LuaLaTeX} 编译结果正常的情况。若使用 LuaHB\hologo{TeX} 引擎编译,还可进一步使用 Emoji 等功能。例如:\emoji{hot-pepper}\emoji{pear}\emoji{keycap-ten}\emoji{syringe}\emoji{sweat-drops}\emoji{cow-face}\emoji{beer-mug}\footnote{如果使用非 LuaHB\hologo{TeX} 引擎编译,您只能看到一堆方框……}。LuaHB\hologo{TeX} 引擎是 \hologo{TeX} Live 2020 中 \hologo{LuaLaTeX} 的默认实现,在 \hologo{TeX} Live 2019 下使用 LuaHB\hologo{TeX} 的方法为: \begin{shell} `\prompt' latexmk -pdflua -pdflualatex=lualatex-dev \end{shell} \section{载入模板类} -模板安装完成后,在论文文件 \verb|thesis.tex| 开头使用 +模板安装完成后,在论文文件 thesis.tex 开头使用 \begin{latex} -\documentclass{shtthesis} +\documentclass[<类参数>]{shtthesis} +\end{latex} +即可载入模板。\shtthesis{} 接受的类参数包括:用于指定学位类型的 \texttt{\{bachelor | master | doctor\}} 选项、用于生成盲审论文的 \verb|anonymous| 选项,用于生成打印版论文的 \verb|print| 选项,以及传递给 \textsf{cexbook} 的其他选项。多个选项间以英文逗号“,”隔开。 + +\subsection{指定学位类型} +\shtthesis{} v\version{} 接受的学位类型包括学士(bachelor)、硕士(master)和博士(doctor),学位类型必须指定且不能同时指定多种学位。指定学位类型后,\shtthesis{} 会按照相应排版规则,生成不同的封面和正文格式。 + +需要注意的是,教务处给出的本科生论文排版规范~\citep{bachelor2019} 中包含一些非常费解的内容,且一并发布的 Word 和 \LaTeX{} 模板有相当多相互矛盾的格式规范,\shtthesis{} v\version{} 中本科生论文的排版默认以教务处 Word 模板为准。 + +2020 年学位申请时,本科生收到过包含下述内容的通知: +\begin{quotation} +“如果是使用Latex版模板,保证封面与学校的word版要求完全一致,正文中的格式不要求在字号等细节方面与Word版要求严格一致,但要做到自己的论文自统一并且符合常用规范。” +\end{quotation} +因此 \shtthesis{} 为本科生论文额外提供了 \verb|comfort| 选项,在保证封面符合规范的同时优化正文的排版细节,使最终论文视觉上更为舒适统一且正式。推荐排版本科论文时使用: +\begin{latex} +\documentclass[bachelor, comfort]{shtthesis} \end{latex} -即可载入模板。\shtthesis 接受的类参数包括:用于生成盲审论文的 \verb|anonymous| 选项,用于生成打印版论文的 \verb|print| 选项,以及传递给 \textsf{cexbook} 的其他选项。 \subsection{\texttt{anonymous} 选项} \label{sec::option_anonymous} -为方便生成盲审所需的匿名版论文,在文档类传入 \verb|anonymous| 即可将论文中英文封面的作者信息、导师信息,以及附录中的作者简历替换为匿名字符串,将作者论文发表、专利申请记录替换为匿名版本,并隐去文末的致谢部分: +为方便生成研究生论文盲审时所需的匿名版论文,传入 \verb|anonymous| 类参数即可将论文中英文封面的作者信息、导师信息,以及附录中的作者简历替换为匿名字符串,将作者论文发表、专利申请记录替换为匿名版本,并隐去文末的致谢部分: \begin{latex} \documentclass[anonymous]{shtthesis} \end{latex} -\shtthesis 默认的匿名字符串为连续的三个英文星号“***”,该字符串可使通过 \verb|\shtsetup| 的 anonymous-str 选项修改: +\shtthesis{} 默认的匿名字符串为连续的三个英文星号“***”,该字符串可使通过 \verb|\shtsetup| 的 \verb|anonymous-str| 选项修改: \begin{latex} \shtsetup{ anonymous-str = XXX, % 作者、导师姓名在匿名环境下显示为 XXX @@ -234,28 +357,28 @@ \end{latex} \subsection{传递给 \textsf{ctexbook} 的其他选项} -\shtthesis 实际使用 \CTeX 宏包提供的 \textsf{ctexbook} 文档类排版,除 \verb|anonymous| 和 \verb|print| 外的其余类参数会传递给 \textsf{ctexbook}。其中需要注意的选项为 fontset,即设定论文所用的字体集。\CTeX 宏包自身能够根据编译平台选择合适的字体集,但有时会出现平台识别失败从而回退至 \TeX Live 提供的最基础的 Fandol 字体集导致缺字的情况。此时可以手动设置相应的 fontset,例如在 Windows 平台下设置 \verb|fontset=windows|,在 macOS 平台下设置 \verb|fontset=mac|: +\shtthesis{} 实际使用 \CTeX 宏包提供的 \textsf{ctexbook} 文档类排版,除上述选项外的类参数会传递给 \textsf{ctexbook}。其中需要注意的选项为 \verb|fontset|,即设定论文所用的字体集。\CTeX 宏包自身能够根据编译平台选择合适的字体集,也可以手动设置相应的 fontset,例如在 Windows 平台下设置 \verb|fontset=windows|,在 macOS 平台下设置 \verb|fontset=mac|: \begin{latex} \documentclass[fontset=windows]{shtthesis} \end{latex} -不同字符集所用字体见表~\ref{tab::fonts}。 +不同字体集所用字体见表~\ref{tab::fonts}。在 Linux/UNIX 环境下对于宋体和黑体,会首先检测思源宋体/黑体(Source Han 字体或 Noto CJK 字体)是否安装,若未检测到则回退至 Fandol 宋体/黑体;对于楷体和仿宋,则会依次检测方正楷体/仿宋-GBK 是否安装,若未检测到则退回至 Fandol 楷体/仿宋。 \begin{table}[htb] \centering - \caption{不同字符集下 \shtthesis 所用字体} + \caption{不同字符集下 \shtthesis{} 所用字体} \label{tab::fonts} \begin{subtable}{\columnwidth} \centering - \caption{\shtthesis 所用中文字体} + \caption{\shtthesis{} 所用中文字体} \label{tab::chs_fonts} - \begin{tabular}{l *{3}{c}} + \begin{tabular}{*{3}{c}} \toprule - & Windows & Mac & Fandol \\ + Windows & macOS & Linux/UNIX \\ \midrule - \songti 宋体 & \songti 中易宋体 & \songti 华文宋体简体 & \songti Fandol 宋体 \\ - \heiti 黑体 & \heiti 中易黑体 & \heiti 华文黑体简体 & \heiti Fandol 黑体 \\ - \kaishu 楷书 & \kaishu 中易楷体 & \kaishu 华文楷体简体 & \kaishu Fandol 楷体 \\ - \fangsong 仿宋 & \fangsong 中易仿宋 & \fangsong 华文仿宋简体 & \fangsong Fandol 仿宋 \\ + \songti 中易宋体 & \songti 华文宋体简体 & \songti 思源宋体 $\to$ Fandol 宋体 \\ + \heiti 中易黑体 & \heiti 华文黑体简体 & \heiti 思源黑体 $\to$ Fandol 黑体 \\ + \kaishu 中易楷体 & \kaishu 华文楷体简体 & \kaishu 方正楷体-GBK $\to$ Fandol 楷体 \\ + \fangsong 中易仿宋 & \fangsong 华文仿宋简体 & \fangsong 方正仿宋-GBK $\to$ Fandol 仿宋 \\ \bottomrule \end{tabular} \end{subtable} @@ -264,7 +387,7 @@ \newline \begin{subtable}{\columnwidth} \centering - \caption{\shtthesis 所用英文字体(全平台一致)} + \caption{\shtthesis{} 所用英文字体(全平台一致)} \label{tab::eng_fonts} \begin{tabular}{*{3}{c}} \toprule @@ -276,34 +399,19 @@ \end{subtable} \end{table} -用户可以在不显著违反《规范》的前提下按照自身需求自定义字符集(例如在排版正文英文字体时,{\rmfamily \TeX{} Gyre Termes}、{\xitsfamily XITS}、{\timesfamily Times} 和 {\timesnewroman Times New Roman} 几种字体几乎没有明显区别,见表~\ref{tab::serif_fonts}),或通过其他设置调整 \textsf{ctexbook} 的排版行为。\textsf{ctexbook} 使用方法详见 \CTeX 文档。\footnote{\url{http://mirrors.ctan.org/language/chinese/ctex/ctex.pdf}} +需要注意 Fandol 系列字体虽然为 \TeX{} Live 自带,但其字符覆盖有限,对于生僻字可能出现缺字情况。可以通过查看附录~\ref{sec::chs_rare} 确认当前编译环境所用的字体库是否有缺字风险。思源宋体\footnote{\url{https://source.typekit.com/source-han-serif/cn/}}、思源黑体\footnote{\url{https://github.com/adobe-fonts/source-han-sans}}、方正楷体-GBK\footnote{\url{https://www.foundertype.com/index.php/FontInfo/index/id/137}}和方正仿宋-GBK\footnote{\url{https://www.foundertype.com/index.php/FontInfo/index/id/128}} 均为免费字体且完整覆盖简繁扩展 (GBK) 字符集,非常推荐 Linux/UNIX 用户安装使用。 -\begin{table}[htb] - \centering - \caption{不同英文衬线字体测试} - \label{tab::serif_fonts} - \begin{tabular}{ll} - \toprule - Font Name & Content \\ - \midrule - \rmfamily \TeX{} Gyre Termes & \rmfamily The quick brown fox jumps over the lazy dog. \\ - \xitsfamily XITS & \xitsfamily The quick brown fox jumps over the lazy dog. \\ - \timesfamily Times & \timesfamily The quick brown fox jumps over the lazy dog. \\ - \timesnewroman Times New Roman & \timesnewroman The quick brown fox jumps over the lazy dog. \\ - \bottomrule - \end{tabular} -\end{table} +\section{设定论文必要信息} \label{sec::setup_info} +知晓学位类型后,\shtthesis{} 还需其他必要信息才能进行进一步排版:根据《规范》,博士学位论文和硕士学位论文需要在中英文封面中,依次列出论文密级、论文标题、作者姓名、导师信息、学位类别、一级学科、学校/学院名称及论文完成时间;根据\citet{bachelor2019},本科生学位论文需要在中英文封面中依次列出论文题目、学生姓名、学号、入学年份、学院、专业、指导教师及论文完成时间。以上信息均可通过 \verb|\shtsetup| 命令,在论文导言区(即 \verb|\documentclass| 之后、\verb|\begin{document}| 之前)以 key=value 方式统一设定。用户可以一次性调用 \verb|\shtsetup| 设定所有信息,也可分多次设定。 -\section{学位及封面信息} \label{sec::setup_info} -\shtthesis 需要知晓学位类型(v\version 支持 master 和 doctor)才能进行进一步排版;其次根据《规范》,博士学位论文和硕士学位论文需要在中英文封面中,依次列出论文密级、论文标题、作者姓名、导师信息、学位类别、一级学科、学校/学院名称及论文完成时间,并在中英文摘要之后列出论文关键词。以上信息均可通过 \verb|\shtsetup| 命令,在论文导言区(即 \verb|\documentclass| 之后、\verb|\begin{document}| 之前)以 key=value 方式统一设定。用户可以一次性调用 \verb|\shtsetup| 设定所有信息,也可分多次设定。例如: +研究生论文信息设定样例为: \begin{latex} \shtsetup{ - degree = {master}, degree-name = {工学硕士}, degree-name* = {Master~of~Science~in~Engineering}, secret-level = {白给}, - title = {\ShtThesis~v\version~使用说明}, - title* = {A~User's~Guide\\to\\\ShtThesis~v\version}, + title = {\ShtThesis{}~v\version{}~使用说明}, + title* = {A~User's~Guide\\to\\\ShtThesis{}~v\version{}}, keywords = {上海科技大学,学位论文,\LaTeX{}}, keywords* = {ShanghaiTech~University, Thesis, \LaTeX{}}, author = {李润东}, @@ -318,41 +426,76 @@ discipline-level-1* = {Computer~Science~and~Technology}, date = {2020~年~6~月}, date* = {June,~2020}, + bib-resource = {reference.bib}, +} +\end{latex} + +本科生论文信息设定样例为: +\begin{latex} +\shtsetup{ + title = {\ShtThesis{}~v\version{}\\使用说明}, + title* = {A~User's~Guide~to\\\ShtThesis{}~v\version{}}, + keywords = {上海科技大学,学位论文,\LaTeX{}}, + keywords* = {ShanghaiTech~University, Thesis, \LaTeX{}}, + date = {2020~年~06~月}, + date* = {06~/~2020}, + author = {李润东}, + author* = {Rundong~Li}, + author-id = {36273800}, + entrance-year = {2017}, + institution = {信息科学与技术学院}, + institution* = {School~of~Information~Science~and~Technology}, + supervisor = {范睿}, + supervisor* = {Rui~Fan}, + discipline = {计算机科学与技术}, + discipline* = {Computer~Science~and~Technology}, + bib-resource = {reference.bib}, } \end{latex} -其中,表示中文信息条目的 key 为 \verb|-| 连接的小写单词(例如 \verb|degree-name|),由 \verb|*| 结尾的 key 一般表示对应的英文条目(例如 \verb|degree-name*|);value 可以在前后添加大括号,也可以不添加。特别需要注意 \verb|\shtsetup| 命令内\emph{不能有空行}。 + +在 \verb|\shtsetup| 的 key=value 设定机制中,表示中文信息条目的 key 为 \verb|-| 连接的小写单词(例如研究生学位中文名称 \verb|degree-name|),由 \verb|*| 结尾的 key 一般表示对应的英文条目(例如研究生学位英文名称 \verb|degree-name*|);value 可以在前后添加大括号,也可以不添加。特别需要注意 \verb|\shtsetup| 命令内\emph{不能有空行}。 \subsection{学位信息} -需要设定的学位信息包括:学位类型(degree)、学位名称(degree-name)和英文学位名称(degree-name*),具体见表~\ref{tab::degree_info}。学位类型会影响 \shtthesis 的中英文封面内容。 +研究生学位论文需要额外设定的学位信息包括:学位名称(degree-name)和英文学位名称(degree-name*),具体见表~\ref{tab::degree_info}。学位类型会影响 \shtthesis{} 的中英文封面内容。 \begin{table}[htb] \centering \caption{通过\texttt{shtsetup}设定的学位信息} \label{tab::degree_info} -\small \begin{tabular}{llp{0.5\columnwidth}} \toprule key & value 样例 & 说明 \\ \midrule - degree & doctor & v\version 目前支持硕士(master)和博士(doctor)论文排版 \\ - degree-name & 学术型博士 & 中文学位名称,《规范》中学术型学位中文名称包括:学术型博士、理学硕士、工学硕士 \\ - degree-name* & Doctor~of~Philosophy & 英文学位名称,《规范》中上述学位对应的英文名称为:Doctor~of~Philosophy、Master~of~Natural~Science、Master~of~Science~in~Engineering \\ + degree-name & 学术型博士 & 中文学位名称,《规范》中学术型学位中文名称包括:\emph{学术型博士}、\emph{理学硕士}、\emph{工学硕士} \\ + degree-name* & Doctor~of~Philosophy & 英文学位名称,《规范》中上述学位对应的英文名称为:\emph{Doctor~of~Philosophy}、\emph{Master~of~Natural~Science}、\emph{Master~of~Science~in~Engineering} \\ \bottomrule \end{tabular} \end{table} \subsection{论文标题信息} -设定论文中英文标题和涉密等级。中文标题(title)和英文标题(title*)中可以包含换行符。涉密等级(secret-level)会以“密级:\uline{XXX}”显示在中文封面右上角,未设定涉密等级则不显示相关信息。 +设定论文中英文标题和涉密等级。中文标题(title)和英文标题(title*)中可以包含换行符。研究生学位论文的涉密等级(secret-level)会以“密级:\uline{XXX}”显示在中文封面右上角,未设定涉密等级则不显示相关信息。 \subsection{作者信息} -需要设定的作者信息包括:作者中英文姓名(author 和 author*)、一级学科中英文名称(discipline-level-1 和 discipline-level-1*)和学校/学院中英文名称(institution 和 institution*)。注意《规范》要求以姓氏拼音在前、名字拼音在后、中间以半角空格分隔的格式书写英文姓名。 +需要设定的作者信息包括:作者中英文姓名(author 和 author*)和学校/学院中英文名称(institution 和 institution*),研究生需要设定一级学科中英文名称(discipline-level-1 和 discipline-level-1*),本科生需要设定攻读专业中英文名称(discipline 和 discipline*)。 + +特别注意研究生和本科生的英文名格式要求不一致:研究生要求以姓氏拼音在前、名字拼音在后、中间以半角空格分隔的格式书写英文姓名: \begin{latex} \shtsetup{ + % 研究生中英文姓名格式要求 author = 李润东, author* = {Li~Rundong}, % 正确写法 % author* = {Rundong~Li}, % 错误写法 } \end{latex} +而本科生要求以名字拼音在前、姓氏拼音在后、中间以半角空格分隔的格式书写英文姓名: +\begin{latex} +\shtsetup{ + % 本科生中英文姓名格式要求 + author = 李润东, + author* = {Rundong~Li}, % 正确写法 + % author* = {Li~Rundong}, % 错误写法 +} +\end{latex} -在设定学校/学院名称时,中文名称(institution)不可带换行符,英文名称(institution*)应在学院、学校名称间加入换行符,否则封面排版会出现错误。 +研究生需要设定完整的学校、学院名称,中文名称(institution)不可带换行符,英文名称(institution*)应在学院、学校名称间加入换行符,否则封面排版会出现错误: \begin{latex} \shtsetup{ institution = 上海科技大学信息科学与技术学院, @@ -360,6 +503,13 @@ ShanghaiTech~University}, } \end{latex} +本科生则不必包含学校名称,直接设定学院名称即可,注意中英文名称中均不能包含换行符: +\begin{latex} +\shtsetup{ + institution = 信息科学与技术学院, + institution* = {School~of~Information~Science~and~Technology}, +} +\end{latex} \subsection{导师信息} 需要设定的导师信息包括:导师中英文姓名(supervisor 和 supervisor*)和导师单位中文名称(supervisor-institution)。注意在中文封面中,导师姓名和单位分两行显示在“指导教师”条目下。根据《规范》,导师中文姓名(supervisor)应包含导师职称,如教授、副教授、助理教授、研究员、副研究员,以一个半角空格跟随在姓名之后;导师英文姓名(supervisor*)则统一以“Professor”开头,与英文姓名以一个半角空格隔开。导师单位中文名称(supervisor-institution)不可包含换行符。 @@ -372,19 +522,26 @@ \end{latex} \subsection{成文日期} -通过 date 和 date* 分别设置中英文成文日期,日期内容请参考《规范》,日期格式为: +通过 date 和 date* 分别设置中英文成文日期,日期内容应按照申请学位的时间节点填写,具体请参考当年《规范》。研究生成文日期格式为: \begin{latex} \shtsetup{ date = {2020~年~6~月}, date* = {June,~2020}, } \end{latex} +本科生成文日期格式为: +\begin{latex} +\shtsetup{ + date = {2020~年~06~月}, + date* = {06~/~2020}, +} +\end{latex} \section{前言部分} -《规范》规定论文前言部分应包含论文原创性声明和授权使用声明、中英文摘要、目录及图形、表格列表。若有需要,可加入符号列表。\shtthesis 会自动生成目录和图表列表,在不设置 \verb|anonymous| 选项时会自动生成声明页。\shtthesis 提供了摘要和符号列表环境,以便于用户生成中英文摘要和符号列表。 +《规范》规定论文前言部分应包含论文原创性声明和授权使用声明、中英文摘要、目录,研究生论文还需包含图形、表格列表。若有需要,可加入符号列表。\shtthesis{} 会自动生成目录和图表列表,在不设置 \verb|anonymous| 选项时会自动生成声明页。\shtthesis{} 提供了摘要和符号列表环境,以便于用户生成中英文摘要和符号列表。 \subsection{论文摘要及关键词} -论文中英文摘要在正文部分 \verb|\frontmatter| 之后、\verb|\makeindices| 之前,分别在 \verb|abstract| 和 \verb|abstract*| 环境中输入。摘要环境对内容没有限制。 +论文中英文摘要在正文部分 \verb|\frontmatter| 之后、\verb|\makeindices| 之前,分别在 abstract 和 abstract* 环境中输入。摘要环境对内容没有限制: \begin{latex} \begin{abstract} 中文摘要内容... @@ -395,7 +552,15 @@ \end{abstract*} \end{latex} -论文中英文关键词在 \verb|\shtsetup| 命令中分别以 keywords 和 keywords* 设定。注意 \shtthesis v\version 中尚未实现分词处理,此处输入的 value 会不经任何预处理,直接插入至正文中排版。因此,中文关键词(keywords)之间应该以中文逗号“,”隔开且不包含空格;英文关键词(keywords*)之间应该以半角逗号“,”隔开,并在每一半角逗号后跟随一个半角空格。 +需要注意,本科生论文要求在中英文摘要中包含论文标题。默认情况下,\shtthesis 的 abstract 和 abstract* 环境会按照 \verb|\shtsetup| 中指定的标题及其中的换行符进行排版。如果希望在摘要中显示的标题不换行,则可以向摘要环境传入 \verb|flattitle| 选项,排版时会将 title 和 title* 中的换行符替换为空格: +\begin{latex} +\begin{abstract}[flattitle] + % 摘要标题排版时不换行 + 中文摘要内容... +\end{abstract} +\end{latex} + +论文中英文关键词在 \verb|\shtsetup| 命令中分别以 keywords 和 keywords* 设定。注意 \shtthesis{} v\version{} 中尚未实现分词处理,此处输入的 value 将不经任何预处理,直接插入至正文中排版。因此,中文关键词(keywords)之间应该以中文逗号“,”隔开且不包含空格;英文关键词(keywords*)之间应该以半角逗号“,”隔开,并在每一半角逗号后跟随一个半角空格。 \begin{latex} \shtsetup{ keywords = {上海科技大学,学位论文,\LaTeX{}}, @@ -404,7 +569,7 @@ \end{latex} \subsection{目录及图形、表格、符号列表} -\shtthesis 重载了 \verb|\makeindices| 命令,可一次生成目录、图形列表和表格列表。默认目录中正文标题列出至第 3 级(即 subsection),若包含附录则目录中只列出“附录”一项(附录各级标题仍会生成 PDF 书签),图形、表格列表中列出图表标题的全部内容。对于特别长的图形、表格标题,可以在 \verb|\caption| 命令中指定短标题,从而使列表条目更为简明: +\shtthesis{} 重载了 \verb|\makeindices| 命令,可一次生成目录、图形列表和表格列表。默认目录中正文标题列出至第 3 级(即 subsection),若包含附录则目录中只列出“附录”一项(附录各级标题仍会生成 PDF 书签),图形、表格列表中列出图表标题的全部内容。对于特别长的图形、表格标题,可以在 \verb|\caption| 命令中指定短标题,从而使列表条目更为简明: \begin{latex} \begin{figure} \caption[出现在图形列表内的短标题]{出现在正文中的长标题} @@ -412,33 +577,95 @@ \end{figure} \end{latex} -\shtthesis 提供了 \verb|nomenclatures| 环境用于生成符号列表,使用方法为: +\shtthesis{} 提供了 nomenclatures 环境用于在研究生论文中生成符号列表,其使用方法为: \begin{latex} -\begin{nomenclatures}[`\emph{caption}'] - \head[`\emph{unitCap}']{`\emph{symbCap}'}{`\emph{descriptionCap}'} - \item[`\emph{unit}']{`\emph{symb}'}{`\emph{description}'} +\begin{nomenclatures}[<标题>] + \head[<单位表头>]{<符号表头>}{<描述表头>} + \item[<单位>]{<符号>}{<描述>} % ... \end{nomenclatures} \end{latex} -每次 \verb|nomenclatures| 调用会分别生成一组符号列表,每一 \verb|\item| 会生成一行符号描述。若 caption 不为空则会为当前组生成一个不编号的 section 级的标题。\verb|\head| 为可选指令,会为当前组生成一个“表头”,但必须在 \verb|\item| 之前列出。\verb|\item| 接受一个可选参数 unit 作为符号的单位,若其不为空则在当前行右对齐出现。\verb|nomenclatures| 的使用样例可以参考 \texttt{\jobname.tex} 中“符号列表”部分。注意在 \shtthesis v\version 中 \verb|\item| 的 description 折行后会出现排版错误,故暂时不支持较长的符号描述。 +每次 nomenclatures 调用会分别生成一组符号列表,每一 \verb|\item| 会生成一行符号描述。若 \verb|<标题>| 不为空则会为当前组生成一个不编号的 section 级的标题。\verb|\head| 为可选指令,会为当前组生成一个“表头”,但必须在 \verb|\item| 之前列出。\verb|\item| 接受一个可选参数 \verb|<单位>| 作为符号的单位,若其不为空则在当前行右对齐出现。nomenclatures 的使用样例可以参考 \jobname.tex 中“符号列表”部分。注意在 \shtthesis{} v\version{} 中各 \verb|\item| 的 \verb|<描述>| 在折行后会出现排版错误,故暂时不支持较长的符号描述。 \section{正文部分} -\shtthesis 正文部分的书写与一般 \LaTeX 项目无异。为保证兼容性,\shtthesis 除修改公式编号格式以符合《规范》要求外,不提供证明、定理等任何额外环境。文献引用目前只支持“著者——出版年”格式。 +\shtthesis{} 正文部分的书写与一般 \LaTeX 项目无异。\shtthesis{} 为研究生论文修改公式编号格式以符合《规范》要求,并提供编号定理、证明等常用数学环境。文献引用遵循 GB/T 7714-2015 《信息与文献 参考文献著录规则》标准,其中本科论文使用顺序编码制,研究生论文使用“著者-出版年”制。 \subsection{编号公式} -\shtthesis 通过 \textsf{mathtools} 宏包在公式编号前添加 $\ldots$ 以符合《规范》对公式编号的格式要求,如: +在排版研究生论文时,\shtthesis{} 通过 \textsf{mathtools} 宏包在公式编号前添加 $\ldots$ 以符合《规范》对公式编号的格式要求,如: \begin{align} P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian} \end{align} -同时重载了 \verb|\eqref|,使得公式编号格式修改后,其引用仍与 \textsf{amsmath} 无异:贝叶斯定理~\eqref{eq::bayesian}。 +同时重载了 \verb|\eqref|,使得公式编号格式修改后,其引用格式仍与 \textsf{amsmath} 无异:贝叶斯定理~\eqref{eq::bayesian}。排版本科生论文时不修改公式编号格式。 + +\subsection{数学环境} +\shtthesis 通过 \textsf{amsthm} 宏包定义了常用的数学环境和证明环境,如表~\ref{tab::math_envs} 所列。其中,英文表示 tex 文档内调用的环境名称,中文表示排版后论文中显示的环境名称。 + +\begin{table}[htb] +\centering +\caption{\shtthesis 提供的数学环境} +\label{tab::math_envs} +\begin{tabular}{*{5}{c}} + \toprule + theorem & lemma & corollary & proposition & conjecture \\ + 定理 & 引理 & 推论 & 命题 & 猜想 \\ + \midrule + definition & axiom & example & problem & exercise \\ + 定义 & 公理 & 例 & 问题 & 练习 \\ + \midrule + remark & & & & \\ + 注 & & & & \\ + \bottomrule +\end{tabular} +\end{table} + +\begin{theorem}[Unicode-CJK 覆盖定理] + Unicode 能够编码绝大多数东亚文字和符号。 +\end{theorem} + +\begin{corollary} + Unicode 能够编码我国《汉字内码扩展规范》中的所有字符。 +\end{corollary} + +\begin{corollary} + Unicode 也能够编码韩文和日文字符。 +\end{corollary} + +\begin{example} + “你好”在 Unicode 中的编码 (codepoints) 为 \verb|U+4F60| 和 \verb|U+597D|。 +\end{example} + +\begin{example} + 「こんにちは」在 Unicode 中的编码 (codepoints) 为 \verb|U+3053|、 \verb|U+3093|、 \verb|U+306B|、 \verb|U+3061| 和 \verb|U+306F|。 +\end{example} + +\begin{proof} + 留作练习。 +\end{proof} + +\begin{remark} + 有兴趣的读者可以查阅 Unicode 规范 (\url{https://home.unicode.org/})。 +\end{remark} \subsection{文献引用} \label{sec::citation} -\shtthesis 目前仅通过 \textsf{natbib} 支持“著者——出版年”格式的引用,可以使用 \verb|\citet| 进行文本形式的引用 \citet{Bohan1928},使用 \verb|\citep| 进行括号形式的引用 \citep{yuan2012lanc},以及使用 \verb|\citeyear| 进行年份引用 \citeyear{walls2013drought}。当引用内容是组成正文的一部分时,应使用文本形式的引用,否则使用括号形式的引用。一个实用的区分技巧是,如果你在做口头介绍时会说出引用内容,就应使用文本形式的引用,否则使用括号形式的引用。 +\shtthesis{} 通过 \textsf{biblatex} 宏包及 \textsf{biblatex-gb7714-2015} 格式支持符合 GB/T 7714-2015 标准的文献引用。本科生论文使用顺序编码制,研究生论文使用“著者-出版年”制。 -\shtthesis 默认使用的参考文献文件为 reference.bib,若使用其他文件则需在 \verb|\makebiblio| 命令后指明 +\paragraph{顺序编码制} +使用一般引用 \verb|\cite| 的编码显示为上标,例如~\cite{stamerjohanns2009mathml, yuan2012lana}。也可以使用行内引用 \verb|\inlinecite| 将引用编码排版至正文,例如 \inlinecite{Bohan1928}。参考文献列表按照各条目在正文中被引用顺序排列。 + +\paragraph{“著者-出版年”制} +使用 \verb|\citet| 进行文本形式的引用 \citet{Bohan1928},使用 \verb|\citep| 进行括号形式的引用 \citep{yuan2012lana},使用 \verb|\citeauthor| 进行作者引用 \citeauthor{niu2013zonghe},以及使用 \verb|\citeyear| 进行年份引用 \citeyear{walls2013drought}。参考文献列表各条目按照语言分组后,按照字母序排列。 + +\shtthesis{} 通过 \verb|\shtsetup| 的 bib-resource 选项指定参考文献数据库,例如载入 reference.bib 文件: \begin{latex} -\makebiblio[mybiblio] % 读取 mybiblio.bib 文件 +\shtsetup{ + bib-resource = {reference.bib}, +} +% ... +\begin{document} + % ... + \makebiblio \end{latex} + 需要注意若文献条目的作者姓名非英文,则需额外增加 key 字段指定作者英文姓名,并在姓氏拼英后加注音调,以确保文献条目在文末的参考文献中正确排列。例如 \citet{bravo1990comparative} 无需额外处理,而 \citet{chen1980zhongguo} 对应的 bib 条目需修改为 \begin{latex} @incollection{chen1980zhongguo, @@ -455,7 +682,7 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian} \end{latex} \subsection{列表环境} -\shtthesis 微调了编号列表(\verb|enumerate|)和非编号列表(\verb|itemize|)环境,以适应中文排版惯例。编号列表默认使用数字编号: +\shtthesis{} 微调了编号列表(enumerate)和非编号列表(itemize)环境,以适应中文排版惯例。编号列表默认使用数字编号: \begin{enumerate} \item 起来,饥寒交迫的奴隶! \item 起来,全世界受苦的人! @@ -477,7 +704,7 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian} \item 就一定要实现! \end{enumerate} -关键字(\verb|description|)环境在每一条目关键字后增加了加粗全角冒号“\textbf{:}”以适应中文排版惯例。例如:《中华人民共和国劳动法》 +关键字(description)环境在每一条目关键字后增加了加粗全角冒号“\textbf{:}”以适应中文排版惯例。例如:《中华人民共和国劳动法》 \begin{description} \item[第一章第三条] 劳动者享有平等就业和选择职业的权利、取得劳动报酬的权利、休息休假的权利、获得劳动安全卫生保护的权利、接受职业技能培训的权利、享受社会保险和福利的权利、提请劳动争议处理的权利以及法律规定的其他劳动权利。 \item[第四章第三十六条] 国家实行劳动者每日工作时间不超过八小时、平均每周工作时间不超过四十四小时的工时制度。 @@ -492,15 +719,20 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian} \IfFileExists{shanghaitech-logo.pdf}{% \includegraphics[width=0.5\columnwidth]{shanghaitech-logo.pdf}% }{% - \missingfigure{\small 校徽文件 \texttt{shanghaitech-logo.pdf} 缺失}% + \fbox{% + \begin{minipage}[b][2.5cm][c]{0.75\columnwidth}% + \centering\zihao{-5}\bfseries\sffamily\color{ShtRed}% + 校徽文件 \texttt{shanghaitech-logo.pdf} 缺失% + \end{minipage}% + }% }% \bicaption{上海科技大学校徽}{School logo of ShanghaiTech University} \label{img::sht_logo} \end{figure} -由于在排版较长的、自包含的图表标题时,使用双语图表标题会导致可读性下降,\shtthesis 默认不载入 \textsf{bicaption} 宏包。( \shtthesis 作者在 2020 年学位申请时并未使用双语标题。)若确实需要双语标题,可在导言区内手动载入并设定 \textsf{bicaption}: +由于在排版较长的、自包含的图表标题时,使用双语图表标题会导致可读性下降,\shtthesis{} 默认不载入 \textsf{bicaption} 宏包。( \shtthesis{} 作者在 2020 年学位申请时并未使用双语标题。)若确实需要双语标题,可在导言区内手动载入 \textsf{bicaption}。注意需要设定 \verb|list=off| 以确保英文标题不出现在图表列表中: \begin{latex} -\usepackage{bicaption} +\usepackage[list=off]{bicaption} \captionsetup[figure][bi-second]{name=Figure} \captionsetup[table][bi-second]{name=Table} \end{latex} @@ -513,10 +745,10 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian} % ... \end{latex} -《规范》要求在文末依此列出致谢、作者简历、攻读学位期间发表的论文与研究成果。用户可使用 \shtthesis 提供的相应环境 \verb|acknowledgement|、\verb|resume|、\verb|publications|、\verb|patterns| 和 \verb|projects| 进行排版。同时为了生成符合盲审要求的论文,\shtthesis 也提供了对应的\emph{匿名环境} \verb|publications*|、\verb|patterns*| 和 \verb|projects*|。在打开 \verb|anonymous| 选项(第~\ref{sec::option_anonymous} 节)后,论文中不出现“致谢”一节,作者简历内容替换为匿名字符串,其他小节使用匿名环境内容排版。注意在第一次使用任一上述环境前,需要使用 \verb|\backmatter| 切换至后记模式。 +《规范》要求在文末依此列出致谢、作者简历、攻读学位期间发表的论文与研究成果。用户可使用 \shtthesis{} 提供的相应环境 acknowledgement、resume、publications、patterns 和 projects 进行排版。同时为了生成符合盲审要求的论文,\shtthesis{} 也提供了对应的\emph{匿名环境} publications*、patterns* 和 projects*。在打开 \verb|anonymous| 选项(第~\ref{sec::option_anonymous} 节)后,论文中不出现“致谢”一节,作者简历内容替换为匿名字符串,其他小节使用匿名环境内容排版。注意在第一次使用任一上述环境前,需要使用 \verb|\backmatter| 切换至后记模式。 \subsection{致谢} -在 \verb|acknowledgement| 环境内书写致谢,致谢内容在匿名模式下不显示。 +在 acknowledgement 环境内书写致谢,致谢内容在匿名模式下不显示。 \begin{latex} \begin{acknowledgement} 致谢信息…… @@ -524,7 +756,7 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian} \end{latex} \subsection{简历及科研成果} -此部分需要依此书写个人简历(\verb|resume| 环境)、已发表(或正式接受)的学术论文(\verb|publications| 和 \verb|publications*| 环境)、申请或已获得的专利(\verb|patterns| 和 \verb|patterns*| 环境)、参加的研究项目及获奖情况(\verb|projects| 和 \verb|projects*|)。根据是否匿名分别显示非匿名环境内容和匿名环境内容。 +此部分需要依此书写个人简历(resume 环境)、已发表(或正式接受)的学术论文(publications 和 publications* 环境)、申请或已获得的专利(patterns 和 patterns* 环境)、参加的研究项目及获奖情况(projects 和 projects*)。根据是否匿名分别显示非匿名环境内容和匿名环境内容。 \begin{latex} \begin{resume} 个人简历…… (仅非匿名环境显示) @@ -578,7 +810,7 @@ Ordinary math: $A,F,L,2,3,5,\sigma$. \verb|\mathrm|: $\mathrm{A,F,L,2,3,5,\sigma \verb|\mathcal|: $\mathcal{A,F,L,2,3,5,\sigma}$. \verb|\mathscr|: $\mathscr{A,F,L,2,3,5,\sigma}$. -\section{排版生僻字} +\section{排版生僻字} \label{sec::chs_rare} {\songti 叧叨叭叱叴叵叺叻叼叽叾卟叿吀吁吂吅吆吇吋吒吔吖吘吙吚吜吡吢吣吤吥吧吩吪吭吮吰吱吲呐吷吺吽呁呃呄呅呇呉呋呋呌呍呎呏呐呒呓呔呕呗呙呚呛呜呝呞呟呠呡呢呣呤呥呦呧周呩呪呫呬呭呮呯呰呱呲呴呶呵呷呸呹呺呻呾呿咀咁咂咃咄咅咇咈咉咊咋咍咎咐咑咓咔咕咖咗咘咙咚咛咜咝咞咟咠咡咢咣咤咥咦咧咨咩咪咫咬咭咮咯咰咲咳咴咵咶啕咹咺咻呙咽咾咿哂哃哅哆哇哈哊哋哌哎哏哐哑哒哓哔哕哖哗哘哙哚哛哜哝哞哟哠咔哣哤哦哧哩哪哫哬哯哰唝哵哶哷哸哹哻哼哽哾哿唀唁唂唃呗唅唆唈唉唊唋唌唍唎唏唑唒唓唔唣唖唗唘唙吣唛唜唝唞唟唠唡唢唣唤唥唦唧唨唩唪唫唬唭唯唰唲唳唴唵唶唷念唹唺唻唼唽唾唿啀啁啃啄啅啇啈啉啋啌啍啎问啐啑啒启啔啕啖啖啘啙啚啛啜啝哑启啠啡唡衔啥啦啧啨啩啪啫啬啭啮啯啰啱啲啳啴啵啶啷啹啺啻啼啽啾啿喀喁喂喃善喅喆喇喈喉喊喋喌喍喎喏喐喑喒喓喔喕喖喗喙喛喞喟喠喡喢喣喤喥喦喨喩喯喭喯喰喱哟喳喴喵営喷喸喹喺喼喽喾喿嗀嗁嗂嗃嗄嗅呛啬嗈嗉唝嗋嗌嗍吗嗏嗐嗑嗒嗓嗕嗖嗗嗘嗙呜嗛嗜嗝嗞嗟嗠嗡嗢嗧嗨唢嗪嗫嗬嗭嗮嗰嗱嗲嗳嗴嗵哔嗷嗸嗹嗺嗻嗼嗽嗾嗿嘀嘁嘂嘃嘄嘅嘅嘇嘈嘉嘊嘋嘌喽嘎嘏嘐嘑嘒嘓呕嘕啧嘘嘙嘚嘛唛嘝嘞嘞嘟嘠嘡嘢嘣嘤嘥嘦嘧嘨哗嘪嘫嘬嘭唠啸囍嘴哓嘶嘷呒嘹嘺嘻嘼啴嘾嘿噀噂噃噄咴噆噇噈噉噊噋噌噍噎噏噐噑噒嘘噔噕噖噗噘噙噚噛噜咝噞噟哒噡噢噣噤哝哕噧噩噪噫噬噭噮嗳噰噱哙噳喷噵噶噷吨噺噻噼噽噾噿咛嚁嚂嚃嚄嚅嚆吓嚈嚉嚊嚋哜嚍嚎嚏尝嚑嚒嚓嚔噜嚖嚗嚘啮嚚嚛嚜嚝嚞嚟嚠嚡嚢嚣嚤呖嚧咙嚩咙嚧嚪嚫嚬嚭嚯嚰嚱亸喾嚵嘤嚷嚸嚹嚺嚻嚼嚽嚾嚿啭嗫嚣囃囄冁囆囇呓囊囋囍囎囏囐嘱囒啮囔囕囖} {\heiti 圠圡圢圤圥圦圧圩圪圫圬圮圯地圱圲圳圴圵圶圷圸圹圻圼埢鴪址坁坂坃坄坅坆坈坉坊坋坌坍坒坓坔坕坖坘坙坜坞坢坣坥坧坨坩坪坫坬坭坮坯垧坱坲坳坴坶坸坹坺坻坼坽坾坿垀垁垃垅垆垇垈垉垊垌垍垎垏垐垑垓垔垕垖垗垘垙垚垛垜垝垞垟垠垡垤垥垧垨垩垪垫垬垭垮垯垰垱垲垲垳垴埯垶垷垸垹垺垺垻垼垽垾垽垿埀埁埂埃埄埅埆埇埈埉埊埋埌埍城埏埐埑埒埓埔埕埖埗埘埙埚埛野埝埞域埠垭埢埣埤埥埦埧埨埩埪埫埬埭埮埯埰埱埲埳埴埵埶执埸培基埻崎埽埾埿堀堁堃堄坚堆堇堈堉垩堋堌堍堎堏堐堑堒堓堔堕垴堗堘堙堚堛堜埚堞堟堠堢堣堥堦堧堨堩堫堬堭堮尧堰报堲堳场堶堷堸堹堺堻堼堽堾堼堾碱塀塁塂塃塄塅塇塆塈塉块茔塌塍塎垲塐塑埘塓塕塖涂塘塙冢塛塜塝塟塠墘塣墘塥塦塧塨塩塪填塬塭塮塯塰塱塲塳塴尘塶塷塸堑塺塻塼塽塾塿墀墁墂墄墅墆墇墈墉垫墋墌墍墎墏墐墒墒墓墔墕墖墘墖墚墛坠墝增墠墡墢墣墤墥墦墧墨墩墪樽墬墭堕墯墰墱墲坟墴墵垯墷墸墹墺墙墼墽垦墿壀壁壂壃壄壅壆坛壈壉壊垱壌壍埙壏壐壑壒压壔壕壖壗垒圹垆壛壜壝垄壠壡坜壣壤壥壦壧壨坝塆圭} @@ -589,11 +821,12 @@ Ordinary math: $A,F,L,2,3,5,\sigma$. \verb|\mathrm|: $\mathrm{A,F,L,2,3,5,\sigma \backmatter \begin{acknowledgement} -\shtthesis 派生于中国科学院大学论文模板 \textsf{ucasthesis}\footnote{\url{https://github.com/mohuangrui/ucasthesis},使用 GPLv3 许可证分发。},v0.2.0 开发过程中参考了清华大学论文模板 \textsf{thuthesis}\footnote{\url{https://github.com/tuna/thuthesis},使用 LPPL-1.3c 许可证分发},特别是 \verb|\thusetup| 命令的设计和实现。这些项目中流淌的智慧,以及项目作者们的专业态度和共享精神使得 \shtthesis 的开发及完善成为可能。 +\shtthesis{} 派生于中国科学院大学论文模板 \textsf{ucasthesis}\footnote{\url{https://github.com/mohuangrui/ucasthesis},使用 GPLv3 许可证分发。};v0.2.0 开发过程中参考了清华大学论文模板 \textsf{thuthesis}\footnote{\url{https://www.ctan.org/pkg/thuthesis},使用 LPPL-1.3c 许可证分发。},特别是 \verb|\thusetup| 命令的设计和实现;v0.3.0 及后续版本开发过程中参考了复旦大学论文模板 \textsf{fduthesis}\footnote{\url{https://www.ctan.org/pkg/fduthesis},使用 LPPL-1.3c 许可证分发。},以及其超链接配色方案。这些项目中流淌的智慧,以及项目作者们的专业态度和共享精神使得 \shtthesis{} 的开发及完善成为可能。 \end{acknowledgement} +\ifgraduate \begin{resume} - 李润东,\shtthesis 项目初版作者及维护者,热爱摸鱼。 + 李润东,\shtthesis{} 项目初版作者及维护者,热爱摸鱼。 \end{resume} \begin{publications} @@ -615,5 +848,6 @@ Ordinary math: $A,F,L,2,3,5,\sigma$. \verb|\mathrm|: $\mathrm{A,F,L,2,3,5,\sigma \begin{projects} 个人参与的科研项目、获奖情况…… (仅非匿名环境显示) \end{projects} +\fi \end{document} diff --git a/Master/texmf-dist/tex/latex/shtthesis/shtthesis.cls b/Master/texmf-dist/tex/latex/shtthesis/shtthesis.cls index ecaa022e92b..da48bb990bb 100644 --- a/Master/texmf-dist/tex/latex/shtthesis/shtthesis.cls +++ b/Master/texmf-dist/tex/latex/shtthesis/shtthesis.cls @@ -1,19 +1,42 @@ +% shtthesis, an unofficial LaTeX thesis template for ShanghaiTech University. +% Copyright (C) 2020 Li Rundong <rundong.001@gmail.com> +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <https://www.gnu.org/licenses/> % ============================================================================== % Identification % ============================================================================== \NeedsTeXFormat{LaTeX2e} +\newcommand\version{0.3.0} +\newcommand\versiondate{2020/06/23} \ProvidesClass{shtthesis}[% - 2020/06/05 % - v0.2.0 % + \versiondate\space% + v\version\space% An Unofficial Thesis Template for ShanghaiTech University% ] \hyphenation{sht-thesis} \hyphenation{Sht-Thesis} -\RequirePackage{xspace} -\newcommand\shtthesis{\textup{\sffamily shtthesis}\xspace} -\newcommand\ShtThesis{\textup{\sffamily ShtThesis}\xspace} -\newcommand\version{0.2.0\xspace} -\newcommand\versiondate{2020/06/05\xspace} +\newcommand\shtthesis{\textup{\sffamily shtthesis}} +\newcommand\ShtThesis{\textup{\sffamily ShtThesis}} +\def\sht@compile@err@help{% + Pass `-pdflua' or `-pdfxe' option to `latexmk' on compilation.% +} +\newcommand\sht@error[2][\sht@compile@err@help]{\ClassError{shtthesis}{#2}{#1}} +\newcommand\sht@warning[1]{\ClassWarning{shtthesis}{#1}} +\RequirePackage{iftex} +\ifluatex\else\ifxetex\else% + \sht@error{shtthesis only works with LuaLaTeX or XeLaTeX}% +\fi\fi % ============================================================================== % Options and Declarations % ============================================================================== @@ -28,14 +51,6 @@ % thuthesis (https://github.com/xueruini/thuthesis) is licensed under the % conditions of the LaTeX Project Public License, either version 1.3. % ------------------------------------------------------------------------------ -\SetupKeyvalOptions{ - family = sht, - prefix = {sht@}, - setkeys = \kvsetkeys, -} -\newcommand\sht@error[1]{% - \ClassError{shtthesis}{#1}{}% -} \newcommand\shtsetup{% \kvsetkeys{sht}% } @@ -106,22 +121,6 @@ % Options for \shtsetup % ------------------------------------------------------------------------------ \sht@define@key{ - degree = { - choices = { - bachelor, - master, - doctor, - postdoc, - }, - default = doctor, - }, - degree-type = { - choices = { - academic, - professional, - }, - name = degree@type, - }, degree-name = { default = {工学博士}, name = degree@name, @@ -160,6 +159,14 @@ default = {Name of author}, name = author@en, }, + author-id = { + default = {Id of author}, + name = author@id, + }, + entrance-year = { + default = {Year of entrance}, + name = entrance@year, + }, supervisor = { default = {导师姓名}, }, @@ -173,30 +180,6 @@ supervisor-institution* = { name = supervisor@institution@en, }, - associate-supervisor = { - name = associate@supervisor, - }, - associate-supervisor* = { - name = associate@supervisor@en, - }, - associate-supervisor-institution = { - name = associate@supervisor@institution, - }, - associate-supervisor-institution* = { - name = associate@supervisor@institution@en, - }, - joint-supervisor = { - name = joint@supervisor, - }, - joint-supervisor* = { - name = joint@supervisor@en, - }, - joint-supervisor-institution = { - name = joint@supervisor@institution, - }, - joint-supervisor-institution* = { - name = joint@supervisor@institution@en, - }, institution = { % default = {上海科技大学信息科学与技术学院}, }, @@ -214,16 +197,6 @@ % default = {Computer Science and Technology}, name = discipline@en, }, - date = { - default = {\the\year~年~\the\month~月}, - }, - date* = { - default = {\monthname,~\the\year}, - name = date@en, - }, - clc, - udc, - id, discipline-level-1 = { default = {一级学科名称}, name = discipline@level@i, @@ -240,42 +213,95 @@ default = {Name of Level-two Discipline}, name = discipline@level@ii@en, }, - start-date = { - name = start@date, - default = {\the\year-\two@digits{\month}-\two@digits{\day}}, + date = { + default = {\the\year~年~\the\month~月}, }, - end-date = { - name = end@date, - default = {\the\year-\two@digits{\month}-\two@digits{\day}}, + date* = { + default = {\monthname,~\the\year}, + name = date@en, }, + clc, + udc, + id, anonymous-str = { name = anonymous@str, default = {***}, + }, + bib-resource = { + name = bib@resource, } } % ------------------------------------------------------------------------------ % Class options % ------------------------------------------------------------------------------ -\PassOptionsToClass{ - UTF8, - a4paper, - twoside, - openany, - zihao = -4, - scheme = plain, -}{ctexbook} \SetupKeyvalOptions{ family = sht, prefix = sht@, } -\DeclareBoolOption[false]{anonymous} -\DeclareBoolOption[false]{print} +\newif\ifsht@undergraduate +\newif\ifsht@graduate +\newif\ifsht@degree@set +\sht@degree@setfalse +\newcommand\sht@check@degree@set{% + \ifsht@degree@set% + \sht@error{you can only set degree once}% + \else% + \sht@degree@settrue% + \fi% +} +\DeclareVoidOption{bachelor}{% + \sht@check@degree@set% + \sht@undergraduatetrue% + \sht@graduatefalse% + \def\sht@degree{bachelor}% +} +\DeclareVoidOption{master}{% + \sht@check@degree@set% + \sht@undergraduatefalse% + \sht@graduatetrue% + \def\sht@degree{master}% +} +\DeclareVoidOption{doctor}{% + \sht@check@degree@set% + \sht@undergraduatefalse% + \sht@graduatetrue% + \def\sht@degree{doctor}% +} +\DeclareBoolOption{anonymous} +\DeclareBoolOption{print} +\DeclareBoolOption{comfort} \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}} \ProcessKeyvalOptions* +\ifsht@degree@set% +\else% + \sht@error{you have not set degree (bachelor, master or doctor) yet}% +\fi% % ------------------------------------------------------------------------------ % Load minimum mandatory packages % ------------------------------------------------------------------------------ +\ifsht@undergraduate + \PassOptionsToClass{zihao = 5}{ctexbook} + \PassOptionsToPackage{style = gb7714-2015}{biblatex} +\else + \PassOptionsToClass{zihao = -4}{ctexbook} + \PassOptionsToPackage{style = gb7714-2015ay}{biblatex} +\fi +\PassOptionsToClass{ + UTF8, + a4paper, + twoside, + openany, + scheme = plain, +}{ctexbook} +\PassOptionsToPackage{ + natbib = true, + backend = biber, + gbpub = false, + gbcitelocal = chinese, +}{biblatex} \LoadClass{ctexbook} +\RequirePackage{expl3} +\RequirePackage{xparse} \RequirePackage[hyperref, table]{xcolor} \RequirePackage{geometry} \RequirePackage{calc} @@ -283,31 +309,31 @@ \RequirePackage{etoolbox} \RequirePackage{ifthen} \RequirePackage{graphicx} -\RequirePackage{todonotes} \RequirePackage{indentfirst} \RequirePackage[normalem]{ulem} \RequirePackage{fancyhdr} +\RequirePackage{pageslts} \RequirePackage{tocvsec2} \RequirePackage{letltxmacro} -\RequirePackage{fontspec}[2016/12/27] +\RequirePackage{fontspec} \RequirePackage{caption} -\RequirePackage{natbib} \RequirePackage[shortlabels, inline]{enumitem} -\RequirePackage{amsmath} \RequirePackage{mathtools} +\RequirePackage{amsthm} \RequirePackage[ mathrm = sym, mathit = sym, mathbf = sym, mathtt = sym, ]{unicode-math} +\RequirePackage{hyperref} +\RequirePackage{biblatex} \AtEndPreamble{ - \RequirePackage{hyperref} \hypersetup{ pdfencoding = auto, psdextra = true, bookmarksnumbered = true, - pdftitle = {\sht@title}, + pdftitle = {\sht@flat@title}, pdfauthor = {\sht@author}, } \ifsht@print @@ -316,13 +342,27 @@ colorlinks = false, } \else + % `default' color scheme from `fduthesis' + \definecolor{fdu@link}{HTML}{990000} + \definecolor{fdu@url}{HTML}{0000B2} + \definecolor{fdu@cite}{HTML}{007F00} + % `classic' color scheme from `fduthesis' + \definecolor{classic@link}{HTML}{FF0000} + \definecolor{classic@url}{HTML}{0000FF} + \definecolor{classic@cite}{HTML}{00FF00} + % `science' color scheme from `fduthesis' + \definecolor{science@link}{HTML}{CA0619} + \definecolor{science@url}{HTML}{389F9D} + \definecolor{science@cite}{HTML}{FF8920} \hypersetup{ colorlinks = true, - linkcolor = black, - citecolor = blue, - urlcolor = blue, + linkcolor = fdu@link, + urlcolor = fdu@url, + citecolor = fdu@cite, } \fi + \urlstyle{tt} + \addbibresource{\sht@bib@resource} } % ============================================================================== % Format Specifications @@ -341,129 +381,137 @@ \def\bibname{参考文献} \def\tablename{表} \def\figurename{图} -\def\bibetal{等} -\def\biband{和} +\definecolor{ShtRed}{RGB}{146,46,23} +\def\school@logo@missing{校徽文件缺失,请至\href{https://github.com/lirundong/shtthesis/raw/master/shanghaitech-logo.pdf}{项目主页}下载!} % ------------------------------------------------------------------------------ % Geometry and layouts % ------------------------------------------------------------------------------ -\geometry{ - top = 2.54cm, - bottom = 2.54cm, - headheight = 12pt, % 9bp, - headsep = 17.5pt, % 2.54cm - 9bp, - footskip = 2.54cm - 1.75cm, -} +\def\binding@width{0.63cm} +\def\horizontal@margin{3.17cm} +\def\sht@head@logo@height{1.17cm} \ifsht@print - \def\binding@width{0.63cm} \geometry{ - inner = 3.17cm + \binding@width, - outer = 3.17cm - \binding@width, + inner = \horizontal@margin + \binding@width, + outer = \horizontal@margin - \binding@width, } \else \geometry{ - inner = 3.17cm, - outer = 3.17cm, + inner = \horizontal@margin, + outer = \horizontal@margin, } \fi \setlength{\parskip}{0.5ex plus 0.25ex minus 0.25ex} \setlength{\parindent}{2\ccwd} -\linespread{1.6} +\ifsht@undergraduate + \linespread{1.3} + \geometry{ + includeheadfoot, + top = 1.5cm, + bottom = 1.75cm, + headheight = \sht@head@logo@height, + headsep = \baselineskip, + footskip = 2.54cm - 1.75cm, + } +\else + \linespread{1.6} + \geometry{ + top = 2.54cm, + bottom = 2.54cm, + headheight = 12pt, + headsep = 17.5pt, + footskip = 2.54cm - 1.75cm, + } +\fi \raggedbottom % ------------------------------------------------------------------------------ % Headers and footers % ------------------------------------------------------------------------------ +\def\sht@flat@title{\renewcommand\\{\space} \@title} +\def\sht@flat@title@en{\renewcommand\\{\space} \sht@title@en} +\newcommand\sht@head@logo{% + \IfFileExists{shanghaitech-logo.pdf}{% + \includegraphics[height=\sht@head@logo@height]{shanghaitech-logo.pdf}% + }{% + \fbox{% + \begin{minipage}[b][\sht@head@logo@height][c]{0.4\columnwidth}% + \zihao{-5}\bfseries\sffamily\color{ShtRed} \school@logo@missing% + \end{minipage}% + }% + } +} \pagestyle{fancy} -\fancypagestyle{CenteralPageNumbered}{ +\fancypagestyle{Plain}{} +\fancypagestyle{RomanNumbered}{ \fancyhf{} \pagenumbering{Roman} - \fancyhead[C]{ - \footnotesize - \ifnumodd{\value{page}}{ - \nouppercase\leftmark - }{ - \nouppercase\@title - } - } - \fancyfoot[C]{ - \footnotesize - \thepage - } + \fancyhead[OC]{\footnotesize\nouppercase\leftmark} + \fancyhead[EC]{\footnotesize\nouppercase\sht@flat@title} + \fancyfoot[C]{\footnotesize\thepage} \renewcommand{\headrulewidth}{0.8pt} \renewcommand{\footrulewidth}{0pt} } -\fancypagestyle{LRPageNumbered}{ +\fancypagestyle{LRNumbered}{ \fancyhf{} - \fancyhead[C]{ - \footnotesize - \ifnumodd{\value{page}}{ - \nouppercase\leftmark - }{ - \nouppercase\@title - } - } - \fancyfoot[C]{ - \footnotesize - \ifnumodd{\value{page}}{ - \hspace*{\fill} - \thepage - }{ - \thepage - \hspace*{\fill} - } - } + \fancyhead[OC]{\footnotesize\nouppercase\leftmark} + \fancyhead[EC]{\footnotesize\nouppercase\sht@flat@title} + \fancyfoot[OR]{\footnotesize\thepage} + \fancyfoot[EL]{\footnotesize\thepage} \renewcommand{\headrulewidth}{0.8pt} \renewcommand{\footrulewidth}{0pt} } -\fancypagestyle{LRPageNumberedAppendix}{ +\fancypagestyle{LRNumberedAppendix}{ \fancyhf{} - \fancyhead[C]{ - \footnotesize - \ifnumodd{\value{page}}{% - 附\hspace{1\ccwd}录% - }{ - \nouppercase\@title - } - } - \fancyfoot[C]{ - \footnotesize - \ifnumodd{\value{page}}{ - \hspace*{\fill} - \thepage - }{ - \thepage - \hspace*{\fill} - } - } + \fancyhead[OC]{\footnotesize 附\hspace*{1\ccwd}录} + \fancyhead[EC]{\footnotesize\nouppercase\sht@flat@title} + \fancyfoot[OR]{\footnotesize\thepage} + \fancyfoot[EL]{\footnotesize\thepage} \renewcommand{\headrulewidth}{0.8pt} \renewcommand{\footrulewidth}{0pt} } -\fancypagestyle{LRPageNumberedWithoutHead}{ +\fancypagestyle{RomanNumberedWithLogo}{ \fancyhf{} - \fancyfoot[C]{ - \footnotesize - \ifnumodd{\value{page}}{ - \hspace*{\fill} - \thepage - }{ - \thepage - \hspace*{\fill} - } + \pagenumbering{Roman} + \fancyhead[L]{\sht@head@logo} + \fancyhead[R]{\zihao{-5}\sffamily\sht@flat@title} + \fancyfoot[C]{\footnotesize\thepage} + \renewcommand{\headrulewidth}{0.8pt} + \renewcommand{\footrulewidth}{0pt} +} +\fancypagestyle{MNNumberedWithLogo}{ + \fancyhf{} + \fancyhead[L]{\sht@head@logo} + \fancyhead[R]{\zihao{-5}\sffamily\sht@flat@title} + \fancyfoot[C]{% + \footnotesize% + 第~\thepage~页\hspace*{1\ccwd}共~\lastpageref*{VeryLastPage}~页% } - \renewcommand{\headrulewidth}{0pt} + \renewcommand{\headrulewidth}{0.8pt} \renewcommand{\footrulewidth}{0pt} } -\fancypagestyle{Plain}{} \providecommand{\frontmatter}{} \LetLtxMacro{\TmpFrontmatter}{\frontmatter} \renewcommand{\frontmatter}{% \TmpFrontmatter% - \pagestyle{CenteralPageNumbered}% + \ifsht@undergraduate% + \pagestyle{RomanNumberedWithLogo}% + \else% + \pagestyle{RomanNumbered}% + \fi% } \providecommand{\mainmatter}{} \LetLtxMacro{\TmpMainmatter}{\mainmatter} \renewcommand{\mainmatter}{% \TmpMainmatter% - \pagestyle{LRPageNumbered}% + \ifsht@undergraduate% + \pagestyle{MNNumberedWithLogo}% + \else% + \pagestyle{LRNumbered}% + \fi% + \pagenumbering{arabic}% + \setcounter{page}{1}% +} +\AtBeginDocument{% + \pagenumbering{arabic}% } % ------------------------------------------------------------------------------ % Font utilities @@ -502,14 +550,9 @@ % ------------------------------------------------------------------------------ \ifthenelse{\equal{\sht@fontset}{windows}}{ \def\fake@bold@factor{2.5} - \IfFileExists{C:/bootfont.bin}{ - \def\windows@kaiti{KaiTi_GB2312} - }{ - \def\windows@kaiti{KaiTi} - } \setCJKmainfont[ AutoFakeBold = \fake@bold@factor, - ItalicFont = \windows@kaiti, + ItalicFont = KaiTi, ]{SimSun} \setCJKsansfont[ AutoFakeBold = \fake@bold@factor, @@ -522,7 +565,7 @@ ]{SimHei} \setCJKfamilyfont{zhkai}[ AutoFakeBold = \fake@bold@factor, - ]{\windows@kaiti} + ]{KaiTi} }{ \ifthenelse{\equal{\sht@fontset}{mac}}{ \setCJKmainfont[ @@ -550,60 +593,44 @@ }{ \IfFontExistsTF{Source Han Serif SC}{ \def\unix@songti{Source Han Serif SC} - \def\unix@songti@bold{Source Han Serif SC Bold} }{ \IfFontExistsTF{Noto Serif CJK SC}{ \def\unix@songti{Noto Serif CJK SC} - \def\unix@songti@bold{Noto Serif CJK SC Bold} }{ - \def\unix@songti{FandolSong-Regular.otf} - \def\unix@songti@bold{FandolSong-Bold.otf} + \def\unix@songti{FandolSong} } } \IfFontExistsTF{Source Han Sans SC}{ \def\unix@heiti{Source Han Sans SC} - \def\unix@heiti@bold{Source Han Sans SC Bold} }{ \IfFontExistsTF{Noto Sans CJK SC}{ \def\unix@heiti{Noto Sans CJK SC} - \def\unix@heiti@bold{Noto Sans CJK SC Bold} }{ - \def\unix@heiti{FandolHei-Regular.otf} - \def\unix@heiti@bold{FandolHei-Bold.otf} + \def\unix@heiti{FandolHei} } } - \IfFontExistsTF{STKaiti}{ - \def\unix@kaiti{STKaiti} + \edef\unix@heiti@medium@impl{\unix@heiti\space Medium} + \edef\unix@heiti@bold@impl{\unix@heiti\space Bold} + \IfFontExistsTF{\unix@heiti@medium@impl}{ + \def\unix@heiti@bold{\unix@heiti@medium@impl} }{ - \IfFontExistsTF{Kaiti}{ - \def\unix@kaiti{Kaiti} - }{ - \def\unix@kaiti{FandolKai-Regular.otf} - } + \def\unix@heiti@bold{\unix@heiti@bold@impl} } - \IfFontExistsTF{STFangsong}{ - \def\unix@fangsong{STFangsong} + \IfFontExistsTF{FZKai-Z03}{ + \def\unix@kaiti{FZKai-Z03} }{ - \IfFontExistsTF{FangSong}{ - \def\unix@fangsong{FangSong} - }{ - \def\unix@fangsong{FandolFang-Regular.otf} - } + \def\unix@kaiti{FandolKai} } - \setCJKmainfont[ - BoldFont = \unix@songti@bold, - ItalicFont = \unix@kaiti, - ]{\unix@songti} - \setCJKsansfont[ - BoldFont = \unix@heiti@bold, - ]{\unix@heiti} + \IfFontExistsTF{FZFangSong-Z02}{ + \def\unix@fangsong{FZFangSong-Z02} + }{ + \def\unix@fangsong{FandolFang} + } + \setCJKmainfont[ItalicFont=\unix@kaiti]{\unix@songti} + \setCJKsansfont[BoldFont=\unix@heiti@bold]{\unix@heiti} \setCJKmonofont{\unix@fangsong} - \setCJKfamilyfont{zhsong}[ - BoldFont = \unix@songti@bold, - ]{\unix@songti} - \setCJKfamilyfont{zhhei}[ - BoldFont = \unix@heiti@bold, - ]{\unix@heiti} + \setCJKfamilyfont{zhsong}{\unix@songti} + \setCJKfamilyfont{zhhei}{\unix@heiti} \setCJKfamilyfont{zhkai}{\unix@kaiti} \setCJKfamilyfont{zhfs}{\unix@fangsong} \providecommand{\songti}{\CJKfamily{zhsong}} @@ -647,9 +674,11 @@ \renewcommand\checkmark{\ensuremath{✓}}% } \allowdisplaybreaks[4] -\newtagform{dots}{\ldots\ (}{)} -\usetagform{dots} -\renewcommand{\eqref}[1]{\textup{(\ref{#1})}} +\ifsht@graduate + \newtagform{dots}{\ldots\ (}{)} + \usetagform{dots} + \renewcommand{\eqref}[1]{\textup{(\ref{#1})}} +\fi % ------------------------------------------------------------------------------ % Math fonts % ------------------------------------------------------------------------------ @@ -686,6 +715,25 @@ \setmathfontface\mathsf{FiraMath-Regular.otf} }{} % ------------------------------------------------------------------------------ +% Math environmrnts +% ------------------------------------------------------------------------------ +\theoremstyle{plain} +\newtheorem{theorem}{定理}[chapter] +\newtheorem{lemma}{引理}[chapter] +\newtheorem{corollary}{推论}[theorem] +\newtheorem{proposition}{命题}[chapter] +\newtheorem{conjecture}{猜想}[chapter] +\theoremstyle{definition} +\newtheorem{definition}{定义}[chapter] +\newtheorem{axiom}{公理}[chapter] +\newtheorem{example}{例}[chapter] +\newtheorem{exercise}{练习}[chapter] +\newtheorem{problem}{问题}[chapter] +\theoremstyle{remark} +\newtheorem{remark}{注}[chapter] +\renewcommand*{\proofname}{证明} +\expandafter\patchcmd\csname\string\proof\endcsname{\@addpunct{.}}{\@addpunct{\emph{:}}}{}{} +% ------------------------------------------------------------------------------ % Utility functions for ToC and bookmarks % ------------------------------------------------------------------------------ \newcommand{\artxmaincnt}{% @@ -740,6 +788,15 @@ \markboth{\MakeUppercase{#3}}{}% } \newcommand{\intobmk}{\@ifstar{\intobmkstar}{\intobmknostar}} +% \cleardoublepage only works on graduate or undergraduate print mode +\LetLtxMacro{\OriginCleardoublepage}{\cleardoublepage} +\renewcommand{\cleardoublepage}{% + \ifthenelse{\boolean{sht@undergraduate} \AND \NOT\boolean{sht@print}}{% + \relax\clearpage% + }{% + \OriginCleardoublepage% + }% +} % ------------------------------------------------------------------------------ % Table of contents, figures and tables % ------------------------------------------------------------------------------ @@ -747,10 +804,22 @@ \captionsetup{ format = plain, hangindent = 2.0em, - skip = 8pt, labelsep = quad, font = {wuhaocuti}, } +\ifsht@undergraduate + \captionsetup{ + skip = 6pt, + } + \def\sht@toc@chapter@fmt{\zihao{5}\rmfamily} + \def\sht@toc@section@fmt{\zihao{5}\rmfamily} +\else + \captionsetup{ + skip = 8pt, + } + \def\sht@toc@chapter@fmt{\zihao{4}\heiti} + \def\sht@toc@section@fmt{\zihao{-4}\heiti} +\fi \def\@dotsep{1.5mu} \def\@pnumwidth{2em} \def\@tocrmarg{2em} @@ -762,7 +831,7 @@ {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip \parindent #2\relax\@afterindenttrue \interlinepenalty\@M - \leavevmode \zihao{-4}\heiti + \leavevmode \sht@toc@section@fmt \@tempdima #3\relax \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip {#4}\nobreak @@ -782,7 +851,7 @@ \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth {\leavevmode - \zihao{4}\heiti #1 + \sht@toc@chapter@fmt #1 \leaders\hbox{$\m@th\mkern \@dotsep \cdot\mkern \@dotsep$} \hfil \hb@xt@\@pnumwidth{\hss #2}}\par \nobreak @@ -795,12 +864,15 @@ \renewcommand*{\l@chapter}[2]{ \ifnum \c@tocdepth >\m@ne \addpenalty{-\@highpenalty}% - \vskip \@chaptervspace \@plus\p@ + \ifsht@undergraduate% + \else% + \vskip \@chaptervspace \@plus\p@% + \fi% \setlength\@tempdima{1.5em}% \begingroup \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth - \leavevmode \zihao{4}\heiti + \leavevmode \sht@toc@chapter@fmt \advance\leftskip\@tempdima \hskip -\leftskip #1\nobreak @@ -822,12 +894,15 @@ \newcommand{\makeindices}{% \begingroup% \linespread{1.2}% + \hypersetup{linkcolor=black}% \intobmk*{\cleardoublepage}{\contentsname}% \tableofcontents% - \intobmk*{\cleardoublepage}{\listfigurename}% - \listoffigures% - \intobmk*{\cleardoublepage}{\listtablename}% - \listoftables% + \ifsht@graduate% + \intobmk*{\cleardoublepage}{\listfigurename}% + \listoffigures% + \intobmk*{\cleardoublepage}{\listtablename}% + \listoftables% + \fi% \endgroup% } % ------------------------------------------------------------------------------ @@ -841,7 +916,7 @@ titleformat = {}, name = {第, 章}, number = \arabic{chapter}, - aftername = \hspace{1\ccwd}, + aftername = \hspace{0.75\ccwd}, beforeskip = {7pt}, afterskip = {18pt}, pagestyle = Plain, @@ -851,7 +926,7 @@ nameformat = {}, numberformat = \rmfamily, titleformat = {}, - aftername = \hspace{1\ccwd}, + aftername = \hspace{0.75\ccwd}, beforeskip = {24pt}, afterskip = {6pt}, }, @@ -860,19 +935,51 @@ nameformat = {}, numberformat = \rmfamily, titleformat = {}, - aftername = \hspace{1\ccwd}, + aftername = \hspace{0.75\ccwd}, beforeskip = {12pt}, afterskip = {6pt}, }, paragraph = { indent = 2\ccwd, beforeskip = {0pt}, - afterskip = {1\ccwd}, + afterskip = {0.75\ccwd}, }, punct = quanjiao, space = auto, autoindent = true, } +\ifsht@undergraduate + \newlength{\sht@section@indent} + \ifsht@comfort + \def\sht@chapter@fmt{\bfseries\sffamily\zihao{4}\linespread{1.0}\centering} + \def\sht@section@fmt{\sffamily\zihao{-4}\linespread{1.0}\raggedright} + \def\sht@subsection@fmt{\sffamily\zihao{5}\linespread{1.0}\raggedright} + \setlength{\sht@section@indent}{0pt} + \else + \def\sht@chapter@fmt{\bfseries\sffamily\zihao{3}\linespread{1.0}\centering} + \def\sht@section@fmt{\sffamily\zihao{4}\linespread{1.0}\raggedright} + \def\sht@subsection@fmt{\rmfamily\zihao{-4}\linespread{1.0}\raggedright} + \setlength{\sht@section@indent}{2\ccwd} + \fi + \ctexset{ + chapter = { + format = \sht@chapter@fmt, + number = \chinese{chapter}, + numberformat = {}, + }, + section = { + format = \sht@section@fmt, + numberformat = {}, + indent = \sht@section@indent, + beforeskip = {18pt}, + }, + subsection = { + format = \sht@subsection@fmt, + numberformat = {}, + indent = \sht@section@indent, + } + } +\fi % ------------------------------------------------------------------------------ % List environments % ------------------------------------------------------------------------------ @@ -890,42 +997,111 @@ labelsep = 0em, format = \normalfont\textbf@with@colon, } +% ------------------------------------------------------------------------------ +% Quotation environments +% ------------------------------------------------------------------------------ +\ExplSyntaxOn +\ctex_patch_cmd:Nnn \quotation { 1.5em } { 2 \ccwd } +\ExplSyntaxOff +\BeforeBeginEnvironment{quotation}{% + \begingroup% + \setlength\leftmargini{2\ccwd}% +} +\AtBeginEnvironment{quotation}{% + \itshape% +} +\AfterEndEnvironment{quotation}{% + \endgroup% +} % ============================================================================== % Cover Generation % ============================================================================== -\def\ulhshift{-4em} -\newcommand{\ulunify}[1]{\uline{#1}} -\newcommand{\ulenhance}[2][1pt]{% +\def\ubox@right@shift{0.5\ccwd} +\def\content@left@shift{2.75\ccwd} +\def\cover@tab@entry@width{350pt} +\def\cover@tab@last@entry@width{\cover@tab@entry@width - 2\ccwd - 0.5\ccwd} +\def\cover@tab@uline@thick{1.2pt} +\ExplSyntaxOn +\ProvideDocumentCommand{\shifted@uline}{% + O{\cover@tab@uline@thick} % + O{\ubox@right@shift} % + m}{% \def\ULthickness{#1}% \setlength{\ULdepth}{0.3em}% - \expandafter\ulunify\expandafter{#2}% + \hspace*{#2}% + \uline{#3}% } -\newcommand{\ulextend}[2][350pt]{% - \hbox to #1 {\hfill \hspace*{\ulhshift} #2 \hfill}% +\ProvideDocumentCommand{\shifted@box}{% + O{\cover@tab@entry@width} % + O{\content@left@shift} % + m}{% + \makebox[#1][c]{\hspace*{-#2} #3 }% } +\ProvideDocumentCommand{\sht@lines@to@tab}{% + O{\cover@tab@uline@thick} % + O{\cover@tab@entry@width} % + O{\content@left@shift} % + m}{% + % convert lines into table lines, adapted from `ucasthesis' + \seq_set_split:NnV \l_tmpa_seq {\\} {#4} + \clist_set_from_seq:NN \l_tmpa_clist \l_tmpa_seq + \clist_clear:N \l_tmpb_clist + \clist_map_inline:Nn \l_tmpa_clist + {% + \clist_put_right:Nn \l_tmpb_clist + { \shifted@uline[#1]{\shifted@box[#2][#3]{##1}} } + } + \clist_use:Nn \l_tmpb_clist { \\ & } +} +\ExplSyntaxOff \newcommand\sht@schoollogo{% \IfFileExists{shanghaitech-logo.pdf}{% \includegraphics[width=10.48cm]{shanghaitech-logo.pdf}% }{% - \missingfigure[figwidth=10.48cm, figheight=2.79cm]{% - \small 校徽文件 \texttt{shanghaitech-logo.pdf} 缺失,请至\href{https://github.com/lirundong/shtthesis/raw/master/shanghaitech-logo.pdf}{项目主页}下载!% + \begin{center}% + \fbox{% + \begin{minipage}[t][2.79cm][c]{10.48cm}% + \centering\bfseries\color{ShtRed} \school@logo@missing% + \end{minipage}% + }% + \end{center}% + }% +} +\newcommand\sht@schoollogo@undergraduate{% + \noindent% + \IfFileExists{shanghaitech-logo.pdf}{% + \includegraphics[width=5.39cm]{shanghaitech-logo.pdf}% + }{% + \fbox{% + \begin{minipage}[t][1.45cm][c]{0.75\columnwidth}% + \bfseries\color{ShtRed} \school@logo@missing% + \end{minipage}% }% }% } \renewcommand{\maketitle}{% - \ifthenelse{\equal{\sht@degree}{doctor}}{ - \sht@maketitle@graduate{博士} - \sht@maketitle@graduate@en{dissertation} - }{ - \ifthenelse{\equal{\sht@degree}{master}}{ - \sht@maketitle@graduate{硕士} - \sht@maketitle@graduate@en{thesis} + \ifsht@undergraduate + \sht@maketitle@undergraduate + \sht@maketitle@undergraduate@en + \else + \ifthenelse{\equal{\sht@degree}{doctor}}{ + \sht@maketitle@graduate{博士} + \sht@maketitle@graduate@en{dissertation} }{ - \sht@error{Degree type `\sht@degree' is not supported yet} + \ifthenelse{\equal{\sht@degree}{master}}{ + \sht@maketitle@graduate{硕士} + \sht@maketitle@graduate@en{thesis} + }{ + \sht@error{Degree type `\sht@degree' is not supported yet} + } } - } + \fi \ifthenelse{\not \boolean{sht@anonymous}}{% - \makedeclarations% + \ifsht@undergraduate% + \makedeclarations@undergraduate% + \else% + \makedeclarations% + \fi }{} } % ------------------------------------------------------------------------------ @@ -939,9 +1115,9 @@ \hfill{} \ifdefempty{\sht@secret@level}{}{% 密级:% - \ulenhance{% - \ulextend[50pt]{% - \hspace*{-\ulhshift} \zihao{5} \sht@secret@level% + \shifted@uline[1pt][0pt]{% + \shifted@box[50pt][0pt]{% + \zihao{5} \sht@secret@level% }% }% } @@ -956,7 +1132,7 @@ \vspace*{\stretch{3}} - {\zihao{-3}\heiti \ulenhance[1.5pt]{\sht@title}} + {\zihao{-3}\heiti \shifted@uline[1.5pt][0pt]{\sht@title}} \vspace*{\stretch{3}} @@ -966,7 +1142,7 @@ \def\arraystretch{1.3} \begin{tabular}{llc} 作者姓名:& - \multicolumn{2}{c}{\ulenhance[1.2pt]{\ulextend{% + \multicolumn{2}{c}{\shifted@uline{\shifted@box{% \ifsht@anonymous% \sht@anonymous@str% \else% @@ -974,7 +1150,7 @@ \fi% }}} \\ 指导教师:& - \multicolumn{2}{c}{\ulenhance[1.2pt]{\ulextend{% + \multicolumn{2}{c}{\shifted@uline{\shifted@box{% \ifsht@anonymous% \sht@anonymous@str% \else% @@ -982,14 +1158,14 @@ \fi% }}} \\ \ifdefempty{\sht@supervisor@institution}{}{ & - \multicolumn{2}{c}{\ulenhance[1.2pt]{\ulextend{\sht@supervisor@institution}}} \\ + \multicolumn{2}{c}{\shifted@uline{\shifted@box{\sht@supervisor@institution}}} \\ } 学位类别:& - \multicolumn{2}{c}{\ulenhance[1.2pt]{\ulextend{\sht@degree@name}}} \\ + \multicolumn{2}{c}{\shifted@uline{\shifted@box{\sht@degree@name}}} \\ 一级学科:& - \multicolumn{2}{c}{\ulenhance[1.2pt]{\ulextend{\sht@discipline@level@i}}} \\ + \multicolumn{2}{c}{\shifted@uline{\shifted@box{\sht@discipline@level@i}}} \\ \multicolumn{2}{l}{学校/学院名称:} & - \ulenhance[1.2pt]{\ulextend[318pt]{\sht@institution}} \\ + \shifted@uline{\shifted@box[\cover@tab@last@entry@width]{\sht@institution}} \\ \end{tabular} } @@ -1012,7 +1188,7 @@ \vspace*{50pt} - {\zihao{-3}\bfseries \ulenhance[1.5pt]{\sht@title@en}} + {\zihao{-3}\bfseries \shifted@uline[1.5pt][0pt]{\sht@title@en}} \vspace*{\stretch{3}} @@ -1059,6 +1235,124 @@ \cleardoublepage } % ------------------------------------------------------------------------------ +% Bachelor covers +% ------------------------------------------------------------------------------ +\def\cover@tab@entry@width@undergraduate{300pt} +\def\cover@tab@uline@thick@undergraduate{1pt} +\def\content@left@shift@en{2.5\ccwd} +\newcommand{\sht@maketitle@undergraduate}{% + \intobmk*{\cleardoublepage}{封面} + \thispagestyle{empty} + \sht@schoollogo@undergraduate + \begin{center} + \linespread{1.6} + + \vspace*{\stretch{20}} + + {\zihao{2}\bfseries 本科毕业论文(设计)} + + \vspace*{\stretch{54}} + + { + \zihao{4} + \def\tabcolsep{1pt} + \def\arraystretch{1.3} + \begin{tabular}{cc} + 题\hspace{2\ccwd}目:& + \sht@lines@to@tab[\cover@tab@uline@thick@undergraduate]% + [\cover@tab@entry@width@undergraduate]{\sht@title} \\ + 学生姓名:& + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@author}} \\ + 学\hspace{2\ccwd}号:& + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@author@id}} \\ + 入学年份:& + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@entrance@year}} \\ + 所在学院:& + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@institution}} \\ + 攻读专业:& + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@discipline}} \\ + 指导教师:& + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@supervisor}} \\ + \end{tabular} + } + + \vspace*{\stretch{70}} + + { + \zihao{-4} + 上海科技大学 + \par\sht@date + } + + \vspace{\stretch{11}} + \end{center} + \clearpage + \thispagestyle{empty} + \cleardoublepage +} +\newcommand{\sht@maketitle@undergraduate@en}{% + \intobmk*{\cleardoublepage}{Cover} + \thispagestyle{empty} + \sht@schoollogo@undergraduate + \begin{center} + \linespread{1.6} + + \vspace*{\stretch{20}} + + {\zihao{2}\bfseries\sffamily THESIS} + + \vspace*{\stretch{54}} + + { + \zihao{4} + \def\tabcolsep{1pt} + \def\arraystretch{1.3} + \begin{tabular}{lc} + Subject: & + \sht@lines@to@tab[\cover@tab@uline@thick@undergraduate]% + [\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@title@en} \\ + Student Name: & + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@author@en}} \\ + Student ID: & + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@author@id}} \\ + Year of Entrance: & + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@entrance@year}} \\ + School: & + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@institution@en}} \\ + Major: & + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@discipline@en}} \\ + Advisor: & + \shifted@uline[\cover@tab@uline@thick@undergraduate]% + {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@supervisor@en}} \\ + \end{tabular} + } + + \vspace*{\stretch{70}} + + { + \zihao{-4} + ShanghaiTech University + \par Date:~\sht@date@en + } + + \vspace{\stretch{11}} + \end{center} + \clearpage + \thispagestyle{empty} + \cleardoublepage +} +% ------------------------------------------------------------------------------ % Declarations % ------------------------------------------------------------------------------ \newcommand{\makedeclarations}{% @@ -1070,7 +1364,7 @@ \vspace*{2ex} \begin{center} - {\zihao{4}\bfseries\sffamily 上海科技大学\\研究生学位论文原创性声明} + \zihao{4}\bfseries\sffamily 上海科技大学\\研究生学位论文原创性声明 \end{center} 本人郑重声明:所呈交的学位论文是本人在导师的指导下独立进行研究工作所取得的成果。% @@ -1080,14 +1374,14 @@ \vspace*{3ex} - {\hfill{} {作者签名:\hspace*{14em}}} + {\hfill{}作者签名:\hspace*{14em}} - {\hfill{} {日\quad\quad 期:\hspace*{14em}}} + {\hfill{}日\hspace*{2\ccwd}期:\hspace*{14em}} \vspace*{6ex} \begin{center} - {\zihao{4}\bfseries\sffamily 上海科技大学\\学位论文授权使用声明} + \zihao{4}\bfseries\sffamily 上海科技大学\\学位论文授权使用声明 \end{center} 本人完全了解并同意遵守上海科技大学有关保存和使用学位论文的规定,即上海科技大学有权% @@ -1099,9 +1393,9 @@ \vspace*{3ex} - {\hfill{} {作者签名:\hspace*{10em} 导师签名:\hspace*{9em}}} + {\hfill{}作者签名:\hspace*{10em}导师签名:\hspace*{9em}} - {\hfill{} {日\quad\quad 期:\hspace*{10em} 日\quad\quad 期:\hspace*{9em}}} + {\hfill{}日\hspace*{2\ccwd}期:\hspace*{10em}日\hspace*{2\ccwd}期:\hspace*{9em}} \vspace{3ex} } @@ -1109,22 +1403,153 @@ \thispagestyle{empty} \cleardoublepage } +\newcommand{\makedeclarations@undergraduate}{% + \intobmk*{\cleardoublepage}{声明} + % P1: 学术诚信声明 + \thispagestyle{empty} + { + \linespread{1.6}\zihao{4} + + \vspace*{\stretch{1}} + + \begin{center} + \zihao{-2}\bfseries\sffamily 上海科技大学\\毕业论文(设计)学术诚信声明 + \end{center} + + \vspace*{\stretch{1}} + + 本人郑重声明:所呈交的毕业论文(设计),是本人在导师的指导下,独立进行研究工作% + 所取得的成果。除文中已经注明引用的内容外,本论文不包含任何其他个人或集体已经发表% + 或撰写过的作品成果。对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式% + 标明。本人完全意识到本声明的法律结果由本人承担。 + + \vspace*{\stretch{3}} + + \hfill{}作者签名:\hspace*{9.5\ccwd} + + \vspace*{\stretch{1}} + + \hfill{}日\hspace*{2\ccwd}期:% + \hspace*{2.5\ccwd}年% + \hspace*{1.5\ccwd}月% + \hspace*{1.5\ccwd}日% + \hspace*{1\ccwd} + + \vspace{\stretch{6}} + } + \clearpage + % P2: empty + \thispagestyle{empty} + \cleardoublepage + % P3: 版权使用授权书 + \thispagestyle{empty} + { + \linespread{1.6}\zihao{4} + + \vspace*{\stretch{1}} + + \begin{center} + \zihao{-2}\bfseries\sffamily 上海科技大学\\毕业论文(设计)版权使用授权书 + \end{center} + + \vspace*{\stretch{1}} + + 本毕业论文(设计)作者同意学校保留并向国家有关部门或机构送交论文的复印件和电子版,% + 允许论文被查阅和借阅。本人授权上海科技大学可以将本毕业论文(设计)的全部或部分内容% + 编入有关数据库进行检索,可以采用影印、缩印或扫描等复制手段保存和汇编本% + 毕业论文(设计)。 + + \hspace*{6\ccwd}\textbf{保\hspace*{1\ccwd}密}$\square$,% + 在\uline{\hspace*{2\ccwd}}年解密后适用本授权书。 + + 本论文属于 + + \hspace*{6\ccwd}\textbf{不保密}$\square$。 + + (请在以上方框内打“\checkmark”) + + \vspace*{\stretch{3}} + + \noindent 作者签名:\hspace{12.5\ccwd}指导教师签名: + + \vspace*{\stretch{1}} + + \noindent 日期:% + \hspace*{2.5\ccwd}年% + \hspace*{1.5\ccwd}月% + \hspace*{1.5\ccwd}日% + \hspace*{6\ccwd}日期:% + \hspace*{2.5\ccwd}年% + \hspace*{1.5\ccwd}月% + \hspace*{1.5\ccwd}日 + + \vspace{\stretch{4}} + } + \clearpage + % P4: empty + \thispagestyle{empty} + \cleardoublepage +} % ------------------------------------------------------------------------------ % Abstract % ------------------------------------------------------------------------------ -\newenvironment{abstract}{% +\newenvironment{abstract}[1][\sht@null@arg]{% \cleardoublepage% + \ifthenelse{\equal{#1}{flattitle}}{% + \def\sht@abs@title{\sht@flat@title}% + }{% + \def\sht@abs@title{\sht@title}% + }% + \ifsht@undergraduate + \let\clearpage\relax% + \vspace*{\baselineskip}% + \begin{center}% + \zihao{3}\bfseries\sffamily\sht@abs@title% + \end{center}% + \vspace*{\baselineskip}% + \ctexset{chapter/format += \zihao{4}, chapter/beforeskip = 0pt}% + \fi \intobmk\chapter*{摘\hspace{1\ccwd}要}% }{% \vspace{\baselineskip}% - \par\noindent{\bfseries 关键词:} \sht@keywords% + \ifsht@undergraduate% + \ifsht@comfort% + \par\noindent{\bfseries\sffamily 关键词:} \sht@keywords% + \else% + \par\noindent{\zihao{-4}\bfseries\sffamily 关键词:} \sht@keywords% + \fi% + \else% + \par\noindent{\bfseries 关键词:} \sht@keywords% + \fi% } -\newenvironment{abstract*}{% +\newenvironment{abstract*}[1][\sht@null@arg]{% \cleardoublepage% + \ifthenelse{\equal{#1}{flattitle}}{% + \def\sht@abs@title@en{\sht@flat@title@en}% + }{% + \def\sht@abs@title@en{\sht@title@en}% + }% + \ifsht@undergraduate + \let\clearpage\relax% + \vspace*{\baselineskip}% + \begin{center}% + \zihao{3}\bfseries\sht@abs@title@en% + \end{center}% + \vspace*{\baselineskip}% + \ctexset{chapter/format += \zihao{4}\rmfamily, chapter/beforeskip = 0pt}% + \fi \intobmk\chapter*{Abstract}% }{% \vspace{\baselineskip}% - \par\noindent{\bfseries Key Words:} \sht@keywords@en% + \ifsht@undergraduate% + \ifsht@comfort% + \par\noindent{\bfseries Key words:} \sht@keywords@en% + \else% + \par\noindent{\zihao{-4}\bfseries Key words:} \sht@keywords@en% + \fi% + \else% + \par\noindent{\bfseries Key Words:} \sht@keywords@en% + \fi% } % ------------------------------------------------------------------------------ % Nomenclatures @@ -1138,10 +1563,17 @@ \intobmk\chapter*{符号列表}% \fi \stepcounter{sht@nomenclature@cnt} - \ifthenelse{\not \equal{#1}{\sht@null@arg}}{ - \section*{#1} + \ifthenelse{\not \equal{#1}{\sht@null@arg}}{% + \ifsht@undergraduate% + \ctexset{section/format += \zihao{-4}, section/indent = 0pt}% + \fi% + \section*{#1}% }{ - \par\vspace{24pt} + \ifsht@undergraduate% + \par\vspace{18pt}% + \else% + \par\vspace{24pt}% + \fi% } \renewcommand{\item}[3][\sht@null@arg]{ \ifthenelse{\not \equal{##1}{\sht@null@arg}}{ @@ -1158,24 +1590,24 @@ % ------------------------------------------------------------------------------ % Bibliography % ------------------------------------------------------------------------------ -\providecommand{\bibstyle@authoryear}{\bibpunct{(}{)}{;}{a}{,}{,}} -\citestyle{authoryear} -\bibliographystyle{shtthesis-gbt7714-plain} -\setlength{\bibsep}{0.0ex plus 0.2ex minus 0.2ex} -\renewcommand*{\bibfont}{\small} -\providecommand{\makebiblio}[1][reference]{% +\providecommand{\makebiblio}{% + \renewcommand{\bibfont}{\zihao{5}}% \intotoc*{\cleardoublepage}{\bibname}% - \bibliography{#1}% + \printbibliography% } % ------------------------------------------------------------------------------ % Appendix % ------------------------------------------------------------------------------ \LetLtxMacro{\origin@appendix}{\appendix} \renewcommand{\appendix}{% - \origin@appendix + \origin@appendix% \intotoc*{\cleardoublepage}{\appendixname}% \settocdepth{part}% - \pagestyle{LRPageNumberedAppendix}% + \ifsht@undergraduate% + \pagestyle{MNNumberedWithLogo}% + \else% + \pagestyle{LRNumberedAppendix}% + \fi% } % ------------------------------------------------------------------------------ % Backmatter @@ -1185,7 +1617,14 @@ \renewcommand{\backmatter}{% \origin@backmatter% \settocdepth{chapter}% - \pagestyle{LRPageNumbered}% + \ifsht@undergraduate% + \pagestyle{MNNumberedWithLogo}% + \else% + \pagestyle{LRNumbered}% + \fi% + \ifsht@undergraduate% + \ctexset{section/format += \zihao{-4}, section/indent = 0pt}% + \fi% } \newcounter{sht@resume@cnt} \setcounter{sht@resume@cnt}{0} |