1

I have the boon and bane of the freedom on choosing between several options, sometimes just for the printed version of my generated document. As I already googled around, there are many opposed recommendations and I just want to hear what and why you would prefer one over the other option. I hope you are patient enough to discuss with a newbie on these options.

EDIT1: Thank you very much for the already valueable und useful hints! I updated the code and erased solved problems or changed it according to the comments. I will have a look to implement the rest of the comments asap.

EDIT2: I guess the rest of the questions is depending on your personal decision and I edited the final MWE for the solved issues. As suggested I opened a new question regarding the problem with the provided solution not compiling on my setup.

Here are the options I am talking about, used in an 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}

NN123
  • 137
  • 3
    To get more out of the build in head- and footline options from KOMA-script you could opt for scrlayer-scrpage (instead of using fancyhdr). – Skillmon Apr 27 '17 at 07:20
  • 1
    What exactly is the question here? – Johannes_B Apr 27 '17 at 07:21
  • 4
    If you're loading mathtools, it loads amsmath by default, so there's no need to load it twice. And I think subfigure is deprecated, use subcaption or subfig packages instead. There's plenty of questions here regarding including images side by side. – Troy Apr 27 '17 at 07:21
  • @Johannes_B The questions are in the code. I was confused for a bit too. – Troy Apr 27 '17 at 07:23
  • Regarding your subfigures, see the answer here https://tex.stackexchange.com/a/37597/117534 – Troy Apr 27 '17 at 07:25
  • 1
    You should not use only [!h] for the figureplacement. It gets replaced by [!ht] (emitting a warning) and might result in bad placement (at the end of the document or chapter)! You could use [!htbp] which results in the same as [!ht] most of the time. – Skillmon Apr 27 '17 at 07:28
  • 1
    I personally dislike the uppercase headline. For e.g. you should use the stuff you defined in your \eg-command (half blank \,). – Skillmon Apr 27 '17 at 07:38
  • 1
    If you use serif font and the default Computer Modern, you should include \usepackage{lmodern} which looks slightly better (Computer Modern can have a pixelated look). For multiple cites some may use [1, 2], which is supported by biblatex and the like. – Skillmon Apr 27 '17 at 07:44
  • 1
    The warning about thumbnails is caused by your usage of \usepackage{thumbpdf}. Do you really need that package? If so, read the documentation how to use it correctly. – Skillmon Apr 27 '17 at 08:02
  • Also: If you use the same optional argument for all of your figures (and/or tables), you can set the default placement with: \makeatletter\renewcommand{\fps@figure}{!htbp}\makeatother, for tables, replace \fps@figure with \fps@table. – Skillmon Apr 27 '17 at 08:22
  • Do you want to use chapters with pagestyle plain on chapter pages? Then have a look at documentclass scrreprt or scrbook. – esdd Apr 27 '17 at 10:10

1 Answers1

2

For the setup of your head- and footline with 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}

Use \thispagestyle{plain.scrheadings} instead of your \thispagestyle{leer}.

Embedded in your complete code (might not be the most recent version of your 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}
Skillmon
  • 60,462
  • Thank you for providing this code! Sadly I can´t compile it, the \ofoot*{\pagemark} seems to be the problem. – NN123 Apr 27 '17 at 08:03
  • @NN123 See the edit (it doesn't change anything, but uses the rest of your code). – Skillmon Apr 27 '17 at 08:07
  • thank you again, also for the patience, I´m still getting the same error, I should have provided it earlier I guess: Missing \begin{document}. \ofoot*{\pagemark – NN123 Apr 27 '17 at 08:09
  • @NN123 Please edit your question providing the code you are using to include my scrlayer-scrpage setup (perhaps as a new MCE below the existing one) or ask a new question. The complete example in my answer does compile without any errors. – Skillmon Apr 27 '17 at 08:18
  • I am using your code, copy & paste, still get this error, also tried it with an online compiler resulting in the same error :-( But these online compilers may be not the best solution to try it out. I may have a problem with my TeXStudio or MikTex not beeing up to date or a faulty installation. I will try to figure it out, thank you for all these comments and the provided solution, have a nice day :-) – NN123 Apr 27 '17 at 08:31
  • That's pretty strange. You might ask a new question on this (perhaps somebody can help you out). – Skillmon Apr 27 '17 at 09:00
  • It was due to an really outdated installation on my site and on the online compiler, your solution works fine, thank you – NN123 Apr 27 '17 at 09:52
  • @Skillmon You could use \clearpairofstyles to clear page header and footer. Package scrlayer-scrpage sets pagestyle scrheadings automatically. So I would use: \usepackage[automark,headsepline,markcase=upper]{scrlayer-scrpage} \clearpairofpagestyles \ihead{\headmark} \ofoot*{\pagemark} \addtokomafont{pagehead}{\normalfont}. The option captions=tableheading could be added to the class options. – esdd Apr 27 '17 at 10:08
  • @esdd The option captions=tableheading was set with \KOMAoptions in NN123's question. I think my more verbose solution is better as it might be easier to modify it for somebody with not much experience with KOMA. In addition I don't see any drawbacks in using \KOMAoptions instead of package and class options (except that it takes more letters of input). – Skillmon Apr 27 '17 at 11:05
  • For captions=tableheading there is really no difference. But there are other options like fontsize that require an explicit recalculation of typearea to get the same layout as if it was a class option. – esdd Apr 27 '17 at 11:27
  • @esdd true, but your point regarding fontsize is invalid here because of the usage of geometry, which doesn't use KOMA's typearea as far as I know. Still you're right, there are options which should be class options and not being declared late. – Skillmon Apr 27 '17 at 11:58