我正在尝试编写一个包含英语的文档,因此我输入了:
\begin{english}
% Some lines....
\end{english}
没有部分、章节等的标题……
如果我删除 TOC 或english
部分 - 它可以工作,但不能同时删除两者 :-(
您知道为什么以及我该如何解决吗?
梅威瑟:
% Preview source code
%% LyX 2.3.6.1 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,english,hebrew,numbers=noenddot]{scrartcl}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{fontspec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parindent}{0bp}
\usepackage{color}
\usepackage{pifont}
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=true]
{hyperref}
\hypersetup{
linkcolor=blue}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Bellefair}
\AtBeginDocument{
\renewcommand\footnoterule{%
\kern -3pt
\hbox to \textwidth{\hfill\vrule height 0.4pt width .4\textwidth}
\kern 2.6pt
}}
% Commands:
\makeatother
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\tableofcontents{}
\part{שלום}
\section{שלום}
\begin{english}
abcd
\end{english}
\end{document}
PS 我尝试将字体改为FreeSans
,但标题仍然缺失
谢谢你!
答案1
使用 Arial 字体和
\newfontfamily\hebrewfont[Script=Hebrew]{Arial}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Arial}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Arial}
我得到了相同的结果。
但随着
\setmainfont{Arial}
\setmonofont{Arial}
\setsansfont{Arial}
结果很好
(我正在使用 TeXstudio,所以我删除了 LyX 特定的 LaTeX 命令。xelatex 或 lualatex 不需要它们。它们将由班级设置a4paper
。https://tex.stackexchange.com/a/425649/161015)
\documentclass[a4paper,english,hebrew,numbers=noenddot]{scrartcl}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{fontspec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parindent}{0bp}
\usepackage{color}
\usepackage{pifont}
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=true]
{hyperref}
\hypersetup{
linkcolor=blue}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%\pdfpageheight\paperheight
%\pdfpagewidth\paperwidth
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%\newfontfamily\hebrewfont[Script=Hebrew]{DavidCLM}
%\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
%\newfontfamily\hebrewfontsf[Script=Hebrew]{Bellefair}
%% IT DOES NOT WORK
%\newfontfamily\hebrewfont[Script=Hebrew]{Arial}
%\newfontfamily\hebrewfonttt[Script=Hebrew]{Arial}
%\newfontfamily\hebrewfontsf[Script=Hebrew]{Arial}
% THIS WORKS OK ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
\setmainfont{Arial}
\setmonofont{Arial}
\setsansfont{Arial}
\AtBeginDocument{
\renewcommand\footnoterule{%
\kern -3pt
\hbox to \textwidth{\hfill\vrule height 0.4pt width .4\textwidth}
\kern 2.6pt
}}
% Commands:
\makeatother
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\tableofcontents{}
\part{שלום}
\section{שלום}
\begin{english}
abcd
\end{english}
\end{document}
使用其他字体. 在此示例中,.ttf
工作目录的 FONTS 目录下的子目录中的文件。
% !TeX TS-program = xelatex
\documentclass[a4paper,english,hebrew,numbers=noenddot]{scrartcl}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{fontspec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parindent}{0bp}
\usepackage{color}
\usepackage{pifont}
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=true]
{hyperref}
\hypersetup{
linkcolor=blue}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
% using other fonts. .ttf files in subdirectories under the directory FONTS of the working directory <<<<<<<<<<<<<<<<
\setmainfont[
Path =./FONTS/TaameyDavidCLM/,
Ligatures = TeX ,
Script = Hebrew,
Extension=.ttf,
UprightFont=*-Medium ,
BoldFont=*-Bold,
ItalicFont=*-MediumOblique,
BoldItalicFont=*-BoldOblique,
Scale=1.0 % Adjust to match Latin font
]{TaameyDavidCLM}
\setmonofont[
Path =./FONTS/MiriamMonoCLM/,
Script = Hebrew,
Extension=.ttf,
UprightFont=*-Book,
BoldFont=*-Bold,
ItalicFont=*-BookOblique,
BoldItalicFont=*-BoldOblique,
Scale=1.0 % Adjust to match Latin font
]{MiriamMonoCLM}
\setsansfont[
Path =./FONTS/DejaVuSans/,
Ligatures = TeX ,
Script = Hebrew,
Extension=.ttf,
UprightFont=* ,
BoldFont=*-Bold,
ItalicFont=*-Oblique,
BoldItalicFont=*-BoldOblique,
Scale=1.0 % Adjust to match Latin font
]{DejaVuSans}
\AtBeginDocument{
\renewcommand\footnoterule{%
\kern -3pt
\hbox to \textwidth{\hfill\vrule height 0.4pt width .4\textwidth}
\kern 2.6pt
}}
\begin{document}
\tableofcontents
\part{שלום}
\section{שלום}
\begin{english}
abcd
\end{english}
\section{בראשית}
\textbf{בְּרֵאשִׁ֖ית}
\textit{יְהִ֣י א֑וֹר}
\bigskip
\texttt{ \textbf{וַיַּ֧רְא אֱלֹהִ֛ים אֶת־הָא֖וֹר כִּי־ט֑וֹב וַיַּבְדֵּ֣ל אֱלֹהִ֔ים בֵּ֥ין} הָא֖וֹר וּבֵ֥ין הַחֹֽשֶׁךְ׃ }
\section{מבוא}
זוהי עובדה מבוססת שדעתו של הקורא תהיה מוסחת עלידי טקטס קריא כאשר הוא יביט בפריסתו.
\end{document}