1 Star 0 Fork 0

ekli/dailynote

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
easyreport.cls 10.17 KB
一键复制 编辑 原始数据 按行查看 历史
ekli 提交于 2022-05-25 22:28 . update tex
%% ===============================================
%% File Name: easyreport.cls
%% Author: ekli
%% mail: ekli_091@qq.com
%% Created Time: 2021-09-18 08:47:51
%% ===============================================
%% This is an template for some report.
%%
\ProvidesClass{easyreport}[This is an template for some report.]
\NeedsTeXFormat{LaTeX2e}
\typeout{Documentclass `easyreport` v0.1 by ekli (2021/09/18)}
\RequirePackage{expl3}
%%================================================
%% Options or parameters of information
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions
\LoadClass[a4paper,oneside]{article}
%% margin of the page
\RequirePackage[%
top=1.2cm,
bottom=2cm,
left=1.9cm,
right=1.9cm,
head=1.2cm,
foot=1.54cm,
headsep=0.54cm,
footskip=0.5cm,
includehead, includefoot,
]{geometry}
%% load chinese
\RequirePackage{fontenc}
\RequirePackage[AutoFakeBold=true, AutoFakeSlant=true]{xeCJK}
\setCJKmainfont[%
%BoldFont=SimHei,%
%ItalicFont=KaiTi%
]{Microsoft YaHei}
\setmainfont[Path = ./fonts/, BoldFont=arialbd, ItalicFont=arialbi]{arial}
\usepackage[greek,english]{babel}
%%\setCJKsansfont{KaiTi}
%% define chines font
\newCJKfontfamily[songti]\songti{SimSun} %% 宋体
\newCJKfontfamily[heiti]\heiti{SimHei} %% 黑体
\newCJKfontfamily[kaiti]\kaiti{KaiTi} %% 楷体
\newCJKfontfamily[fsong]\fsong{FangSong} %% 仿宋
\newCJKfontfamily[stsong]\stsong{STSong} %% 华文宋体
\newCJKfontfamily[xkai]\xkai{STXingkai} %% 华文行楷
\newCJKfontfamily[lisu]\lisu{LiSu} %% 隶书
\newCJKfontfamily[lishu]\lishu{LiSu} %% 隶书
\xeCJKsetwidth{}{1em}
\xeCJKsetwidth{}{1em}
\xeCJKsetwidth{}{1em}
\xeCJKsetwidth{}{1em}
\xeCJKsetwidth{}{1em}
\xeCJKsetwidth{}{1em} %% 标点符号宽度
\xeCJKsetkern{}{}{0.5em} %% 前后标点符号间距
\xeCJKsetkern{}{}{1em}
\xeCJKsetkern{}{}{1em}
%% font size
\newcommand{\chuhao}{\fontsize{42bp}{50.4bp}\selectfont} % 初号
\newcommand{\xiaochu}{\fontsize{36bp}{43.2bp}\selectfont} % 初号
\newcommand{\yihao}{\fontsize{26bp}{31.2bp}\selectfont} % 一号
\newcommand{\xiaoyi}{\fontsize{24bp}{28.8bp}\selectfont} % 小一
\newcommand{\erhao}{\fontsize{22bp}{26.4bp}\selectfont} % 二号
\newcommand{\xiaoer}{\fontsize{18bp}{21.6bp}\selectfont} % 小二
\newcommand{\sanhao}{\fontsize{16bp}{19.2bp}\selectfont} % 三号
\newcommand{\xiaosan}{\fontsize{15bp}{18bp}\selectfont} % 小三
\newcommand{\sihao}{\fontsize{14bp}{16.8bp}\selectfont} % 四号
\newcommand{\xiaosi}{\fontsize{12bp}{14.4bp}\selectfont} % 小四
\newcommand{\wuhao}{\fontsize{10.5bp}{12.6bp}\selectfont} % 五号
\newcommand{\xiaowu}{\fontsize{9bp}{10.8bp}\selectfont} % 小五
\newcommand{\liuhao}{\fontsize{7.5bp}{9bp}\selectfont} % 六号
\newcommand{\xiaoliu}{\fontsize{6.5bp}{7.8bp}\selectfont} % 小六
\newcommand{\qihao}{\fontsize{5.5bp}{6.6bp}\selectfont} % 七号
\newcommand{\bahao}{\fontsize{5bp}{6bp}\selectfont} % 八号
\newcommand{\zihao}[1]{\fontsize{#1}{#1}\selectfont}
%% packages
\RequirePackage{graphicx}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{mathrsfs}
\RequirePackage{amsfonts}
\RequirePackage{bm}
%\allowdisplaybreaks[4] % float equations
\RequirePackage{indentfirst} %% 首行缩进
\setlength{\parindent}{2.15em}
%% captions
%\RequirePackage{caption}
%\DeclareCaptionFont{capFont}{\kaiti\wuhao}
%\captionsetup{%
% font=capFont,
% figurename=图,
% tablename=表,
%}
%% define some color
\RequirePackage{xcolor}
\definecolor{defblue}{RGB}{19,85,152} %% 默认蓝色
\definecolor{qinglan}{RGB}{86,152,195} %% 晴蓝
\definecolor{jingtianlan}{RGB}{195,215,223} %% 井天蓝
\definecolor{xiancaihong}{RGB}{166,27,41} %% 苋菜红
\definecolor{heyelv}{RGB}{26,104,64} %% 荷叶绿
\RequirePackage{tikz}
\RequirePackage[%
unicode=true, %
bookmarksopen=true, %
pdffitwindow=true, %
colorlinks=true, %
linkcolor=black, %
citecolor=black, %
urlcolor=black, %
hyperfootnotes=false, %
pdfpagemode=UseNone, %
]{hyperref} %% 引用、链接颜色
\RequirePackage{fancyhdr} %% 页眉页脚
\newcommand{\linespacing}[1]{\linespread{#1}\selectfont} %% 行距命令
\renewcommand{\today}{\number\year\number\month\number\day} %% 汉语日期
%\renewcommand{\contentsname}{目\quad 录} %% 目录中文
%% 定义行间距
\linespread{1.5}\selectfont
%% 重构标题
\def\subtitle#1{\def\@subtitle{#1}} \def\@subtitle{}
\def\entitle#1{\def\@entitle{#1}} \def\@entitle{}
%% abstract
\newcommand{\abstracttitle}{\quad}
\newcommand{\keywordstitle}{关键词}
\def\abstract#1{\def\@abstract{#1}} \def\@abstract{}
\def\keywords#1{\def\@keywords{#1}} \def\@keywords{}
%%\renewenvironment{abstract}{%
%% \begin{center}
%% \renewcommand{\arraystretch}{0.25}
%% \begin{tabular}{p{0.09\linewidth}p{0.85\linewidth}}
%% {\lisu \abstracttitle} & \wuhao\xkai
%%}{
%% \\
%% {\lisu \keywordstitle} & \wuhao\xkai \@keywords \\
%% \end{tabular}
%% \end{center}
%%}
%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%% maketitle
\renewcommand{\maketitle}{
\pagestyle{empty}
\color{defblue}
~\par\vspace{3cm}
{\xiaochu \textbf{\@title}}\par
\vspace{2.5cm}
{\xiaochu \textbf{\@subtitle}}\par
\vspace{2.5cm}
{\zihao{30pt} \@entitle}\par
\color{black}
%%========================
\clearpage
%%=========================
\setcounter{page}{1}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{\xiaowu \textcolor{blue}{Telephone: 4008808776 \hspace{0.7cm}%
Website: www.eoulu.com \hspace{0.7cm}%
Email: info@eoulu.com}}
\fancyfoot[R]{\xiaowu ~\\ ~\thepage ~}
\fancyhead[L]{{\includegraphics[width=0.18\linewidth]{figs/logo.eps}} }
%\lfoot{}
%\cfoot{\footnotesize TELE}
%\rfoot{~\thepage~}
\zihao{10.5bp}
}
%% 标题格式定义
\RequirePackage{zhnumber}
\renewcommand{\thesection}{\zhnum{section}}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
\RequirePackage{titlesec} % 控制标题的宏包
\RequirePackage{titletoc} % 控制目录的宏包
\titleformat{\section}{\sihao\bfseries}{\thesection}{0.5em}{}
\titleformat{\subsection}{\xiaosi\bfseries}{\thesubsection}{0.5em}{}
\titlespacing{\section}{0pt}{0.5em}{1.2em}[0pt]
\titlespacing{\subsection}{0pt}{1em}{1em}[0pt]
\titlecontents{section}%
[1em]%
{}%
{\thecontentslabel\,}%
{}%
{\;\titlerule*[0.5pc]{.}\;\thecontentspage\hspace*{-1.2em}}%
\titlecontents{subsection}%
[2em]%
{}%
{\thecontentslabel.\,}%
{}%
{\;\titlerule*[0.5pc]{.}\;\thecontentspage\hspace*{-1.2em}}%
%% 目录重定义
\setcounter{secnumdepth}{2} % 章节层次
\renewcommand{\tableofcontents}{%
\begin{center}
\vspace*{0.5em}
\sanhao\textbf{目录}%
\vspace{0.5em}
\end{center}
{\wuhao\linespacing{2.0}%
\@starttoc{toc}
}
\clearpage
\setcounter{page}{1}
}
%% 自定义计数器
\newcounter{tabfig}[section]
\renewcommand{\thetabfig}{\arabic{section}.\arabic{tabfig}.}
\newcommand{\figs}{\addtocounter{tabfig}{1}\thetabfig}
%% 额外宏包
\RequirePackage{longtable}
\RequirePackage{multirow}
\RequirePackage{array}
\RequirePackage{makecell}
\usepackage{indentfirst}
\setlength{\parindent}{2em}
\renewcommand{\arraystretch}{1.5}
\setlength\tabcolsep{0pt}
\setlength\floatsep{0pt}
\RequirePackage{tikz}
\newcommand{\inputtikzarry}[2][5cm]{%
\begin{tikzpicture}
\node[minimum height=#1, align=center] at (0,0) {#2};
\end{tikzpicture}
}
%% 定义插入图片说明
\newcommand{\tabelem}[5][0.8]{%
\parbox[b]{0.9\linewidth}{%
\vspace*{0.8em}%
\centerline{#2}
\ifx\equal{#3}{~}
\else
\hspace{2em} #3
\fi
}
& %
\parbox[b]{0.95\linewidth}{%
\centering \vspace*{1.3em} %
\includegraphics[width=#1\linewidth]{#4} \\%
\figs~ #5~\vspace{0.2em}\par
}
}
\newcommand{\inputfig}[3][0.8]{%
\parbox[b]{\linewidth}{%
\vspace*{1.2em}
\centering
\includegraphics[width=#1\linewidth]{#2} \\
\figs~ #3 ~\par
}
}
\newcommand{\inputfigno}[3][0.8]{%
\parbox[b]{\linewidth}{%
\centering \vspace*{1.2em}
\includegraphics[width=#1\linewidth]{#2} \\
#3 ~\par
}
}
\newcommand{\inputtxt}[2]{%
\parbox[b]{0.9\linewidth}{
\ifx\equal{#2}{}%
\vspace*{1.8em}
\parbox[b]{\linewidth}{\centering #1}
\else\ifx\equal{#1}{}
\parbox[b]{\linewidth}{%
\hspace{2em}#2}
\else
\vspace*{0.8em}
\parbox[b]{\linewidth}{%
\centerline{#1}
\hspace{2em}#2 }
\fi
\fi
}
}
\newcommand{\rowmerge}[3][2]{%
\ifx\equal{#1}{2}
\multirow{2}{*}{%
\inputtxt{#2}{#3}
}
\else
\multirow{#1}{*}{%
\inputtxt{#2}{#3}
}
\fi
}
\newcommand{\colmerge}[2]{%
\multicolumn{2}{|c|}{%
\inputtxt{#1}{#2}
}
}
\newenvironment{fixtable}{%
\renewcommand{\arraystretch}{1.5}
\setlength\tabcolsep{0pt}
\setlength\floatsep{0pt}
\noindent
\begin{center}
\begin{tabular}{@{}m{0cm}|%
m{0.498\linewidth}<{\centering\arraybackslash}|%
m{0.498\linewidth}<{\centering\arraybackslash}|%
@{}}
}{
\end{tabular}
\end{center}
}
\newenvironment{intable}{%
\renewcommand{\arraystretch}{1.5}
\setlength\tabcolsep{0pt}
\setlength\floatsep{0pt}
\begin{center}
%\noindent
%\centering
\begin{tabular}%
{@{}|m{0.498\linewidth}<{\centering\arraybackslash}|%
m{0.498\linewidth}<{\centering\arraybackslash}|@{}}
}{
\end{tabular}
\end{center}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage{background}
%\backgroundsetup{scale = 1, angle = 0, color = cyan,
% contents = \tikz{\draw[step = 5mm]
% (-.5\paperwidth, -.5\paperheight)
% grid (.5\paperwidth, .5\paperheight);}}
%
\newcommand{\arrayheight}[1][5cm]{\rule{0pt}{#1}}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ekli/dailynote.git
git@gitee.com:ekli/dailynote.git
ekli
dailynote
dailynote
master

搜索帮助