latex hyperref_Latex文档模版(Mac)

f072b8faef1b7ecf42933f2535000984.png

最近学着用latex写文档,还不错,只是配置模板比较繁琐。可能是系统差异导致的吧,从网上找到的模板各种用不了,搞起来各种问题,总之就没遇到一个好使的( ´▽`)

把自己整理的Mac上的Latex模板整理如下(字体部分内容是四处网罗了windows字体配置后修改的)。

documentclass[b5paper]{article} %两列
usepackage{graphicx}%插图宏集
usepackage{titletoc}%要调整章节标题在目录页中的格式,可以用titletoc宏包 title of contents
usepackage{titlesec} %其中 center 可使标题居中,还可设为 raggedleft (居左,默认),
%usepackage{abstract}摘要分栏的宏包
usepackage{fontspec, xunicode, xltxtra}
usepackage{xeCJK} %中文字体
usepackage{fancyhdr} %页眉页脚
usepackage{indentfirst} % 段落首行缩进

usepackage{tabularx} % 表格

usepackage{color}
usepackage{hyperref} %超链接
hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=blue,      
    urlcolor=blue,
    citecolor=cyan,
}

title{XXX对接区块链智能合约接口文档V1.0}
author{小米金融区块链实验室}
date{} %%如果没有这句,会生成时间

% 配置页眉页脚
pagestyle{fancy}
lhead{author}
chead{date}
rhead{智能合约接口文档}
lfoot{}
cfoot{thepage}
rfoot{}
renewcommand{headrulewidth}{0.4pt}
renewcommand{headwidth}{textwidth}
renewcommand{footrulewidth}{0pt}

usepackage{setspace}
% linespread{1.3} % 配置行间距
addtolength{parskip}{0.25cm} % 配置段落间距

setmainfont{Times New Roman} %缺省英文字体 Times New Roman
% setCJKmainfont[ItalicFont={Microsoft YaHei}, BoldFont={SimHei}]{PingFang SC} %衬线字体 缺省中文字体为
setCJKmainfont{PingFang SC} %衬线字体 缺省中文字体为
% setCJKmainfont{Lantinghei SC} %衬线字体 缺省中文字体为
setCJKsansfont{Heiti SC} %serif是有衬线字体sans serif无衬线字体。
setCJKmonofont{FangSong} %中文等宽字体
%-----------------------xeCJK下设置中文字体------------------------------%
setCJKfamilyfont{song}{SimSun}                             %宋体 song
newcommand{song}{CJKfamily{song}}                        % 宋体
setCJKfamilyfont{kai}{KaiTi SC}                        %楷体2312  kai
newcommand{kai}{CJKfamily{kai}}                          
setCJKfamilyfont{yh}{Microsoft YaHei}                    %微软雅黑 yh
newcommand{yh}{CJKfamily{yh}}
setCJKfamilyfont{hei}{SimHei}                                    %黑体  hei
newcommand{hei}{CJKfamily{hei}}                          % 黑体

%------------------------------设置字体大小------------------------%
newcommand{chuhao}{fontsize{42pt}{baselineskip}selectfont}     %初号
newcommand{xiaochuhao}{fontsize{36pt}{baselineskip}selectfont} %小初号
newcommand{yihao}{fontsize{28pt}{baselineskip}selectfont}      %一号
newcommand{erhao}{fontsize{21pt}{baselineskip}selectfont}      %二号
newcommand{xiaoerhao}{fontsize{18pt}{baselineskip}selectfont}  %小二号
newcommand{sanhao}{fontsize{15.75pt}{baselineskip}selectfont}  %三号
newcommand{sihao}{fontsize{14pt}{baselineskip}selectfont}%     四号
newcommand{xiaosihao}{fontsize{12pt}{baselineskip}selectfont}  %小四号
newcommand{wuhao}{fontsize{10.5pt}{baselineskip}selectfont}    %五号
newcommand{xiaowuhao}{fontsize{9pt}{baselineskip}selectfont}   %小五号
newcommand{liuhao}{fontsize{7.875pt}{baselineskip}selectfont}  %六号
newcommand{qihao}{fontsize{5.25pt}{baselineskip}selectfont}    %七号
%------------------------------标题名称中文化-----------------------------%
renewcommandabstractname{hei 摘 要}
renewcommandrefname{hei 参考文献}
renewcommandfigurename{hei 图}
renewcommandtablename{hei 表}
%------------------------------定理名称中文化-----------------------------%
newtheorem{dingyi}{hei 定义~}[section]
newtheorem{dingli}{hei 定理~}[section]
newtheorem{yinli}[dingli]{hei 引理~}
newtheorem{tuilun}[dingli]{hei 推论~}
newtheorem{mingti}[dingli]{hei 命题~}
newtheorem{lizi}{{例}}

linespread{1.3} % 配置行间距
begin{document}

maketitle  %%生成书名

thispagestyle{empty} 

newpage

setcounter{page}{1}

section{文档内容介绍}

本文档作为……

subsection{背景}

「智能合约」是联盟区块链支持的功能,但并不是区块链自身需要智能合约,而是业务层要通过智能合约来访问区块链。所以一般情况下,【智能合约】跑的是业务逻辑。

section{智能合约接口设计}

subsection{设计依据(输入)}
本质上「智能合约」是在跑业务逻辑,智能合约的所有功能也都是提供给业务层来使用的,所以本文档的设计依据完全是业务线需求。

本文档的设计依据主要是两个输入:1)业务线需求;2)数据格式文档。

textbf{业务线需求}

业务线需求没有正式文档,经各业务线产品经理确认,业务线的完整需求如下:
vspace{-0.3cm}
begin{itemize}
setlengthitemsep{0pt}
setlengthparskip{0pt}
setlengthparsep{0pt}
item XX01 保贴申请合约
item XX00 融资申请合约
item 分别以serialNo 作为主键,且只支持它主键查询即可
end{itemize}

textbf{数据格式文档}

subsection{业务需求解析}

根据业务线需求,只有两个数据结构需要入链操作:「XX00」和「XX01」。

subsection{接口详情}

subsubsection{XX00入链}

函数:financing

输入参数

noindent
begin{tabularx}{1.0textwidth} { 
  | >{setlength{hsize}{.5hsize}centeringarraybackslash}X 
  | >{setlength{hsize}{.5hsize}centeringarraybackslash}X 
  | >{setlength{hsize}{2hsize}arraybackslash}X | }

  hline
  hspace{0cm}textbf{参数} & hspace{0cm}textbf{格式} & hspace{3cm}textbf{备注} 

  hline
  data & json string & 完整的数据内容 
  
  hline
end{tabularx}

返回参数

noindent
begin{tabularx}{1.0textwidth} { 
  | >{setlength{hsize}{.5hsize}centeringarraybackslash}X 
  | >{setlength{hsize}{.5hsize}centeringarraybackslash}X 
  | >{setlength{hsize}{2hsize}arraybackslash}X | }

  hline
  hspace{0cm}textbf{参数} & hspace{0cm}textbf{格式} & hspace{3cm}textbf{备注} 

  hline
  Status & int & 错误代码 

  hline
  Result & string & 调用结果 

  hline
  Function & string & 被调用的函数名 
  
  hline
end{tabularx}

subsubsection{XX00查询}


subsubsection{XX01入链}


subsubsection{XX01查询}


subsection{错误代码}

newpage

{large 附件}

end{document}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值