页中的罗马数字

页中的罗马数字

论文前言中必须使用罗马数字作为页码。但如果我\frontmatter在 ERT 中写作,那么在某些页面上,页码会以罗马数字显示,而在其他页面上则不会。页码中的罗马数字怎么会仅限于前言中呢?

\batchmode
\makeatletter
\def\input@path{{\/}}
\makeatother
\documentclass[english,openany]{book}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[LGR,T2A,T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=1.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{array}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{tipa}
\usepackage{amstext}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{subscript}
\usepackage{chapterbib}
\doublespacing

\makeatletter


\DeclareRobustCommand{\greektext}{%
\fontencoding{LGR}\selectfont\def\encodingdefault{LGR}}
\DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}
\DeclareFontEncoding{LGR}{}{}
\DeclareTextSymbol{\~}{LGR}{126}
\DeclareRobustCommand{\cyrtext}{%
\fontencoding{T2A}\selectfont\def\encodingdefault{T2A}}
\DeclareRobustCommand{\textcyr}[1]{\leavevmode{\cyrtext #1}}
\AtBeginDocument{\DeclareFontEncoding{T2A}{}{}}

\newcommand{\lyxmathsym}[1]{\ifmmode\begingroup\def\b@ld{bold}
\text{\ifx\math@version\b@ld\bfseries\fi#1}\endgroup\else#1\fi}


\providecommand{\tabularnewline}{\\}

\usepackage{amsmath}
\usepackage[
 headsepline,
 ]{scrlayer-scrpage}
\automark[chapter]{chapter}
\addtokomafont{pagehead}{\small}
\clearpairofpagestyles
\chead{\headmark}
\cfoot*{\pagemark}

\makeatother

\usepackage{babel}
\begin{document}
\begin{frontmatter}
\chapter
\section
\subsection
\end{frontmatter}
\end{document}

我正在使用它\makecontents来制作章节内容。但是它不包括 frontmatter 中的页面内容,该怎么办?

答案1

OP 的‘MWE’无法编译——因为\chapter等命令没有参数。

\begin{frontmatter}...\end{frontmatter}是可能的,但在这里没有用。

主要原因是\frontmatter没有以下\mainmatter命令。

scrlayer-scrpage关于头部高度等的警告等。我不会解决这个问题。

%\batchmode
%\makeatletter
%\def\input@path{{\/}}
%\makeatother
\documentclass[english,openany]{book}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[LGR,T2A,T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=1.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{array}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{tipa}
\usepackage{amstext}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{subscript}
\usepackage{chapterbib}
\doublespacing

\makeatletter


\DeclareRobustCommand{\greektext}{%
\fontencoding{LGR}\selectfont\def\encodingdefault{LGR}}
\DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}
\DeclareFontEncoding{LGR}{}{}
\DeclareTextSymbol{\~}{LGR}{126}
\DeclareRobustCommand{\cyrtext}{%
\fontencoding{T2A}\selectfont\def\encodingdefault{T2A}}
\DeclareRobustCommand{\textcyr}[1]{\leavevmode{\cyrtext #1}}
\AtBeginDocument{\DeclareFontEncoding{T2A}{}{}}

\newcommand{\lyxmathsym}[1]{\ifmmode\begingroup\def\b@ld{bold}
\text{\ifx\math@version\b@ld\bfseries\fi#1}\endgroup\else#1\fi}


\providecommand{\tabularnewline}{\\}

\usepackage{amsmath}
\usepackage[
 headsepline,
 ]{scrlayer-scrpage}
\automark[chapter]{chapter}
\addtokomafont{pagehead}{\small}
\clearpairofpagestyles
\chead{\headmark}
\cfoot*{\pagemark}

\makeatother

\usepackage{babel}
\usepackage{blindtext}
\begin{document}
\frontmatter
\chapter{Foo}
\section{Foo}
\subsection{Foo}
\mainmatter
\chapter{Foobar}
\blindtext[10]
\end{document}

在此处输入图片描述

相关内容