提问于:
浏览数:
2503
##1. 编译环境
操作系统
*[x]` Windows 10
Tex发行版
*[x]` TexLive `2020`
编辑器
*[x]` Vs code
## 2. 我的问题
目前在学习设置中英文字体,加入英文字体设置命令后''' \setmainfont[Mapping=tex-text]{TeX Gyre Pagella }'''
出现4个警告''' Some font shapes were not available, defaults substituted. ''' 。但是文件可以输出,请问怎么消除警告?
## 3. mian:
```markdown
\documentclass{article}
\usepackage{ctex}
\usepackage{hyperref}
\usepackage[round]{natbib}
\usepackage{newtxtext,newtxmath}
%--------------------------------英文衬线字体---------------------------------
\setmainfont[Mapping=tex-text]{TeX Gyre Pagella}
\xeCJKsetup{AutoFakeBold=true}
%--------------------------------中文字体---------------------------------
\setCJKfamilyfont{kaishu}{楷体}
\newcommand{\kai}{\CJKfamily{kaishu}}
\author{XXXX}
\title{Configuration of Visual Studio Code for \LaTeX{} Users}
\date{\today}
\begin{document}
\maketitle
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident,
\cite{GraffZivin2018}
sunt in culpa qui officia deserunt mollit anim id est laborum.
itbf : \kai{\bfseries{你好}}
itbf : \CJKfamily{kaishu}\bfseries 你好
\begin{equation}
a^2+b^2=c^2
\end{equation}
\bibliography{info}
\bibliographystyle{plainnat}
\end{document}
```
## 4. bib文件:
```markdown
@Article{GraffZivin2018,
author = {Graff Zivin, Joshua and Hsiang, Solomon M and Neidell, Matthew},
title = {Temperature and Human Capital in the Short and Long Run},
journal = {Journal of the Association of Environmental and Resource Economists},
year = {2018},
volume = {5},
number = {1},
pages = {77-105},
issn = {2333-5955},
type = {Journal Article},
}
@Book{Lutz2017,
title = {World Population \& Human Capital in the Twenty-First Century: An Overview},
publisher = {Oxford University Press},
year = {2017},
author = {Lutz, Wolfgang and Butz, William P and Samir, KC ed},
isbn = {0192542834},
type = {Book},
}
@Article{Zeng2017,
author = {Zeng, X. and Liu, L. and Leung, S. and Du, J. and Wang, X. and Li, T.},
title = {A decision support model for investment on P2P lending platform},
journal = {PLoS One},
year = {2017},
volume = {12},
number = {9},
pages = {e0184242},
issn = {1932-6203 (Electronic)
1932-6203 (Linking)},
doi = {10.1371/journal.pone.0184242},
type = {Journal Article},
url = {https://www.ncbi.nlm.nih.gov/pubmed/28877234},
}
```
1 回答
1
注释`\usepackage{newtxtext,newtxmath} `,英文字体命令`\setmainfont[Mapping=tex-text]{TeX Gyre Pagella}`上述宏包的冲突
`newtxtext,newtxmath`属于`txfonts `的改进版本,分别设置文本和数学字体,`txfonts `是Times 风格的字体宏包
若运行之后提示`Overfull \hbox (0.24pt too wide)` 在`\begin{document} \end{document}` 环境之间加入'\begin{sloppypar} \end{sloppypar}'环境处理文字超过边界。
你的回答
请登录后回答
你的回答将会帮助更多人,请务必认真回答问题。