使用 Lyx 撰写论文时,我仅在偶数页上设置了页码。此处似乎是在页面中配置的
\lfoot[\thepage]{}
\cfoot{}
\rfoot[]{\thepage}
在主文档中,我通过将第三行更改为 来修复此问题
\rfoot[]{\thepage}̀
。
但在另一个文档中,我无法更改奇数页的页码。我想在右侧对奇数页进行编号。这个答案解释了如何插入自定义页眉/页脚,但没有解释如何添加Even header
我在论文模板的屏幕截图中看到的元素。如何插入我在屏幕截图中看到的灰色背景上的红色元素?
我发布了一个示例文件作为要点测试页码.lyx(以及 tex 版本测试页码.tex)可以看到编译后的PDF文档第3页已经没有页码了。
%% LyX 2.1.2 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,a4paper,british]{scrbook}
\usepackage{lmodern}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[authoryear]{natbib}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth
\makeatother
\usepackage{babel}
\begin{document}
\lhead[\chaptername~\thechapter]{\rightmark}
\rhead[\leftmark]{}
\lfoot[\thepage]{}
\cfoot{}
\rfoot[\thepage]{}
\chapter{testant}
bla
\pagebreak{}
bla
bla
\pagebreak{}
bla
bla
\pagebreak{}
bla
\end{document}
答案1
您可能想要以下内容,但我不确定。
%% LyX 2.1.2 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
%% JB edited the LyX code
\documentclass[12pt,a4paper,british]{scrbook}
\usepackage{lmodern}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[authoryear]{natbib}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth
\makeatother
\usepackage{babel}
\usepackage{scrlayer-scrpage}
\renewcommand{\chaptermarkformat}{\chapapp\ \thechapter\autodot\enskip}
\ofoot{\pagemark}
\ohead{\leftmark}
\usepackage{blindtext}
\begin{document}
\blinddocument
\addchap{Wombat}\blindtext[30]
\end{document}