也许你能帮我解决这个问题? 我的代码是:
\documentclass[%
paper=A4, % paper size --> A4 is default in Germany
twoside=true, % onesite or twoside printing
openright, % doublepage cleaning ends up right side
parskip=full, % spacing value / method for paragraphs
chapterprefix=true, % prefix for chapter marks
11pt, % font size
headings=normal, % size of headings
bibliography=totoc, % include bib in toc
listof=totoc, % include listof entries in toc
titlepage=on, % own page for each title page
captions=tableabove, % display table captions above the float env
draft=false, % value for draft version
]{scrreprt}%
\usepackage[utf8]{inputenc} % defines file's character encoding
\usepackage[lithuanian]{babel} % babel system, adjust the language of the content
\usepackage{tabularx}
\usepackage{fontspec}
\selectlanguage{lithuanian}
\usepackage[ % clean thesis style
figuresep=colon,%
sansserif=false,%
hangfigurecaption=false,%
hangsection=true,%
hangsubsection=true,%
colorize=full,%
colortheme=bluemagenta,%
bibsys=bibtex,%
bibfile=bib-refs,%
bibstyle=alphabetic,%
]{cleanthesis}
\hypersetup{ % setup the hyperref-package options
pdftitle={\thesisTitle}, % - title (PDF meta)
pdfsubject={\thesisSubject},% - subject (PDF meta)
pdfauthor={\thesisName}, % - author (PDF meta)
plainpages=false, % -
colorlinks=false, % - colorize links?
pdfborder={0 0 0}, % -
breaklinks=true, % - allow line break inside links
bookmarksnumbered=true, %
bookmarksopen=true %
}
\begin {document}
ąčęėįšųū
\end{document}
我也在使用 cleanthesis 0.3.1。我收到错误:编码 T1 中命令 \nobreakspace 不可用
我通过添加序言解决了这个问题,但符号仍然无法加载:
\usepackage{xpatch}
\renewcommand{\ttdefault}{ul9}
\xpatchcmd{\ttfamily}{\selectfont}{\fontencoding{T1}\selectfont}{}{}
\DeclareTextCommand{\nobreakspace}{T1}{\leavevmode\nobreak\ }
也许我错过了什么?
答案1
我不推荐 cleanthesis。它会加载许多不推荐与 KOMA 类一起使用的包。而且页面布局有缺陷。
如果你坚持使用它:
cleanthesis 将字体编码更改为不适合 xelatex 的编码。因此必须重置字体编码。
不要加载inputenc。
将 biber 与 xelatex 一起使用。bibtex 可能会因 utf8 而中断。
有些字体定义可能需要重新定义。
cleanthesis 很可能包含更多不适合 xelatex 的代码。
不要将 babel 与你的语言一起使用,语言文件不适用于 unicode 引擎。
这是可行的方法
\documentclass[%
paper=A4, % paper size --> A4 is default in Germany
twoside=true, % onesite or twoside printing
openright, % doublepage cleaning ends up right side
parskip=full, % spacing value / method for paragraphs
chapterprefix=true, % prefix for chapter marks
11pt, % font size
headings=normal, % size of headings
bibliography=totoc, % include bib in toc
listof=totoc, % include listof entries in toc
titlepage=on, % own page for each title page
captions=tableabove, % display table captions above the float env
draft=false, % value for draft version
]{scrreprt}%
% \usepackage[utf8]{inputenc} % don't use with xelatex
\usepackage{polyglossia} % babel-lithuaninan is not adapted to xelatex
\setdefaultlanguage{lithuanian}
\usepackage[ % clean thesis style
figuresep=colon,%
sansserif=false,%
hangfigurecaption=false,%
hangsection=true,%
hangsubsection=true,%
colorize=full,%
colortheme=bluemagenta,%
bibsys=biber,% changed
bibfile=bib-refs,%
bibstyle=alphabetic,%
]{cleanthesis}
%
%reset font encoding after cleanthesis:
\usepackage[EU1]{fontenc}
%
%redefined
\renewcommand{\helv}{\sffamily\fontsize{9}{11}\selectfont}
\renewcommand{\book}{\rmfamily\fontseries{m}\fontsize{11}{13}\selectfont}
\renewcommand{\tgherosfont}{\sffamily\selectfont}
%
%
%temporarly commented as commands are undefined in MWE:
%\hypersetup{ % setup the hyperref-package options
%% pdftitle={\thesisTitle}, % - title (PDF meta)
%% pdfsubject={\thesisSubject},% - subject (PDF meta)
%% pdfauthor={\thesisName}, % - author (PDF meta)
% plainpages=false, % -
% colorlinks=false, % - colorize links?
% pdfborder={0 0 0}, % -
% breaklinks=true, % - allow line break inside links
% bookmarksnumbered=true, %
% bookmarksopen=true %
%}
\renewcommand\headrulewidth{0pt} %page layout is buggy, line overwrites text
\usepackage{lipsum}
\begin{document}
\chapter{A}
ąčęėįšųū \lipsum
\end{document}