diff --git a/README.md b/README.md index 9ee0564..e28fb64 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ ## 更新记录 +* `2020-02-11` 根据 [ck2019ML, issue #182](https://github.com/mohuangrui/ucasthesis/issues/182)、[univeryinli, issue #229](https://github.com/mohuangrui/ucasthesis/issues/229) 将ucasproposal在Overleaf发布并支持调用外部字体,详见[字体配置](https://github.com/mohuangrui/ucasthesis/wiki/字体配置)。 + * `2020-01-09` 根据 [NineSH, issue #223](https://github.com/mohuangrui/ucasthesis/issues/223) 修复`bicaption`错误。 * `2019-10-12` 根据 [huiwenzhang, issue #198](https://github.com/mohuangrui/ucasthesis/issues/198) 修复`mainmatter`下`\chapter*`的页眉错误。 diff --git a/Style/artracom.sty b/Style/artracom.sty index 226dde4..e6fa431 100644 --- a/Style/artracom.sty +++ b/Style/artracom.sty @@ -30,9 +30,8 @@ %->> User added packages %---------------------------------------------------------------------------% %- this part adds normal packages -%\RequirePackage{chemfig}% draw 2D chemical structures -%\RequirePackage{mhchem}% typeset chemical formulae [mhchem|chemformula] - +\RequirePackage{chemfig}% draw 2D chemical structures +\RequirePackage[version=4]{mhchem}% typeset chemical formulae [mhchem|chemformula] %- this part adds packages that should be loaded at the very end \AtEndPreamble{% %\RequirePackage{cleveref}% clever cross-referencing @@ -99,8 +98,9 @@ %- %-> Graphical length factor %- -\providecommand*{\MyFactor}{0.6}% for single figure -\providecommand*{\MySubFactor}{0.45}% for subfigure +\providecommand*{\onef}{0.6}% for single figure +\providecommand*{\twof}{0.45}% for two subfigures +\providecommand*{\trif}{0.32}% for three subfigures %- %-> Add dots before equation number %- diff --git a/Style/artratex.sty b/Style/artratex.sty index 351978e..301f1a1 100644 --- a/Style/artratex.sty +++ b/Style/artratex.sty @@ -18,23 +18,27 @@ %---------------------------------------------------------------------------% \RequirePackage{etoolbox}% a toolbox of programming facilities %- -%-> Platform fontset , , , , +%-> Platform fontset , , , , , %- +%- Fetch the fontset value as user specified or automatically set based on os type \RequirePackage{expl3}% LaTeX3 programming environment \ExplSyntaxOn% \providecommand{\g__ctex_fontset_tl}{}% platform fontset state variable \edef\artxfontset{\g__ctex_fontset_tl}% expanded platform fontset state variable \ExplSyntaxOff% +%- Specify font set according to the value of fontset \newif\ifartx@windows \artx@windowsfalse \newif\ifartx@mac \artx@macfalse \newif\ifartx@adobe \artx@adobefalse +\newif\ifartx@none \artx@nonefalse \newif\ifartx@times \artx@timesfalse \newif\ifartx@others \artx@othersfalse \newcommand{\artxifstreq}{\expandafter\ifstrequal\expandafter}% expansion control \artxifstreq{\artxfontset}{windows}{\artx@windowstrue\artx@timestrue}{% \artxifstreq{\artxfontset}{mac}{\artx@mactrue\artx@timestrue}{% \artxifstreq{\artxfontset}{adobe}{\artx@adobetrue\artx@timestrue}{% -\artx@otherstrue\artx@timesfalse}}} +\artxifstreq{\artxfontset}{none}{\artx@nonetrue\artx@timestrue}{% +\artx@otherstrue\artx@timesfalse}}}} %- %-> LaTeX engine , , %- @@ -276,6 +280,7 @@ %- %-> Language settings %- +\def\artx@fontdir{./Font/}% extra font location \ifartx@pdftex% call font packages \RequirePackage[utf8]{inputenc}% set input encoding, document must use utf-8 encoding \RequirePackage[T1]{fontenc}% set font encoding to enable modern font encoding @@ -291,24 +296,28 @@ \PackageError{artratex}{% This package requires fontspec\MessageBreak 2016/12/27 or later version}{} } - %- Font properties: + + + - %- Specify the three default TeX font families:
, , - %- \setxxxxfont{}[BoldFont=,ItalicFont=,BoldItalicFont=]% - %- : \mdseries\upshape; : \bfseries\upshape; : \mdseries\itshape - %- <\lfseries|\mdseries|\bfseries>: weight of font, default <\mdseries> - %- <\upshape|\itshape|\scshape>: shape of font, default <\upshape> + %- Font properties: + + + + %- <\rmfamily,\textrm{}|\sffamily,\textsf{}|\ttfamily,\texttt{}>: family of font , default <\rmfamily> + %- <\lfseries,\textlf{}|\mdseries,\textmd{}|\bfseries,\textbf{}>: weight of font , default <\mdseries> + %- <\upshape,\textup{}|\itshape,\textit{}|\scshape,\textsc{}|\slshape,\textsl{}>: shape of font , default <\upshape> + %- Specify the default TeX font families with properties:
, , + %- \setxxxxfont{}[Path=<>,Extension=<>,UprightFont=<>,BoldFont=<>,ItalicFont=<>,BoldItalicFont=<>,SlantedFont=<>,BoldSlantedFont=<>,SmallCapsFont=<>]% + %- The default setup for font loading automatically adds the Ligatures=TeX feature for the \setmainfont and \setsansfont commands + %- Fonts known to LuaTEX or XETEX may be loaded by their standard names as you'd speak them out loud + %- Fonts in the search path can be loaded by file name instead, but must include bold and italic variants explicitly + %- When a font family has both slanted and italic shapes, these may be specified separately using the analogous features ItalicFont and SlantedFont + %- Without these, the font switches for slanted (\textsl{},\slshape) will default to the italic shape %- Roman or Serif - typefaces with strokes - for main content - %- examples: Times New Roman, Garamond, Adobe Garamond Pro - %\setmainfont{Garamond}[BoldFont=Garamond-Bold,ItalicFont=Garamond-Italic]% - %- font switches: {\rmfamily ...}, \textrm{...}, {\normalfont ...}, \textnormal{...} - %- the latter is due to \renewcommand*{\familydefault}{\rmdefault} + %- examples: Times New Roman, Adobe Garamond Pro + %\setmainfont{Adobe Garamond Pro}% + %- extra font switches: {\normalfont ...}, \textnormal{...} due to \renewcommand*{\familydefault}{\rmdefault} %- Sans serif - typefaces without strokes - for headings demanding high readability - %- examples: Arial, Helvetica, Gill Sans, Futura - %\setsansfont{Gill Sans MT}% font switches: {\sffamily ...}, \textsf{...} + %- examples: Arial, Helvetica, Gill Sans MT, Futura + %\setsansfont{Gill Sans MT}% %- Monospaced - typefaces with same width - for programming, etc %- examples: Rockwell, Andale Mono, Courier - %\setmonofont{Rockwell}% font switches: {\ttfamily, ...}, \texttt{...} - %- Specify user-defined font families and font switches + %\setmonofont{Rockwell}% + %- Specify user-defined font families and font switches (like \rmfamily, \sffamily, \ttfamily) %- without NFSSFamily option, a font family is defined only if adding a new font name %\newfontfamily\{}[]% %\newcommand{\text}[1]{{\ #1}}% @@ -407,11 +416,39 @@ ] \setCJKsansfont{Heiti SC}[BoldFont = * Medium]% \setCJKmonofont{STFangsong}% - \else\ifartx@adobe% - \setCJKmainfont{AdobeSongStd-Light}[AutoFakeBold=2.5,ItalicFont=AdobeKaitiStd-Regular]% - \setCJKsansfont{AdobeHeitiStd-Regular}[AutoFakeBold=2.5]% + \else\ifartx@adobe% call font from system font library + \setCJKmainfont{AdobeSongStd-Light}[% + AutoFakeBold=2.5, + ItalicFont=AdobeKaitiStd-Regular, + ] + \setCJKsansfont{AdobeHeitiStd-Regular}[% + AutoFakeBold=2.5, + ]% \setCJKmonofont{AdobeFangsongStd-Regular}% - \fi\fi\fi + \else\ifartx@none% call font from local fontdir + %- Without path: i) if font specified by a string without extension, fontspec will + %- treat the given string as font name and use system fontconfig to search the font name + %- in system font library; ii) if font specified by a string with extension, fontspec will + %- treat the given string as font filename and use kpathsea to search the font filename in + %- LaTeX distribution + %- With path: fontspec will treat the given string as font filename and use kpathsea to + %- search the font filename in path, and extension is optional but recommended in this case + \setCJKmainfont{AdobeSongStd-Light}[% + Path=\artx@fontdir, + Extension=.otf, + AutoFakeBold=2.5, + ItalicFont=AdobeKaitiStd-Regular, + ] + \setCJKsansfont{AdobeHeitiStd-Regular}[% + Path=\artx@fontdir, + Extension=.otf, + AutoFakeBold=2.5, + ]% + \setCJKmonofont{AdobeFangsongStd-Regular}[% + Path=\artx@fontdir, + Extension=.otf, + ] + \fi\fi\fi\fi \fi %- %-> Bibliography processor and package diff --git a/Thesis.tex b/Thesis.tex index ff72a40..5e439a0 100644 --- a/Thesis.tex +++ b/Thesis.tex @@ -14,7 +14,7 @@ \documentclass{Style/ucasproposal}% %- Multiple optional arguments: %- []% oneside eprint, twoside eprint, or paper print -%- [fontset=]% specify font set to replace automatic detection +%- [fontset=]% specify font set instead of automatic detection %- [scheme=plain]% thesis writing of international students %- [draftversion]% show draft version information %- [standard options for ctex article class: draft|paper size|font size|...]%