scrlayer-scrpage 관련 컴파일 오류

scrlayer-scrpage 관련 컴파일 오류

내 질문 중 하나에 대한 솔루션이 이를 제공한 사람에게는 잘 작동하지만 컴파일하는 동안 "Missing \begin{document}.\ofoot*{\pagemark" 오류가 발생합니다. 내 설치, 패키지, OS에 문제가 있을 수 있나요? 이에온라인 라텍스 컴파일러동일한 오류로 인해 출력이 생성되지 않으므로 문제는 없지만 코드를 변경해야 합니까?

\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{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 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

언급된 온라인 컴파일러는 매우 오래된 KOMA-Script 버전을 사용합니다.

문서 클래스: scrartcl 2013/12/19 v3.12 KOMA-Script 문서 클래스(기사)

현재 버전은 3.22이고 버전 3.23은 곧 CTAN에서 제공될 예정입니다. 별표 표시된 버전 \ihead등은 버전 3.14에 도입되었습니다.

업데이트할 수 없으면 다음을 사용하십시오.

\usepackage[automark,markcase=upper,headsepline]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{\headmark}
\ofoot[\pagemark]{\pagemark}

전체 예:

\documentclass{scrartcl}
\usepackage[automark,headsepline,markcase=upper]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{\headmark}
\ofoot[\pagemark]{\pagemark}

\usepackage{blindtext}
\begin{document}
\thispagestyle{plain}
{\huge\KOMAScriptVersion\par}
\blinddocument
\end{document}

질문에 언급된 온라인 컴파일러의 출력:

여기에 이미지 설명을 입력하세요

답변2

게시된 코드는

! Paragraph ended before \@fileswith@ptions was complete.

하이퍼참조 옵션의 빈 줄 때문입니다.

그걸 없애면

\usepackage[
  pdftoolbar = false,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<<<<<<<<<<,
  pdfmenubar = false, 
  pdftitle   = mwe,
  pdfauthor  = {author},
  colorlinks,
  allcolors =  {blue},
  bookmarks         = true,
  bookmarksopen     = true, 
  bookmarksnumbered = true
]{hyperref}

그런 다음 오류가 발생합니다.

! Undefined control sequence.
<argument> \undefinedpagestyle 

l.48 \thispagestyle{leer}

그것이 정의된 페이지 스타일에 대한 오타인지, 아니면 해당 페이지 스타일의 정의가 누락되었는지 추측할 수 없습니다. 하지만 이를 제거하면 다음과 같습니다.

%\thispagestyle{leer}

그러면 문서가 오류 없이 실행됩니다.

관련 정보