xelatex 中文排版与字体更换 您所在的位置:网站首页 如何设置宋体中文正文 xelatex 中文排版与字体更换

xelatex 中文排版与字体更换

2024-07-12 01:14| 来源: 网络整理| 查看: 265

一个简单的中文文档

下面几行简单的命令,可以实现一份最简单的中文文档

并且全局使用一种字体

\documentclass[11pt]{article} \usepackage{xeCJK} % 设置文档正文字体为宋体 \setCJKmainfont[BoldFont=SimHei]{SimSun} \setCJKmonofont{SimSun} % 设置缺省中文字体 \parindent 2em % 段首缩进 \begin{document} \section{举例} % 无需排版的多行内容 \begin{verbatim} 标点。 \end{verbatim} 汉字Chinese数学$x=y$空格 \end{document} 使用xelatex更换字体

cmd 中命令fc-list :lang-zh,会显示中文乱码,这不重要

知道window下的字体映射如下即可

STCaiyun,华文彩云:style=Regular YouYuan,幼圆:style=Regular PMingLiU,新細明體:style=Regular STHupo,华文琥珀:style=Regular FZYaoTi,方正姚体:style=Regular NSimSun,新宋体:style=Regular FangSong,仿宋:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta DFKai\-SB,標楷體:style=Regular KaiTi,楷体:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta STSong,华文宋体:style=Regular Microsoft YaHei,微软雅黑:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta SimSun,宋体:style=Regular STFangsong,华文仿宋:style=Regular STXinwei,华文新魏:style=Regular Arial Unicode MS:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta STXingkai,华文行楷:style=Regular Microsoft JhengHei,微軟正黑體:style=Negreta,Bold,tučné,fed,Fett,Έντονα,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kalın,Krepko,Lodia STLiti,华文隶书:style=Regular SimHei,黑体:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta MingLiU,細明體:style=Regular STZhongsong,华文中宋:style=Regular Microsoft YaHei,微软雅黑:style=Bold,Negreta,tučné,fed,Fett,Έντονα,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kalın,Krepko,Lodia FZShuTi,方正舒体:style=Regular MingLiU_HKSCS,細明體_HKSCS:style=Regular STXihei,华文细黑:style=Regular Microsoft JhengHei,微軟正黑體:style=Normal,Regular,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta LiSu,隶书:style=Regular STKaiti,华文楷体:style=Regular

去掉\usepackgae{xeCJK}

并用\newfonfamily\kai{STKkai} 定义宏 \kai

使用\kai 接中文 即可使用华文楷体

其他字体类似

示例代码如下

\documentclass[11pt]{article} %\usepackage{xeCJK} \usepackage{fontspec,xunicode,xltxtra} \usepackage{titlesec} \usepackage[top=1in,bottom=1in,left=1.25in,right=1.25in]{geometry} \usepackage{indentfirst} % 段首缩进 \setmainfont[BoldFont=SimHei]{SimSun}% 默认字体为宋体 \XeTeXlinebreaklocale "zh" % 中文断行 \newfontfamily\kai{STKaiti} % 楷体 \newfontfamily\hei{SimHei} % 黑体 \begin{document} \section{举例} % 无需排版的多行内容 \begin{verbatim} 标点。 \end{verbatim} 汉字Chinese数学$x=y$空格 \section{楷体} \kai 楷体 \section{黑体} \hei 黑体 \end{document}

效果图如下

这里写图片描述



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有