0

My code is this

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

This my code have two problem. One, In the 6. and 7. pages headers have some spaces. I cannot delete spaces. enter image description here

Two, I want to page break like following the picture. Next page is 1.3 Discussion same

enter image description here

I cannot find any way to fix this. Any suggestions?

2
  • It's difficult to fix your code as long as I don't know what you are trying to do. Do you really need frames around headings and text and pictures? Maybe you amend your question: Describe the layout you want to have.
    – Keks Dose
    Aug 15, 2014 at 13:20
  • Dear Keks Dose, thanks for your answer. I will prepare my question, soon.
    – Özgür
    Aug 23, 2014 at 22:03

1 Answer 1

0

I solved problems that out. One Problem about header,

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

And...

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

Display enter image description here

And second Problem about page layout,

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

enter image description here

Of course it may be very short or different solution. I am new beginner. Thanks for everyone and https://tex.stackexchange.com/

Related: Addmargin on even and odd pages

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .