当前位置:网站首页>【LaTex】 Font “FandolSong-Regular“ does not contain requested(fontspec)Script “CJK“.如何抑制此种警告?
【LaTex】 Font “FandolSong-Regular“ does not contain requested(fontspec)Script “CJK“.如何抑制此种警告?
2022-08-09 21:55:00 【键盘即钢琴】
一、背景
在LaTex中把文档类型设置成utf8编码类型的ctexart文档后,用xelatex编译引擎,就可以在正文部分顺利用上中文了。
\documentclass[UTF8]{ctexart}
但是还是可能出现一个警告【Font "FandolSong-Regular" does not contain requested(fontspec)Script "CJK".】。
这个警告是不带有严重负面后果的警告,但是如果读者你有强迫症,也是可以消除的。
本文主要参考了文章[LaTeX 中文使用] 抑制 xeCJK/fontspec 警告 no-script "CJK" - 知乎
二、解决方法
2.1 更加精准的抑制警告代码
下面这个代码块是一个模板,不认识某些复杂的命令不要紧,只要我们知道简单的\documentclass、\usepackage和\begin{document}、\end{document}就行了。
\documentclass{article}
\usepackage{fontspec}
\usepackage{xpatch}
\ExplSyntaxOn
\xpatchcmd \fontspec_new_script:nn
{ \__fontspec_warning:nxx }
{ \__fontspec_info:nxx }
{}{\fail}
% redeclare
\newfontscript{CJK}{hani}
% \newfontscript{CJK~Ideographic}{hani}
\ExplSyntaxOff
\usepackage{xeCJK}
\begin{document}
content
\end{document}
2.2 简单的抑制代码
将\PassOptionsToPackage{quiet}{fontspec}放至\documentclass的前面。
比如
\PassOptionsToPackage{quiet}{fontspec}
\documentclass[UTF8]{ctexart}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{xcolor}
\begin{document}
\color{red}123红色文字夹杂
\end{document}
最后的输出结果很完美嘛
边栏推荐
- AI Knows Everything: Building and Deploying a Sign Language Recognition System from Zero
- openGauss数据库基本操作(超详细)
- 【GORM】模型关系-HasMany关系
- 接口自动化测试实践指导(上):接口自动化需要做哪些准备工作
- Bean life cycle
- UML类图五种关系的代码实现[通俗易懂]
- 【软考 系统架构设计师】案例分析⑤ 质量属性和架构评估
- 国内手机厂商曾为它大打出手,如今它却最先垮台……
- random.normal() and random.truncated_normal() in TF
- 注意力引导网络用于视网膜图像分割
猜你喜欢
[Microservice~Nacos] Nacos service provider and service consumer
Flask入门学习教程
2022 首期线下 Workshop!面向应用开发者们的数据应用体验日来了 | TiDB Workshop Day
Analyze the Add() method in Fragment management from the source code
xctf攻防世界 Web高手进阶区 ics-05
Simple questions peek into mathematics
一文让你快速了解隐式类型转换【整型提升】!
JSON 基本使用
重装系统后新建文本文档打不开怎么办
shell学习
随机推荐
【微服务~Nacos】Nacos服务提供者和服务消费者
接口自动化测试实践指导(上):接口自动化需要做哪些准备工作
Blender程序化建模简明教程【PCG】
Interpretation of the paper (DropEdge) "DropEdge: Towards Deep Graph Convolutional Networks on Node Classification"
从产品角度看 L2 应用:为什么说这是一个游乐场?
Xiaohei leetcode's refreshing rainy day trip, just finished eating Yufei Beef Noodles, Mala Tang and Beer: 112. Path Sum
NIO Cup 2022 Nioke Summer Multi-School Training Camp 7 CFGJ
Technology Sharing | How to use the JSON Schema mode of interface automation testing?
STC8H development (15): GPIO drive Ci24R1 wireless module
【测试】语句覆盖,判定覆盖,条件覆盖,路径覆盖
【微服务~Nacos】Nacos之配置中心
AI Knows Everything: Building and Deploying a Sign Language Recognition System from Zero
Several ways to draw timeline diagrams
Ehrlich screening method: Counting the number of prime numbers
开发者必备:一文快速熟记【数据库系统】和【软件开发模型】常用知识点
ACM MM 2022 | Cloud2Sketch: Painting with clouds in the sky, AI brush strokes
Use zeros(), ones(), fill() methods to generate data in TF
Activiti7审批流
Quotefancy ,提供鼓舞人心语录的壁纸网站 - 倾城之链
POWER SOURCE ETA ETA Power Repair FHG24SX-U Overview