横向页面标题的字体大小不同

横向页面标题的字体大小不同

我使用 scrreprt 并希望在两页上以横向模式显示一个 longtable(更确切地说是 ltxtable)。横向模式下显示的该表格中每个字母的字体大小应为 8pt。在表格之前和接下来的页面中,我将继续使用 12pt 的字体大小。在第一页上使用 ltxtable 时,标题和脚注的字体大小为 8pt,在第二页上,两者的字体大小均为 12pt,这是我在第一页就希望实现的。我使用 TeX Live 2015/Debian 以及 MiKTeX 2.9.6100 64 位,并使用 PDLLaTeX(pdfTeX,版本 3)进行编译

\documentclass[headings=optiontotocandhead, 12pt, DIV=calc,%
headsepline, headexclude=false, footsepline,%
footexclude=false, footheight=25pt]{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,main=ngerman]{babel}
\usepackage{dejavu}

\usepackage[automark,plainfootsepline]{scrlayer-scrpage}
\setkomafont{pageheadfoot}{\sffamily}
\setkomafont{pagefoot}{\footnotesize}
\setkomafont{pagenumber}{}
\ifoot*{\strut XXXarbeit an der\\XXX Universität YYY\strut}
\cfoot*{\strut\\\pagemark\strut}
\renewcommand*{\pagemark}{{\usekomafont{pagenumber}--~\thepage~--\strut}}

\recalctypearea

\usepackage{blindtext}

\usepackage{ltxtable}
\usepackage{booktabs}
\usepackage{pdflscape}

\begin{document}

\tableofcontents

\chapter{Introduction}

\Blindtext[3]

\addchap[tocentry={}]{Appendix}
\addsec[tocentry={}]{Tables}

\begin{landscape}
\LTXtable{\linewidth}{tables/table-test.auto}
\end{landscape}
\end{document}

文件 table-test.auto 如下所示:

\KOMAoptions{fontsize=8pt}

\begin{longtable}{p{15mm}p{35mm}Xp{40mm}p{15mm}}

\caption{Main characteristics of the included studies} \\
\toprule
Study & Population & Intervention & Results & Category \\
\midrule
\endfirsthead
\caption{Main characteristics of the included studies - continued} \\
\toprule
Study & Population & Intervention & Results & Category \\
\midrule
\endhead
\midrule
Study & Population & Intervention & Results & Category \\
\bottomrule
\endfoot
\midrule
Study & Population & Intervention & Results & Category \\
\bottomrule
\endlastfoot
\label{tab:tabelle02}

Text & Text & Text & Text & Text \\
Text & Text & Text & Text & Text \\

\end{longtable}
\KOMAoptions{fontsize=12pt}

答案1

fontsize如果您更改文档中的KOMA 选项的值,则正常字体大小\normalsize和所有相关大小(如\small\footnotesize)都将重新计算。您对 的更改fontsize是本地的,即它们会在环境结束时自动重置。但是,当您的表格的第一页被发送出去时,和landscape的更改处于活动状态,因此该页的页眉和页脚会受到影响。\normalsize\footnotesize

如果只是希望表格字体小一点,我建议使用合适的字体大小。您的文档字体大小为 12pt,\scriptsize 使用的字体大小为 8pt。

\begin{filecontents*}{mytest.auto}
\scriptsize
\begin{longtable}{p{15mm}p{35mm}Xp{40mm}p{15mm}}
\caption{Main characteristics of the included studies} \\
\toprule
Study & Population & Intervention & Results & Category \\
\midrule
\endfirsthead
\caption{Main characteristics of the included studies - continued} \\
\toprule
Study & Population & Intervention & Results & Category \\
\midrule
\endhead
\midrule
Study & Population & Intervention & Results & Category \\
\bottomrule
\endfoot
\midrule
Study & Population & Intervention & Results & Category \\
\bottomrule
\endlastfoot
\label{tab:tabelle02}
Text & Text & Text & \blindtext & Text \\
Text & Text & Text & Text & Text \\
Text & Text & Text & \blindtext & Text \\
\end{longtable}
\end{filecontents*}

\documentclass[
    headings=optiontotocandhead,
    12pt,
    DIV=calc,
    headsepline,
    headinclude,
    footsepline,
    footinclude,
    footheight=25pt
]{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,main=ngerman]{babel}
\usepackage{dejavu}
\usepackage[automark,plainfootsepline]{scrlayer-scrpage}
\setkomafont{pageheadfoot}{\sffamily}
\setkomafont{pagefoot}{\footnotesize}
\setkomafont{pagenumber}{}
\ifoot*{\strut XXXarbeit an der\\XXX Universität YYY\strut}
\cfoot*{\strut\\\pagemark\strut}
\renewcommand*{\pagemark}{{\usekomafont{pagenumber}--~\thepage~--\strut}}
\recalctypearea
\usepackage{blindtext}% only for dummy text
\usepackage{ltxtable}
\usepackage{booktabs}
\usepackage{pdflscape}
\begin{document}
\tableofcontents
\chapter{Introduction}
\Blindtext[3]
\addchap[tocentry={}]{Appendix}
\addsec[tocentry={}]{Tables}
\begin{landscape}
\LTXtable{\linewidth}{mytest.auto}
\end{landscape}
\Blindtext
\end{document}

或者,您可以使用类似 的命令将字体大小设置为固定值\fontsize{8pt}{10pt}\selectfont。请注意,该命令\fontsize不会更改等命令所使用的大小\normalsize\small

相关内容