LaTeX字体设置

LaTeX设置

1. LaTeX字体设置

转发自
LaTeX字体设置(一): https://www.jianshu.com/p/b1751078e28e

\usepackage{xeCJK}

\setCJKmainfont 设置 CJK 主字体,也就是设置 \rmfamily 的 CJK 字体
\setCJKsansfont 设置 CJK 无衬线的字体,也就是设置 \sffamily 的 CJK 字体
\setCJKmonofont 设置 CJK 的等宽字体,也就是设置 \ttfamily 的 CJK 字体

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


\setmainfont{Times New Roman}%缺省英文字体.serif是有衬线字体sans serif无衬线字体
\setCJKmainfont[ItalicFont={楷体}, BoldFont={黑体}]{宋体}%衬线字体 缺省中文字体为
\setCJKsansfont{黑体}
\setCJKmonofont{仿宋_GB2312}%中文等宽字体
%-----------------------xeCJK下设置中文字体------------------------------%
\setCJKfamilyfont{song}{SimSun}                             %宋体 song  
\newcommand{\song}{\CJKfamily{song}}                        
\setCJKfamilyfont{fs}{FangSong_GB2312}                      %仿宋2312 fs  
\newcommand{\fs}{\CJKfamily{fs}}                            
\setCJKfamilyfont{yh}{Microsoft YaHei}                    %微软雅黑 yh  
\newcommand{\yh}{\CJKfamily{yh}}  
\setCJKfamilyfont{hei}{SimHei}                              %黑体  hei  
\newcommand{\hei}{\CJKfamily{hei}}    
\setCJKfamilyfont{hwxh}{STXihei}                                %华文细黑  hwxh  
\newcommand{\hwxh}{\CJKfamily{hwxh}}
\setCJKfamilyfont{asong}{Adobe Song Std}                        %Adobe 宋体  asong  
\newcommand{\asong}{\CJKfamily{asong}}
\setCJKfamilyfont{ahei}{Adobe Heiti Std}                            %Adobe 黑体  ahei  
\newcommand{\ahei}{\CJKfamily{ahei}}  
\setCJKfamilyfont{akai}{Adobe Kaiti Std}                            %Adobe 楷体  akai  
\newcommand{\akai}{\CJKfamily{akai}}






%------------------------------设置字体大小------------------------%  
\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}    %七号
%------------------------------标题名称中文化-----------------------------%  
\renewcommand\abstractname{\hei 摘\ 要}  
\renewcommand\refname{\hei 参考文献}  
\renewcommand\figurename{\hei 图}  
\renewcommand\tablename{\hei 表}  
%------------------------------定理名称中文化-----------------------------%  
\newtheorem{dingyi}{\hei 定义~}[section]  
\newtheorem{dingli}{\hei 定理~}[section]  
\newtheorem{yinli}[dingli]{\hei 引理~}  
\newtheorem{tuilun}[dingli]{\hei 推论~}  
\newtheorem{mingti}[dingli]{\hei 命题~}  
\newtheorem{lizi}{{}}  




\begin{document}  
\title{高质量纹理重建中的遮蔽处理}  
\author{Archie}  
\date{}
%摘要单栏设置  
\twocolumn[  
    \begin{@twocolumnfalse}  
    \maketitle%生成标题  
    \renewcommand{\abstractname} {} %不显示摘要名字  
    \begin{abstract}  
    \noindent %摘要无缩进  
    摘要正文  
    \end{abstract}  
    \renewcommand{\abstractname}{摘要}  
    \end{@twocolumnfalse}  
]  

正文  
\section{楷体}
\ahei{A黑体}
\section{黑体}
\hei{黑体}

\end{document}  

2. Latex默认字体大小

转发自
CSDN: Regnaiq

\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge

2.1 直接定义文字字号

\fontsize{22pt}{\baselineskip}{\selectfont}文字

3. 换行首行缩进

转发自
CSDN: alone_cat

Package选择

\usepackage{indentfirst}

3.1 首行缩进两个字符

\setlength\parindent{2em}

3.2 无缩进

\noindent

4. 更改行距

更换行距为1.5倍

\usepackage{setspace}
\renewcommand{\baselinestretch}{1.5}

5. 增加目录

5.1 默认目录显示“Contents”

\usepackage{filecontens}

\begin{document}
\tableofcontents
\end{document}

5.2 将“Contents”更改为中文显示“目录”

\usepackage{filecontens}
\renewcommond\contentsname{目录}

\begin{document}
\tableofcontents
\end{document}

6 引用

\usepackage{cite}

引用时使用\cite{}

以下均放在\begin{document}之前

6.1 增加引用的右上角小标志**

引用时使用\upcite{}

\newcommand{\upcite}[1]{\textsuperscript{\textsuperscript{\cite{#1}}}} %参考文献上标

6.2 将“Bibliography”更换为中文“参考文献”

\renewcommand\refname{参考文献}

7. 隐藏引用数字的方框

\usepackage{hyperref}
\hypersetup{hidelinks}

8. 中文引用

在中文的引用时时常出现乱码如 [?],可下载胡海星 Haixing-Hu 在GitHub中分享的bst文件,链接如下

https://github.com/Haixing-Hu/GBT7714-2005-BibTeX-Style

下载后将 gbt7714-2005.bst 文件重新命名为 Chinese.bst,并保存到tex文件相同的文件夹中,即可实现中文引用的编译。

\usepackage{fontspec}    
\usepackage{xeCJK}

\begin{document}

\bibliographystyle{Chinese.bst}
\bibliography{reference.bib}

\end{documnet}
  • 5
    点赞
  • 49
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值