我的代码是这样的
\documentclass[a4paper,12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{showframe}
\usepackage{multicol}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=2.5cm,marginparwidth=6cm,marginparsep=1cm,outer=8cm,includeheadfoot]{geometry}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{ifthen}
%%%%%%%%%
%http://tex.stackexchange.com/questions/88559/package-right-similar-to-tufte-book
%%%%%%%%%
\pagestyle{fancy}
\makeatletter% so we can use macros with @ in their names
% Set the header/footer width to be the body text block plus the margin
% note area.
\newlength{\overhanglength}
\AtBeginDocument{%
% Calculate the amount to extend the running heads
\setlength{\overhanglength}{\marginparwidth}
\addtolength{\overhanglength}{\marginparsep}
% Set the running head offsets to the overhang length calculated above
\ifthenelse{\NOT\boolean{@mparswitch}\AND\boolean{@twoside}}
{\fancyhfoffset[RE,RO]{\overhanglength}}% asymmetric
{\fancyhfoffset[LE,RO]{\overhanglength}}% symmetric
}
% The running heads/feet don't have rules
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhf{} % clear any existing header and footer fields
% adjust the formatting code to suit your tastes here
\ifthenelse{\boolean{@twoside}}{%
\fancyhead[LE]{\textit{\thepage\quad\S\quad\nouppercase{\leftmark}}}%
\fancyhead[RO]{\textit{\nouppercase{\rightmark}\quad\S\quad\thepage}}%
}{%
\fancyhead[RE,RO]{\nouppercase{\rightmark}\quad\thepage}%
}
\makeatother% restore the original meaning of @
%%%%%%%%%
%http://tex.stackexchange.com/questions/88559/package-right-similar-to-tufte-book
%%%%%%%%%
\begin{document}
\chapter{Water}
\lipsum[1-6]
\section{Bacteria}
\lipsum[1-6]
\section{Virus}
\lipsum[1-6]
\clearpage
\newgeometry{left=1.5cm,right=1.5cm,top=1.5cm,bottom=2.5cm}
\setlength{\columnsep}{1cm}
\pagestyle{fancyplain}
\fancyhf{}
\fancyhead[CE]{\textit{\thepage\quad\S\quad\nouppercase{\leftmark}}}%
\fancyhead[CO]{\textit{\nouppercase{\rightmark}\quad\S\quad\thepage}}%
\section{Discussion}
\begin{multicols}{2}
\lipsum[1-8]
\end{multicols}
\end{document}
我的代码有两个问题。第一,第 6 和第 7 页的页眉有一些空格。我无法删除空格。
二、我想像图片这样分页。下一页是1.3 讨论相同的
我找不到任何方法来解决这个问题。有什么建议吗?
答案1
我解决了这个问题。一个关于标题的问题,
\documentclass[a4paper,twoside,openright,11pt]{scrbook}
\usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=6cm,marginparsep=1cm,outer=8cm]{geometry}
\usepackage{fancyhdr}
和...
\pagestyle{fancy}
\fancyheadoffset[LE,RO]{\marginparsep+\marginparwidth}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{ #1}}
\fancyhf{}
\fancyhead[RO]{\textbf{\nouppercase{Section \thesection{}}\quad\textcolor{orange}{$\blacksquare$}\quad}\textit{\rightmark}\quad\quad\textcolor{blue}{\textbf\thepage}}% Odd-Section
\fancyhead[LE]{\textcolor{blue}{\textbf\thepage}\textbf{\quad\quad\nouppercase{Chapter{ }\thechapter\quad\textcolor{orange}{$\blacksquare$}\quad}}\textit{\leftmark}}% Even-Chapter
\fancypagestyle{plain}{%
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
}
展示
第二个问题是关于页面布局,
\documentclass[a4paper,twoside,openright,11pt]{scrbook}
\usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=6cm,marginparsep=1cm,outer=8cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[svgnames]{xcolor}
\usepackage{color}
\usepackage{fancyhdr}
\usepackage[fulladjust]{marginnote}
\usepackage{calc}
\usepackage{adjmulticol}
\usepackage{lipsum}
\newenvironment{three}{\begin{adjmulticols}{3}{0cm}{-7cm}}{\end{adjmulticols}}
\newenvironment{two}{\begin{adjmulticols}{2}{0cm}{-7cm}}{\end{adjmulticols}}
\newenvironment{one}{\begin{adjmulticols}{1}{0cm}{-7cm}}{\end{adjmulticols}}
\usepackage{showframe}
\begin{document}
\chapter{Voltage and Current}
\textcolor{orange}{\lipsum[1]}
\begin{two}
\textcolor{red}{\lipsum[1]}
\end{two}
\begin{one}
\textcolor{blue}{\lipsum[1]}
\end{one}
\begin{three}
\lipsum[1]
\end{three}
\end{document}
当然,它可能非常短或解决方案不同。我是新手。谢谢大家https://tex.stackexchange.com/
有关的: 在偶数页和奇数页上添加边距