我尝试使用 palatino 和 Cambria 作为正文,但表格字体 (sffamily) 也有另一种外观。我更喜欢与 palatino 搭配的外观。请看这两张图片。这是代码。
\documentclass[11pt, a4paper] {report}
\renewcommand{\baselinestretch}{1.1}
\renewcommand{\arraystretch}{1.1}
\usepackage[dutch]{babel}
\usepackage[T1]{fontenc}
%\usepackage{palatino}
\newcommand\customfont[1]{{\usefont{T1}{Cambria-Font-For-Windows}{m}{n} #1 }}
\usepackage{array}
\usepackage[utf8]{inputenc}
\usepackage{titlesec}
\newcommand{\chapfnt}{\fontsize{18}{22}}
\newcommand{\secfnt}{\fontsize{14}{17}}
\newcommand{\subsecfnt}{\fontsize{11}{13}}
\titleformat{\section}
{\normalfont\secfnt\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\subsecfnt\bfseries}{\thesubsection}{1em}{}
\usepackage{geometry}
\geometry{left=4cm, right=2.5cm, top=1.8cm, bottom=2.5cm, textheight=18cm}
\setlength{\parindent}{0pt}
\setlength{\emergencystretch}{10pt}
\setlength{\arrayrulewidth}{0.01em}
\usepackage[document]{ragged2e}
\newcommand\setrow[1]{\gdef\rowmac{#1}#1\ignorespaces}
\newcommand\clearrow{\global\let\rowmac\relax}
\clearrow
\begin{document}
In deze bijlage staan de verslagen van de interviews die in januari 2008 uitgevoerd zijn. In de volgende tabel staat welke personen geïnterviewd zijn.
\vspace{13pt}
\setlength{\tabcolsep}{0pt}
\fontsize{8.5pt}{10pt}
\sffamily
\noindent\begin{tabular}{>{\rowmac} m{3cm} >{\rowmac} m{0.4cm} >{\rowmac} m{2.5cm} >{\rowmac} m{0.4cm} >{\rowmac} m{4cm} >{\rowmac} m{0.4cm} >{\rowmac} m{2cm} <{\clearrow}}
\setrow{\bfseries\itshape} naam && afdeling && functie && datum \\ \cline{1-1} \cline{3-3} \cline{5-5} \cline{7-7}
Jan de Vries & & Verkoop & & manager & & 09-01-2008 \\
Peter Jansen & & Inkoop & & senior inkoper & & 10-01-2008 \\
Ingrid Holtrup && Public relations && teamleider && 14-01-2008 \\
Patrick Faber && Personeelszaken && administratief medewerker && 15-01-2008
\end{tabular}
\setlength{\tabcolsep}{6pt}
\normalfont \normalsize
\vspace{13pt}
\subsection*{Interview met Jan de Vries}
Jan de Vries maakte duidelijk dat het belangrijk is ...
\end{document}
答案1
您不应使用palatino
,它已经过时且不推荐使用。
它还会更改无衬线字体。请\usepackage[sc]{mathpazo}
改为执行此操作,而不会影响其他字体系列。
代码已被修改,将包加载与设置分开。
我还完全删除了\setrow
业务,因为我发现对每个主要项目使用一个简单的宏更容易,侵入性更小。
booktabs
使用和更容易获得列之间的空间\cmidrule
。
\documentclass[11pt, a4paper] {report}
\usepackage[dutch]{babel}
\usepackage[T1]{fontenc}
\usepackage[document]{ragged2e}
\usepackage{array}
\usepackage[utf8]{inputenc}
\usepackage{titlesec}
\usepackage{geometry}
\usepackage[sc]{mathpazo}% <--- not palatino
\usepackage{fix-cm} % for CM fonts in nonstandard sizes
\usepackage{booktabs}
%% geometry
\geometry{
left=4cm,
right=2.5cm,
top=1.8cm,
bottom=2.5cm,
heightrounded,% <-- to ensure a whole number of lines
% textheight=18cm, %%% <--- you can't specify both top/bottom and textheight
}
%% titles
\titleformat{\section}
{\normalfont\secfnt\bfseries}
{\thesection}
{1em}
{}
\titleformat{\subsection}
{\normalfont\subsecfnt\bfseries}
{\thesubsection}
{1em}
{}
%% personal commands
\newcommand{\HD}[1]{#1} % default
\newcommand{\formathead}[1]{\renewcommand{\HD}[1]{#1##1}}
\newcommand{\chapfnt}{\fontsize{18}{22}}
\newcommand{\secfnt}{\fontsize{14}{17}}
\newcommand{\subsecfnt}{\fontsize{11}{13}}
%%% I don't have it
%\newcommand\customfont[1]{{\usefont{T1}{Cambria-Font-For-Windows}{m}{n} #1 }}
%%% another that can be easily recognized
\newcommand\customfont[1]{{\usefont{T1}{OldStandard-TLF}{m}{n}#1}}% <--- no spaces!
%% various settings
\setlength{\parindent}{0pt}
\setlength{\emergencystretch}{10pt}
\setlength{\arrayrulewidth}{0.01em}
\renewcommand{\baselinestretch}{1.1}
\renewcommand{\arraystretch}{1.1} % <---- really?
\begin{document}
In deze bijlage staan de verslagen van de interviews die in januari 2008
uitgevoerd zijn. In de volgende tabel staat welke personen geïnterviewd zijn.
\vspace{13pt}\begingroup
\fontsize{8.5pt}{10pt}\sffamily
\formathead{\bfseries\itshape}
\noindent
\begin{tabular}{
@{}
w{l}{3cm}
w{l}{2.5cm}
w{l}{4cm}
w{l}{2cm}
@{}
}
\HD{naam} & \HD{afdeling} & \HD{functie} & \HD{datum} \\
\cmidrule(r){1-1}
\cmidrule(lr){2-2}
\cmidrule(lr){3-3}
\cmidrule(l){4-4}
Jan de Vries & Verkoop & manager & 09-01-2008 \\
Peter Jansen & Inkoop & senior inkoper & 10-01-2008 \\
Ingrid Holtrup & Public relations & teamleider & 14-01-2008 \\
Patrick Faber & Personeelszaken & administratief medewerker & 15-01-2008
\end{tabular}
\par\endgroup\vspace{13pt}
\subsection*{Interview met Jan de Vries}
Jan de Vries maakte duidelijk dat het belangrijk is ...
\end{document}