LyX 中的标题字体

LyX 中的标题字体

我想将我的书籍 MS 中的标题字体从衬线字体更改为无衬线字体。我花了很多时间在网上寻找答案。我使用book (KOMA script)fancyhdr

有哪位好心人能给我指明方向吗?

在我的系统上产生此问题的最小 *.lyx 文件如下所示:

#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass scrbook
\begin_preamble
% DO NOT ALTER THIS PREAMBLE!!!
%
% This preamble is designed to ensure that the User's Guide prints
% out as advertised. If you mess with this preamble,
% parts of the User's Guide may not print out as expected.  If you
% have problems LaTeXing this file, please contact
% the documentation team
% email: [email protected]

\usepackage{ifpdf} % part of the hyperref bundle
\ifpdf % if pdflatex is used

 % set fonts for nicer pdf view
 \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}

\fi % end if pdflatex is used

% for correct jump positions whe clicking on a link to a float
\usepackage[figure]{hypcap}

% the pages of the TOC is numbered roman
% and a pdf-bookmark for the TOC is added
\let\myTOC\tableofcontents
\renewcommand\tableofcontents{%
  \frontmatter
  \pdfbookmark[1]{\contentsname}{}
  \myTOC
  \mainmatter }

% define a short command for \textvisiblespace
\newcommand{\spce}{\textvisiblespace}

% macro for italic page numbers in the index
\newcommand{\IndexDef}[1]{\textit{#1}}

% for customized page headers/footers
% only needed because they are only used in one section of the document
\usepackage{fancyhdr}
% change header rule width
\renewcommand{\headrulewidth}{1pt}
% workaround for a makeindex bug,
% see sec. "Index Entry Order"
% only uncomment this when you are using makindex
%\let\OrgIndex\index
%\renewcommand*{\index}[1]{\OrgIndex{#1}}
\setkomafont{pagehead}{\normalfont\sffamily\upshape}
\end_preamble
\options refpage,intoc,bibliography=totoc,index=totoc,BCOR7.5mm,captions=tableheading
\use_default_options false
\begin_modules
enumitem
customHeadersFooters
\end_modules
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding utf8
\fontencoding global
\font_roman palatino
\font_sans helvet
\font_typewriter courier
\font_default_family default
\use_non_tex_fonts false
\font_sc true
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize 12
\spacing single
\use_hyperref true
\pdf_title "The LyX User's Guide"
\pdf_author "LyX Team"
\pdf_subject "LyX"
\pdf_keywords "LyX"
\pdf_bookmarks true
\pdf_bookmarksnumbered true
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder false
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle false
\pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue, pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
\papersize custom
\use_geometry true
\use_amsmath 1
\use_esint 1
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date true
\use_refstyle 0
\notefontcolor #0000ff
\boxbgcolor #e6e6e6
\branch Question
\selected 1
\filename_suffix 0
\color #00ff00
\end_branch
\branch Answer
\selected 0
\filename_suffix 0
\color #aa55ff
\end_branch
\index Index
\shortcut idx
\color #008000
\end_index
\paperwidth 7.5in
\paperheight 9.25in
\secnumdepth 2
\tocdepth 2
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 2
\paperpagestyle fancy
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict true
\end_header

\begin_body

\begin_layout Title
Build it with Nitrogen
\end_layout

\begin_layout Subtitle

\shape italic
\size larger
The fast-off-the-block Erlang web framework
\end_layout

\begin_layout Author

\family sans
Lloyd R.
 Prentice & Jesse Gumm
\end_layout

\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\end_layout
\begin_layout Chapter
You want me to build what?
\end_layout

\begin_layout Standard

\end_layout

\begin_layout Chapter
Enter the lion's den
\end_layout

\begin_layout Standard
Whoa! Day after tomorrow? That's harsh.
 But that's Bossman--- no moss under that dude's feet.
 So we best get crackin'.
\end_layout

\begin_layout Standard
These three boxes power our trusted in-house development network.
 We call them Alice, Bob, and Mallory.
 Yes, indeed, we take security seriously.
 Rusty will read you in on our security practices later.
\end_layout

\begin_layout Standard
We also have a remote server--- hostname Charlie.
 Plan to lease another--- probably call it Dora.
\end_layout

\begin_layout Standard
Why all the hardware?
\end_layout

\begin_layout Standard
Erlang was explicitly designed to support distributed computing
\begin_inset Index idx
status open

\begin_layout Plain Layout
distributed computing
\end_layout

\end_inset

.
 So we use the machines on this network to develop and test distributed
 applications and databases.
 Set it up on the cheap.

\end_layout

\begin_layout Standard
Alice and Mallory are old Dell Optiplex 745s running Linux Debian
\begin_inset Index idx
status open
\begin_layout Plain Layout
Debian
\end_layout

\end_inset

 Linux Wheezy.
 Dual-core, gig of RAM.
 Company up the road traded up so Bossman picked these puppies up for fifty
 bucks apiece.
 Bossman likes to say lean-and-mean.
 Truth--- the dude's a cheap skate.
\end_layout

\begin_layout Standard
Yes, we could we use
\shape italic
Vagrant,
\shape default
the cloud, or some such, instead of physical machines.
 But Bossman is old school.
 We're trying to talk him around.
\end_layout

\begin_layout Standard
Bob is a custom built PC running Ubuntu
\begin_inset Index idx
status open

\begin_layout Plain Layout
Ubuntu
\end_layout

\end_inset

 14.04.
 Three-core AMD processor, six gigs of RAM.
\end_layout

\begin_layout Standard
I tap into the network with my personal MacBook Pro
\begin_inset Index idx
status open

\begin_layout Plain Layout
MacBook Pro
\end_layout

\end_inset

.
\end_layout

\begin_layout Standard
Fact is, you don't need all this kit to develop Nitrogen apps.
 You can do it on your Windows
\begin_inset Index idx
status open

\begin_layout Plain Layout
Windows
\end_layout

\end_inset

 notebook at Starbucks if you're so inclined.
 I've heard of folks running Nitrogen on
\shape italic
Raspberry Pi
\shape default

\begin_inset Index idx
status open

\begin_layout Plain Layout
Raspberry Pi
\end_layout

\end_inset

.

\end_layout

\begin_layout Standard
But we're looking toward bigger things here--- reliable, industrial strength,
 scalable apps.
\end_layout

\begin_layout Section*
The big picture
\end_layout

\begin_layout Standard
Before we begin, let me paint the big picture.

\end_layout

\begin_layout Standard
The challenge of web application development comes down to managing a jumble
 of languages and network protocols.

\end_layout

\begin_layout Standard
You, Dude, learned your native language effortlessly in the bosum of your
 family.
 But as a web application developer your task is to convince hardware on
 both server and client sides to do your bidding.
 Problem is, the stupid machines don't speak your native language.

\end_layout
\begin_layout Standard
On the client side, the browser responds to HTTP/HTTPS protocols carrying
 HTML, CSS, and JavaScript messages which, in turn, convey and present informati
on structured as natural language, sound, and images both still and moving.

\end_layout

\begin_layout Standard
The server responds to some babel of computer languages to marshal the HTTP/HTTP
S, HTML, CSS, JavaScript, natural language, sound, and images both still
 and moving through the Internet to the client.
\end_layout

\begin_layout Standard
It's almost too much for the feeble human mind to encompass.
 The nitty gritty tedium of it all is mind numbing.
\end_layout

\begin_layout Standard
So this is where Nitrogen comes in.

\end_layout

\begin_layout Standard
Nitrogen harness the power of Erlang to manage all--- well, most all---
 of the fiddly semantics and syntax of HTTP/HTTPS, HTML, CSS, and JavaScript.
 This means that you have that much less to think about when you craft your
 cunning web application.
 In the spell of creative ferment, you can produce cool web chops all that
 much faster.
\end_layout

\begin_layout Standard
We're not saying that you don't have to understand the alphabet soup of
 web technologies.
 The deeper you understand them the better.
 We are saying that mastery of Erlang Nitrogen will make you far more fluent
 and productive.
\end_layout

\begin_layout Standard
What's the trick?
\end_layout

\begin_layout Standard
Nitrogen combines the structural convenience of Erlang records, the fluency
 of Erlang functions to execute logic and embed JavaScript, and the power
 of Erlang as a development platform to organize and abstract the semantic
 and syntactical fussiness of server/web/browser communication.
\end_layout

\begin_layout Standard
Enough already.
 Let's install Nitrogen.
\end_layout

\end_body
\end_document

答案1

在你的序言中,有这样一句话:

\setkomafont{pagehead}{\normalfont\sffamily\upshape}

应将标题字体更改为无衬线直立字体。但是,您使用的fancy标题样式会将标题格式的控制权传递给fancyhdr。因此,您需要将使用指令传递sffamilyfancyhdr而不是 koma。不同类和包的默认设置不同。为了获得与当前相同的布局,请注释掉该行\setkomafont并添加以下内容:

\fancyhead{} % clear all header fields
\fancyhead[RE,LO]{\sffamily\leftmark}

摘自fancyhdr文档,第 6 节。

相关内容