Skip to content

Commit

Permalink
change fixed spacing to flexible spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanDeng committed Mar 20, 2020
1 parent 914049a commit 1a0174f
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.*.lb
elegantnote-en.pdf
elegantnote-cn.pdf
clean.bat

## Intermediate documents:
*.dvi
Expand Down
5 changes: 0 additions & 5 deletions delete-temp-files.bat

This file was deleted.

7 changes: 4 additions & 3 deletions elegantnote-cn.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
%!TEX program = xelatex
\documentclass[cn,hazy,blue,screen,14pt]{elegantnote}

\documentclass[cn,hazy,blue,14pt,screen,founder]{elegantnote}
\title{ElegantNote:一个优美的 \LaTeX{} 笔记模板}

\author{邓东升}
Expand All @@ -9,6 +8,8 @@
\version{2.20}
\date{\zhtoday}

\usepackage{array}

\begin{document}

\maketitle
Expand Down Expand Up @@ -221,7 +222,7 @@ \section{捐赠}
\small
\centering
\caption{Elegant\LaTeX{} 系列模板捐赠榜}
\begin{tabular}{cccccccc}
\begin{tabular}{*{8}{>{\scriptsize}c}}
\toprule
\textbf{捐赠者} & \textbf{金额} & \textbf{时间} & \textbf{渠道} & \textbf{捐赠者} & \textbf{金额} & \textbf{时间} & \textbf{渠道} \\
\midrule
Expand Down
101 changes: 77 additions & 24 deletions elegantnote.cls
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

\RequirePackage{kvoptions}
\RequirePackage{ifthen}
\RequirePackage{ifxetex}
% \RequirePackage{ifxetex}
\RequirePackage{etoolbox}
\RequirePackage{calc}

Expand Down Expand Up @@ -45,6 +45,11 @@
\DeclareVoidOption{geye}{\ekv{mode=geye}}
\DeclareVoidOption{hazy}{\ekv{mode=hazy}}

\DeclareStringOption[ctexfont]{chinesefont}
\DeclareVoidOption{ctexfont}{\ekv{chinesefont=ctexfont}}
\DeclareVoidOption{founder}{\ekv{chinesefont=founder}}
\DeclareVoidOption{nofont}{\ekv{chinesefont=nofont}}

\DeclareStringOption[numbers]{cite}
\DeclareVoidOption{numbers}{\ekv{cite=numbers}}
\DeclareVoidOption{authoryear}{\ekv{cite=authoryear}}
Expand All @@ -65,30 +70,79 @@
\PassOptionsToPackage{no-math}{fontspec}
\RequirePackage{amsmath,amsthm}

\RequirePackage{iftex}

\ifdefstring{\ELEGANT@lang}{cn}{%
\RequirePackage[UTF8,scheme=plain]{ctex}
\AfterEndPreamble{\renewcommand{\itshape}{\kaishu}}
\ifXeTeX
\ifdefstring{\ELEGANT@chinesefont}{founder}{
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}
\setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
\setCJKsansfont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZHei-B01}
\setCJKmonofont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZFangSong-Z02}
\setCJKfamilyfont{zhsong}{FZShuSong-Z01}
\setCJKfamilyfont{zhhei}{FZHei-B01}
\setCJKfamilyfont{zhkai}{FZKai-Z03}
\setCJKfamilyfont{zhfs}{FZFangSong-Z02}
\newcommand*{\songti}{\CJKfamily{zhsong}}
\newcommand*{\heiti}{\CJKfamily{zhhei}}
\newcommand*{\kaishu}{\CJKfamily{zhkai}}
\newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax}

\ifdefstring{\ELEGANT@chinesefont}{nofont}{
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax}

\ifdefstring{\ELEGANT@chinesefont}{ctexfont}{
\RequirePackage[UTF8,scheme=plain]{ctex}}{\relax}
\else
\ifdefstring{\ELEGANT@chinesefont}{ctexfont}{
\RequirePackage[UTF8,scheme=plain]{ctex}}{\relax}
\fi
\AfterEndPreamble{
% \renewcommand{\itshape}{\kaishu}
\setlength\parindent{2\ccwd}}
}{\relax}


\ifcsname kaishu\endcsname
\newcommand{\citshape}{\kaishu}
\else
\newcommand{\citshape}{\itshape}
\fi

\ifcsname fangsong\endcsname
\newcommand{\cfs}{\fangsong}
\else
\newcommand{\cfs}{\normalfont}
\fi


% newtxtext and newtxmath pkg
\RequirePackage{newtxtext}
\RequirePackage{newtxmath}
\RequirePackage{esint}
% \RequirePackage{newtxmath}

%%% use yhmath pkg, uncomment following code
% \let\oldwidering\widering
% \let\widering\undefined
% \RequirePackage{yhmath}
% \let\widering\oldwidering

%%% use esvect pkg, uncomment following code
% \RequirePackage{esvect}
\ifdefstring{\ELEGANT@math}{mtpro2}{
\let\Bbbk\relax
\RequirePackage[lite]{mtpro2}
}{\relax}

\DeclareSymbolFont{CMlargesymbols}{OMX}{cmex}{m}{n}
\let\sumop\relax\let\prodop\relax
\DeclareMathSymbol{\sumop}{\mathop}{CMlargesymbols}{"50}
\DeclareMathSymbol{\prodop}{\mathop}{CMlargesymbols}{"51}
\ifdefstring{\ELEGANT@math}{newtx}{
\RequirePackage{newtxmath}
\let\Bbbk\relax
\RequirePackage{esint}
%%% use yhmath pkg, uncomment following code
% \let\oldwidering\widering
% \let\widering\undefined
% \RequirePackage{yhmath}
% \let\widering\oldwidering

%%% use esvect pkg, uncomment following code
% \RequirePackage{esvect}

\DeclareSymbolFont{CMlargesymbols}{OMX}{cmex}{m}{n}
\let\sumop\relax\let\prodop\relax
\DeclareMathSymbol{\sumop}{\mathop}{CMlargesymbols}{"50}
\DeclareMathSymbol{\prodop}{\mathop}{CMlargesymbols}{"51}
}{\relax}

\RequirePackage{indentfirst}
\RequirePackage{anyfontsize}
Expand Down Expand Up @@ -146,16 +200,16 @@
}

\let\openbox\relax
\newtheoremstyle{plain}{3pt}{3pt}{\itshape}{}{%
\newtheoremstyle{plain}{\topsep}{\topsep}{\citshape}{}{%
\color{ecolor}\bfseries}{}{%
0.5em}{%
\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}}

\newtheoremstyle{definition}{3pt}{3pt}{\itshape}{}{%
\newtheoremstyle{definition}{\topsep}{\topsep}{\citshape}{}{%
\color{ecolor}\bfseries}{}{%
0.5em}{}

\newtheoremstyle{remark}{3pt}{3pt}{\itshape}{}{
\newtheoremstyle{remark}{\topsep}{\topsep}{\citshape}{}{
\color{ecolor}\bfseries}{}{
0.5em}{}

Expand Down Expand Up @@ -206,7 +260,6 @@
\definecolor{ecyan}{RGB}{0,175,152}
\definecolor{eblue}{RGB}{20,50,104}
\definecolor{sakura}{RGB}{255,183,197}
% \definecolor{black}{RGB}{255,183,197}

%% device settings
%% default=pad
Expand Down Expand Up @@ -265,13 +318,13 @@
\fancyfoot[C]{\footnotesize\textcolor{gray}{\thepage}}
}


\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[R]{\footnotesize\textcolor{gray}{\thepage}}}

\pagestyle{fancy-note}


\ifdefstring{\ELEGANT@lang}{cn}{%
\theoremstyle{plain}% default
\newtheorem{theorem}{定理}[section] %
Expand Down Expand Up @@ -384,11 +437,11 @@

\IfEmpty\version
\else
{\normalfont\itshape\versiontext\the\version \\}
{\normalfont\citshape\versiontext\the\version \\}
\fi
\ifx\@date\empty
\else
{\normalfont\itshape\updatetext\@date}%
{\normalfont\citshape\updatetext\@date}%
\fi
\end{center}%
\par}
Expand Down

0 comments on commit 1a0174f

Please sign in to comment.