我可以自由地在多个选项之间进行选择,这既是好事也是坏事,有时只是为了打印生成的文档。我已经在 Google 上搜索过,有很多反对的建议,我只是想听听你为什么更喜欢其中一个而不是另一个。我希望你能耐心地与新手讨论这些选项。
EDIT1:非常感谢您提供的宝贵且有用的提示!我更新了代码并删除了已解决的问题或根据评论进行了更改。我会尽快查看并实施其余的评论。
EDIT2:我想其余的问题取决于您的个人决定,我针对已解决的问题编辑了最终的 MWE。根据建议,我提出了一个新问题,涉及所提供的解决方案无法在我的设置上编译的问题。
以下是我所谈论的在 MWE 中使用的选项:
\documentclass[12pt,a4paper,listof=flat,oneside]{scrartcl}
\KOMAoptions{captions=tableheading}
\usepackage{nicefrac}
\usepackage{scrlayer-scrpage}
\ihead{\headmark}
\chead*{}
\ofoot*{\pagemark}
\cfoot*{}
\pagestyle{scrheadings}
\automark[section]{section}
\setkomafont{pagehead}{\normalfont}
\KOMAoptions{
captions=tableheading,
headsepline=true,
markcase=upper}\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{xfrac}
\usepackage{xspace}
\newcommand{\eg}{\mbox{e.\,g.}\xspace}
\newcommand{\Eg}{\mbox{E.\,g.}\xspace}
\usepackage[english]{babel}
\usepackage[left=3.00cm, right=3.00cm, top=2.00cm, bottom=2.5cm, includeheadfoot]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage{lmodern}
%\usepackage{helvet}
%\renewcommand{\familydefault}{\sfdefault}
%\fontfamily{phv}\selectfont
\usepackage{color}
\usepackage[
pdftoolbar = false,
pdfmenubar = false,
pdftitle = mwe,
pdfauthor = {author},
colorlinks,
allcolors = {blue},
bookmarks = true,
bookmarksopen = true,
bookmarksnumbered = true
]{hyperref}
\usepackage{subcaption}
\begin{document}
\thispagestyle{leer}
\section{Chapter one} \label{sec:ChapterOne}
This text shows the current options that I have used for the printed version of my document. What and why would you change something?
\begin{itemize}
\item Referencing in blue. \Eg: Chapter one on page \ref{sec:ChapterOne}
\item In-text math mode I use tfrac or nicefrac like this $\tfrac{1}{2}$ or this $\nicefrac{1}{2}$ and dfrac in the stand-alone equations. Or is sfrac of the xfrac package the way to go? $\sfrac{1}{2}$. What is the difference?
\item Different fonts for print-out and digital copy? \Eg helvet for pdf for no serifs?
\end{itemize}
\newpage
Thats what the pagestyle I have choosed looks like, but there is a warning about fancyhdr, how to produce the same output with KOMA?
\begin{figure}[!htbp]
\null\hfill
\begin{minipage}[b]{0.4\linewidth}
\centering \includegraphics[width=\textwidth]{example-image-a}
\subcaption{Example A}\label{fig:a}
\end{minipage}
\hfill
\begin{minipage}[b]{0.4\linewidth}
\centering \includegraphics[width=\textwidth]{example-image-b}
\subcaption{Example B}\label{fig:b}
\end{minipage}
\hfill\null
\caption{Two figures with subcaption and minipage}
\end{figure}
\end{document}
答案1
使用以下方式设置您的头线和脚线scrlayer-scrpage
:
\usepackage{scrlayer-scrpage}
\ihead{\headmark}
\chead*{}
\ofoot*{\pagemark}
\cfoot*{}
\pagestyle{scrheadings}
\automark[section]{section}
\setkomafont{pagehead}{\normalfont}
\KOMAoptions{captions=tableheading,
headsepline=true,
markcase=upper}
使用\thispagestyle{plain.scrheadings}
而不是你的\thispagestyle{leer}
。
嵌入您的完整代码(可能不是您的 MWE 的最新版本):
\documentclass[12pt,a4paper,listof=flat,oneside]{scrartcl}
\KOMAoptions{captions=tableheading}
\usepackage{nicefrac}
\usepackage{scrlayer-scrpage}
\ihead{\headmark}
\chead*{}
\ofoot*{\pagemark}
\cfoot*{}
\pagestyle{scrheadings}
\automark[section]{section}
\setkomafont{pagehead}{\normalfont}
\KOMAoptions{
captions=tableheading,
headsepline=true,
markcase=upper}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{xfrac}
\usepackage{xspace}
\newcommand{\eg}{\mbox{e.\,g.}\xspace}
\newcommand{\Eg}{\mbox{E.\,g.}\xspace}
\usepackage[english]{babel}
\usepackage[left=3.00cm, right=3.00cm, top=2.00cm, bottom=2.5cm, includeheadfoot]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage{lmodern}
%\usepackage{helvet}
%\renewcommand{\familydefault}{\sfdefault}
%\fontfamily{phv}\selectfont
%\usepackage{thumbpdf}
\usepackage{color}
\usepackage[%
pdftoolbar = false,
pdfmenubar = false,
pdftitle = mwe,
pdfauthor = {author},
colorlinks,
allcolors = {blue},
bookmarks = true,
bookmarksopen = true,
bookmarksnumbered = true
]{hyperref}
\usepackage{subcaption}
\begin{document}
\thispagestyle{plain.scrheadings}
\section{Chapter one} \label{sec:ChapterOne}
This text shows the current options that I have used for the printed version of my document. What and why you would change something?
\begin{itemize}
\item Referencing in blue. \Eg: Chapter one on page \ref{sec:ChapterOne}
\item In-text math mode I use tfrac or nicefrac like this $\tfrac{1}{2}$ or this $\nicefrac{1}{2}$ and dfrac in the stand-alone equations. Or is sfrac of the xfrac package the way to go? $\sfrac{1}{2}$. What is the difference?
\item Different fonts for print-out and digital copy? \Eg helvet for pdf for no serifs?
\end{itemize}
\newpage
Thats what the pagestyle I have choosed looks like, but there is a warning about fancyhdr, how to produce the same output with KOMA? There is also a warning about no thumbnail data, how to handle this one?
\begin{figure}[!htbp]
\null\hfill
\begin{minipage}[b]{0.4\linewidth}
\centering \includegraphics[width=\textwidth]{example-image-a}
\subcaption{Example A}\label{fig:a}
\end{minipage}
\hfill
\begin{minipage}[b]{0.4\linewidth}
\centering \includegraphics[width=\textwidth]{example-image-b}
\subcaption{Example B}\label{fig:b}
\end{minipage}
\hfill\null
\caption{Two figures with subcaption and minipage}
\end{figure}
\end{document}