隶书字体加载不成功,怎么办呀

发布于 2021-09-24 09:54:50

windows-tex live 2021-xelatex-slager

ctex宏里有隶书字体,可是使用lishu 没有效果。


\documentclass[a4paper,10pt]{my_paper}
\usepackage{ctex}
\usepackage[top=30.0mm,bottom=25.0mm,left=22.5mm,right=22.5mm,headsep=8mm]{geometry}%设置页边距
\usepackage{array} %主要是增加列样式选项
\usepackage[dvipsnames]{xcolor}%颜色宏包
\usepackage{graphicx}%图片宏包
\usepackage{amsmath}%公式宏包
\usepackage{float} %限制浮动体的位置
\usepackage{pdfpages}
\usepackage{appendix}
\usepackage{listings}
\usepackage{textcomp}
\usepackage{titletoc}
\usepackage[T1]{fontenc}    
\numberwithin{equation}{section}
\usepackage{newtxtext, newtxmath}  %使用Times New Roman 字体的方法
\setCJKmainfont[AutoFakeBold=2.17]{FandolSong-Regular.otf}

\begin{document}

\begin{tabular}{l p{0.8\textwidth}<{\centering}}
    \centering
    \zihao{4} 题\quad 目\quad & \zihao{3} \heiti 基于通信仿真的载波恢复算法设计与 ASIC 实现  \\ \cline{2-2}
\end{tabular}

\begin{center} \zihao{-2} \lishu 摘 \qquad 要:
\end{center}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{my_paper}[2021/08/17 My custom CV class] 
\LoadClass[10pt]{ctexart}

\pagestyle{plain}
\RequirePackage{titlesec}
\RequirePackage{titletoc}
%\RequirePackage{hyperref}

\ctexset{
    appendix        = {
        name        = {附录}
    },
    section         = {
        format      = {\bfseries\zihao{4}\heiti\centering},
        number      = {\bfseries\arabic{section}.},
        aftername   = {\hspace{1em}}
    },
    subsection      = {
        format      = {\bfseries\zihao{-4}},
        number      = {\bfseries\arabic{section}.\bfseries\arabic{subsection}},
        aftername   = {\hspace{1em}}
    },
    subsubsection   = {
        format      = {\bfseries\zihao{-4}},
        number      = {\bfseries\arabic{section}.\bfseries\arabic{subsection}.\bfseries\arabic{subsubsection}},
        aftername   = {\hspace{1em}}
    },
}
\titlecontents{section}[0pt]{\vspace{2mm}\bfseries\heiti}
{\thecontentslabel\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage}
% 小节的目录格式
\titlecontents{subsection}[30pt]{}
{\thecontentslabel\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage}

\titlecontents{subsubsection}[55pt]{}
{\thecontentslabel\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage}

\pagestyle{plain}

image.png

Windows里有隶书字体呀
image.png

百度说自行导入,我从别的模板里下载了一个ttf文件,但是不会用
image.png

查看更多

关注者
0
被浏览
1.8k
乙醇
乙醇 2021-09-24
这家伙很懒,什么也没写!

如果可以, 提问的时候应该贴一下报错是什么


猜一下原因, 你安装 texlive 后没有更新宏包, 需要在终端 tlmgr update -self -all 更新全部宏包, 或者在 ctex 宏包前增加选项 [fontset=windows], 未更新的二进制文件不能识别系统, 会导致使用 [fontset=fandol], 而 Fandol 字库没有 \lishu 的命令, 顺便, 把 \usepackage[T1]{fontenc} 删了, titletoc 宏包包含在 titlesec 中, 可以不重复加载.

2 个回答
拿了橘子跑啊
拿了橘子跑啊 2021-09-24
这家伙很懒,什么也没写!

你应该就没编译成功。
textcompnewtxtext newtxmath 应该是有冲突的,注释掉 textcomp 试试。

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览