Skip to content

Commit

Permalink
support Overleaf
Browse files Browse the repository at this point in the history
  • Loading branch information
HuangruiMo committed Feb 11, 2020
1 parent b661eef commit 825fd04
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 26 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*`的页眉错误。
Expand Down
10 changes: 5 additions & 5 deletions Style/artracom.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
%-
Expand Down
77 changes: 57 additions & 20 deletions Style/artratex.sty
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,27 @@
%---------------------------------------------------------------------------%
\RequirePackage{etoolbox}% a toolbox of programming facilities
%-
%-> Platform fontset <windows>, <mac>, <adobe>, <times>, <others>
%-> Platform fontset <windows>, <mac>, <adobe>, <none>, <times>, <others>
%-
%- 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 <pdflatex>, <lualatex>, <xelatex>
%-
Expand Down Expand Up @@ -276,6 +280,7 @@
%-
%-> Language settings
%-
\def\artx@fontdir{./Font/}% extra font location
\ifartx@pdftex% <pdflatex> 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
Expand All @@ -291,24 +296,28 @@
\PackageError{artratex}{%
This package requires fontspec\MessageBreak 2016/12/27 or later version}{}
}
%- Font properties: <family> + <weight> + <shape> + <size>
%- Specify the three default TeX font families: <main>, <sans>, <mono>
%- \setxxxxfont{<font>}[BoldFont=<font-b>,ItalicFont=<font-i>,BoldItalicFont=<font-bi>]%
%- <font>: \mdseries\upshape; <font-b>: \bfseries\upshape; <font-i>: \mdseries\itshape
%- <\lfseries|\mdseries|\bfseries>: weight of font, default <\mdseries>
%- <\upshape|\itshape|\scshape>: shape of font, default <\upshape>
%- Font properties: <family:rm|sf|tt> + <weight:lf|md|bf> + <shape:up|it|sl|sc> + <size>
%- <\rmfamily,\textrm{}|\sffamily,\textsf{}|\ttfamily,\texttt{}>: family of font <Roman|Sans serif|Monospace>, default <\rmfamily>
%- <\lfseries,\textlf{}|\mdseries,\textmd{}|\bfseries,\textbf{}>: weight of font <light|medium|bold>, default <\mdseries>
%- <\upshape,\textup{}|\itshape,\textit{}|\scshape,\textsc{}|\slshape,\textsl{}>: shape of font <upright|italic|samll capital|slanted>, default <\upshape>
%- Specify the default TeX font families with properties: <main>, <sans>, <mono>
%- \setxxxxfont{<font>}[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\<font-switch>{<font>}[<font features>]%
%\newcommand{\text<font-switch>}[1]{{\<font-switch> #1}}%
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Thesis.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
\documentclass{Style/ucasproposal}%
%- Multiple optional arguments:
%- [<oneside|twoside|print>]% oneside eprint, twoside eprint, or paper print
%- [fontset=<adobe|...>]% specify font set to replace automatic detection
%- [fontset=<adobe|none|...>]% 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|...]%
Expand Down

0 comments on commit 825fd04

Please sign in to comment.