我有下面的序言,我想修改它以获得:
- 页码以 1、2、...等来编号,而不是以 x、xi、...等来编号。
- 页面顶部有一行,右侧显示章节名称,左侧显示页码。
我需要做哪些修改?
\documentclass[11pt]{book}
\usepackage{amssymb,amsbsy,amsmath,amsfonts,amssymb,amscd,colordvi}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{times}
%\usepackage{showkeys}
\usepackage{euscript}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage[utf8]{inputenc}
\usepackage[top=3.5cm, left=30mm, right=20mm,bottom=3.5cm]{geometry}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\topmargin=0cm
\oddsidemargin=0cm
\textwidth=17cm
\textheight=23.0cm
\topmargin=-1cm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \croix{\hbox{\bf \Large +}}
\newcommand{\Fe}{\mathcal F^{\varepsilon}}
\def \vd{{\varepsilon,\delta}}
\def\d{\delta}
\def \ve{\varepsilon}
\def \eps{\epsilon}
\def \limsup{\mathop{\overline {\rm lim}}}
\def \liminf{\mathop{\underline{\rm lim}}}
\def \be{\begin{equation}}
\def \ee{\end{equation}}
\def \mm{\mathfrak{M}}
\def \ff{\mathfrak{F}}
\def \ge{\mathfrak{g}}
\def \aa{\mathfrak{A}}
\def \e1{\mathfrak{e}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \ved{{\varepsilon,\delta}}%
\def \vedka{{\varepsilon,\delta,\varkappa}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \eqdef{\stackrel {\rm def} {=}}
\usepackage{color}
\def\red{\textcolor{red}}
\def\blue{\textcolor{blue}}
\def\green{\textcolor{green}}
\def\magenta{\textcolor{magenta}}
\def\cyan{\textcolor{cyan}}
\def \meas{{\rm meas}\,}
\def \div{{\rm div}\,}
% % % % % % % % % % % % % % % %
\def\oz{\overline{z}}
\def\ox{\overline{x}}
\def\mx{\mathsf m}
\def\fr{\mathsf f}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{definition}[theorem]{Definition}
\newtheorem{remark}{\rm Remark\/}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%le petit carre de fin de demonstration
\def \trait (#1) (#2) (#3){\vrule width #1pt height #2pt depth #3pt}
\def \fin{\hfill
\trait (0.1) (5) (0)
\trait (5) (0.1) (0)
\kern-5pt
\trait (5) (5) (-4.9)
\trait (0.1) (5) (0)
\medskip}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\font \twbbb= msbm10 scaled \magstep0 % definitions
\font \tenbbb= msbm7 scaled \magstep0 % for the font
\newfam\bbbfam \def\Bbb{\fam\bbbfam\twbbb} % \Bbb
\textfont\bbbfam=\twbbb \scriptfont\bbbfam=\tenbbb %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \R{{\Bbb R}} \def \C{{\Bbb C}} \def \Z{{\Bbb Z}}
\def \I{{\Bbb I}} \def \N{{\Bbb N}}
\def \ww{\mathfrak{w}}
\def \rr{\mathfrak{r}}
\def \ss{\mathfrak{S}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\renewcommand{\theequation}{\thechapter .\arabic{equation}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\baselinestretch}{1.2}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\frontmatter
\begin{small}
\tableofcontents
\end{small}
答案1
下列代码应该处理标题。
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear header and footer
\fancyhead[R]{\leftmark} % write chapter to the right side
\fancyhead[L]{\thepage} % pagenumber on the left
请注意,book documentclass
交替使用页边距。因此,总是将编号放在左侧而将章节放在右侧可能会显得很奇怪。您可以尝试以下方法,以交替使用编号和章节的位置。
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear header and footer
\fancyhead[EL]{\leftmark}
\fancyhead[ER]{\thepage}
\fancyhead[OR]{\leftmark}
\fancyhead[OL]{\thepage}
正如 Torbjorn T. 所述,可以通过删除来实现阿拉伯页码\frontmatter
。
因为似乎仍然存在一些误解,所以我包括了在我的 PC 上编译时没有错误的代码。如您所见,我删除了大部分序言,因为它是不需要的。参考文献的问题也得到了解决。
\documentclass[11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage[frenchb]{babel}
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear header and footer
\fancyhead[EL]{\leftmark}
\fancyhead[ER]{\thepage}
\fancyhead[OR]{\leftmark}
\fancyhead[OL]{\thepage}
\begin{document}
\begin{small}
\tableofcontents
\end{small}
\chapter{figures}
\begin{figure}
\centering
\includegraphics[width = 0.5\linewidth]{example-image-a}
\caption{An image}
\label{fig:ex_a}
\end{figure}
\begin{figure}
\centering
\includegraphics[width = 0.5\linewidth]{example-image-b}
\caption{Another image}
\label{fig:ex_b}
\end{figure}
This is \ref{fig:ex_a} and this is another figure called \ref{fig:ex_b}.
\chapter{lipsum}
\lipsum[1-30]
\end{document}
答案2
是的,你可以改变这一切。让 (La)TeX 更加强大!向 Knuth 和 Lamport 致敬。祝福他们无数的追随者。
另一方面,LaTeX 排版文档的许多难以(或几乎不可能)改变的方面是专业排版人员数百年来反复试验的结果。即使是一些易于更改的方面也是如此。除非你真的理解看似武断的决定背后的原因,避免改变它们。