xelatex - 章、节、小节标题的字体更改
问题描述
所以,我正在努力改变乳胶中标题/部分/小节的字体。
这是我的代码:
% !TEX TS?program = pdflatexmk
\documentclass[fontsize=12pt]{book}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{mathpazo}
%changing font of section/chapter title
\usepackage{fontspec}
\usepackage{titlesec}
\newfontfamily\headingfont{Papyrus}
\titleformat{\chapter}{\LARGE\headingfont}
\titleformat{\section}{\LARGE\headingfont}
\titleformat{\subsection}{\Large\headingfont}
\titleformat{\subsubsection}{\large\headingfont}
\title{my report}
\author{user name}
\date
\linespread{1.5}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\maketitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\tableofcontents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{introduction}
text : intro
\section{first section}
text : section
\subsection{this subsection}
text :section
\subsubsection{this and that subsection}
text :subsub
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
这是输出:
字体仅在chapter
and中实现subsection
。不为他人。而且编号也丢失了。例如,没有titlesec
,fontspec
这就是它的样子。章节和小节编号随之丢失。我找不到错误。(使用 fontspec 也有点烦人,因为它找不到默认的乳胶字体,所以不得不将otf
文件复制粘贴到工作目录中)
解决方案
推荐阅读
- typescript - 在 TypeScript 中将对象值转换为类枚举类型
- python - 尝试在 Python 3 子进程中运行 rsync 时出现 args 问题
- click - 点击此代码的准确性必须小于 5 毫秒 但是为什么不呢?
- c# - Xamarin C# 选择 jsonArray 中的元素
- django - 如何从没有请求参数的函数返回模板?
- java - 与其他类具有相同包名的 Java 类
- javascript - 用户序列化程序在 AJAX 提取中显示为空,但在 DRF 中显示数据
- java - 逐行读取文件并从列表中访问值
- > 对于以下 Java 规范
- php - “服务器请求客户端未知的身份验证方法”尝试连接 MySQL 后出错
- python - pip 安装 ValueError: int() 以 10 为底的无效文字:b'\x00\x00\x00\x00'