0

I want to design a dictionary via using the two-column page layout, but some unexpected problems occur when formatting the header of pages. The troubles related with the header are described as follows:

  1. How to remove the column header at the beginning of every left column page? The image is following:

enter image description here

  1. How to lift the right-side header on even pages and the left-side header on odd pages to a higher position? See the following pictures:

enter image description here

enter image description here

  1. How to add bookmarks (switch to every capital letter, such as A, B, C, etc. at the head-position of every words group) into the output PDF document. To be precise, when I open the output through Acrobat Adobe Pro I couldn't find the bookmarks on the left-hand side. I have already loaded the package hyperref, however, it didn't work.

The minimal working example is:

    \documentclass[twoside,10pt,twocolumn]{book}
\usepackage{lipsum}
\usepackage{adforn}
\usepackage[top=2.0cm, bottom=3.5cm, left=2cm, right=2cm]{geometry}%default top=1.5cm
\usepackage{fancyhdr}
\usepackage[french, english]{babel}
\usepackage[utf8x,utf8]{inputenc}
\usepackage{color}
\definecolor{marron}{RGB}{60,30,10}
\definecolor{darkblue}{RGB}{0,0,80}
\definecolor{lightblue}{RGB}{80,80,80}
\definecolor{darkgreen}{RGB}{0,80,0}
\definecolor{darkgray}{RGB}{0,80,0}
\definecolor{darkred}{RGB}{80,0,0}
\definecolor{shadecolor}{rgb}{0.97,0.97,0.97}
\usepackage[T1]{fontenc}
\usepackage{hanging}
\usepackage{tikz}
\usetikzlibrary{calc}

%---------------------------------------------------------------------------------------------%
\usepackage{fourier-orns}
\newcommand{\ornpar}{\noindent \textcolor{darkgray}{ \raisebox{-1.9pt}[10pt][10pt]{\leafright} \hrulefill \raisebox{-1.9pt}[10pt][10pt]{\leafright \decofourleft \decothreeleft  \aldineright \decotwo \floweroneleft \decoone}}}%even-footer part
\newcommand{\ornimpar}{\textcolor{darkgray}{\raisebox{-1.9pt}[10pt][10pt]{\decoone \floweroneright \decotwo \aldineleft \decothreeright \decofourright \leafleft} \hrulefill \raisebox{-1.9pt}[10pt][10pt]{\leafleft}}}%odd-footer part
%---------------------------------------------------------------------------------------------%


%---------------------------------------------------------------------------------------------%
\newcommand\entry[4][]{\hangpara{2em}{1}{\fontfamily{phv}\selectfont{\textbf{{#2}}}}\ #4\ 
#3 \ifx\relax #1 \relax \markboth{#2}{#2}\else\markboth{#1}{#1}\fi
\vspace*{5pt}\par} \nopagebreak[4]%entry of dictionary

\newcommand*{\dictchar}[1]{\centerline{\LARGE\textbf{#1}}\vspace*{10pt}\par}
%---------------------------------------------------------------------------------------------%




%---------------------------------------------------------------------------------------------%
% use fancyhdr or whatever you want to add
% the boxes to the header to make them appear
% on every page

% new counter to hold the current number of the
% letter to determine the vertical position
\newcounter{letternum}
% newcounter for the sum of all letters to get
% the right height of a box
\newcounter{lettersum}
\setcounter{lettersum}{26}
% some margin settings
\newlength{\thumbtopmargin}
\setlength{\thumbtopmargin}{1cm}
\newlength{\thumbbottommargin}
\setlength{\thumbbottommargin}{3cm}
% calculate the box height by dividing the page height
\newlength{\thumbheight}
\pgfmathsetlength{\thumbheight}{%
(\paperheight-\thumbtopmargin-\thumbbottommargin)%
/%
\value{lettersum}
}
% box width
\newlength{\thumbwidth}
\setlength{\thumbwidth}{1.5cm}
% style the boxes
\tikzset{
thumb/.style={
   fill=black!50!red,
   text=white,
   minimum height=\thumbheight,
   text width=\thumbwidth,
   outer sep=0pt,
   font=\sffamily\bfseries,
}
}
\newcommand{\oddthumb}[1]{%
    % see pgfmanual.pdf for more information about this part
    \begin{tikzpicture}[remember picture, overlay]
        \node [thumb,text centered,anchor=north east,] at ($%
            (current page.north east)-%
            (0,\thumbtopmargin+\value{letternum}*\thumbheight)%
        $) {#1};
   \end{tikzpicture}
}
\newcommand{\eventhumb}[1]{%
    % see pgfmanual.pdf for more information about this part
    \begin{tikzpicture}[remember picture, overlay]
        \node [thumb,text centered,anchor=north west,] at ($%
            (current page.north west)-%
            (0,\thumbtopmargin+\value{letternum}*\thumbheight)%
        $) {#1};
   \end{tikzpicture}
}

% create a new command to set a new lettergroup
\newcommand{\lettergroup}[1]{%
\fancypagestyle{chapterstart}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\chead{\oddthumb{#1}}% chapters start only on odd pages
\cfoot{\thepage}
}
\fancyhead[LO]{\fontfamily{phv}\selectfont{\textbf{\rightmark}}\oddthumb{#1}}%
\fancyhead[RE]{\fontfamily{phv}\selectfont{\textbf{\leftmark}}\eventhumb{#1}}%

% step the counter of the letters
\stepcounter{letternum}%
}
%---------------------------------------------------------------------------------------------%



%---------------------------------------------------------------------------------------------%
   \makeatletter%headrule
      \def\headrule{ {\color{darkgray}\raisebox{-2.1pt}[10pt][10pt]{\leafright} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{~~~\decofourleft \decotwo \decofourright~~~} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{ \leafleft}} }
   \makeatother

 % \renewcommand\headrule{ {\color{darkgray}\raisebox{-2.1pt}[10pt][10pt]{\leafright} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{~~~\decofourleft \decotwo \decofourright~~~} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{ \leafleft}} }

% % \renewcommand\headrule{{\leafright} \hrulefill
% % \raisebox{-2.1pt}[10pt][10pt]{\quad\decofourleft\decotwo\decofourright\quad}{\hrulefill}\leafleft}
%---------------------------------------------------------------------------------------------%




%---------------------------------------------------------------------------------------------%
\fancypagestyle{basicstyle}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhead[LE,RO]{\textbf{\chaptitle}}
\fancyhead[LO,RE]{\textbf{\thepage}}
\fancyfoot[LE,RO]{\thepage}}



\fancypagestyle{dictstyle}{%
  \fancyhf{}

  %\renewcommand{\headrulewidth}{0pt}
  \fancyhead[LE,LO]{{\fontfamily{phv}\selectfont{\textbf{\raisebox{0.8em}{\rightmark}}}}}%[LE,LO]
  \fancyhead[CO,CE]{\headrule}%\thepage
  \fancyhead[RE,RO]{{\fontfamily{phv}\selectfont{\textbf{\raisebox{0.8em}{\leftmark}}}}}%[RE,RO]
  \renewcommand{\headrulewidth}{0pt}  

  \fancyfoot[LO]{
  \ornimpar \\ \hfill \textcolor{darkgray}{\large \leafNE ~~~ \raisebox{-0.35em}{\textsf{\textbf{\thepage}}} }  
  }%奇数面的footer

  \fancyfoot[RE]{\ornpar   \\ \textcolor{darkgray}{\large \raisebox{-0.35em}{\textsf{\textbf{\thepage}}} ~~~ \reflectbox{\leafNE}} \hfill}
  }%偶数面的footer, \fancyfoot[RE]{\ornpar   \\ \large  \sffamily\bf \textcolor{darkgray}{\thepage ~~~ \reflectbox{\leafNE}}  \hfill}}


\setlength{\columnsep}{20pt}
\setlength{\columnseprule}{0pt}
%---------------------------------------------------------------------------------------------%

\usepackage{hyperref}







%\pagestyle{basicstyle}


%----------------------------------------------------------------------------------------------%

\begin{document}
%\maketitle
\begin{titlepage}
  \centering\Huge \adforn{26}\adforn{21}\quad\adforn{11}\quad\adforn{49}\adforn{54}

\vspace*{2em}{\centering\bf %9em, \usefont{OT1}{cmr}{m}{it} 
\texttt{\textbf{My Own Dictionary}}\par}

\vspace{2em}
{\hfill\centering \large{The Author}\hfill} %\hfill \itshape A story of love, hate and fame
\end{titlepage}

\newpage
%\adforn{21}\quad\adforn{11}\quad\adforn{49}
%----------------------------------------------------------------------------------------------%
\fancyhf{}
\pagestyle{dictstyle}

\lettergroup{A}
\dictchar{A}
\entry[headwords]{headwords}{translations}{/yinfu/}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\entry[philosophy]{philosophy} {Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut purus elit, vestibulum ut, \emph{plac- erat ac}}{/yinfu/}
\entry[Math]{Math}{Lorem ipsum dolor sit amet}{/yinfu/}
\entry[Physics]{Physics}{\lipsum[1-2]}{/yinfu/}
\entry[Nature]{Nature}{\lipsum}{/yinfu/}
\clearpage


\lettergroup{B}
\dictchar{B}
\entry[headwords]{headwords}{translations}{/yinfu/}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\clearpage

\lettergroup{C}
\dictchar{C}
\entry[headwords]{headwords}{translations}{/yinfu/}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\clearpage
\end{document}

PS: My Tex is based on two beautiful examples offered by @Fran on here

and by @chejnik on here

Any suggestions are appreciated, and thank you in advance.


The following picture is the output of @Biki Teron's code.

enter image description here


I now can solve the second question in my original post with the help of following improved Tex cod:

\documentclass[twoside,10pt,twocolumn]{book}
\usepackage{lipsum}
\usepackage{adforn}
\usepackage[top=2.0cm, bottom=3.5cm, left=2cm, right=2cm]{geometry}%default top=1.5cm
\usepackage{fancyhdr}
\usepackage[icelandic, czech, english]{babel}
\usepackage[utf8x,utf8]{inputenc}
\usepackage{color}
\definecolor{marron}{RGB}{60,30,10}
\definecolor{darkblue}{RGB}{0,0,80}
\definecolor{lightblue}{RGB}{80,80,80}
\definecolor{darkgreen}{RGB}{0,80,0}
\definecolor{darkgray}{RGB}{0,80,0}
\definecolor{darkred}{RGB}{80,0,0}
\definecolor{shadecolor}{rgb}{0.97,0.97,0.97}
\usepackage[T1]{fontenc}
\usepackage{hanging}
\usepackage{tikz}
\usetikzlibrary{calc}

%---------------------------------------------------------------------------------------------%
\usepackage{fourier-orns}
\newcommand{\ornpar}{\noindent \textcolor{darkgray}{ \raisebox{-1.9pt}[10pt][10pt]{\leafright} \hrulefill \raisebox{-1.9pt}[10pt][10pt]{\leafright \decofourleft \decothreeleft  \aldineright \decotwo \floweroneleft \decoone}}}
\newcommand{\ornimpar}{\textcolor{darkgray}{\raisebox{-1.9pt}[10pt][10pt]{\decoone \floweroneright \decotwo \aldineleft \decothreeright \decofourright \leafleft} \hrulefill \raisebox{-1.9pt}[10pt][10pt]{\leafleft}}}
%---------------------------------------------------------------------------------------------%


%---------------------------------------------------------------------------------------------%
\newcommand\entry[4][]{\hangpara{2em}{1}{\fontfamily{phv}\selectfont{\textbf{{#2}}}}\ #4\ 
#3 \ifx\relax #1 \relax \markboth{#2}{#2}\else\markboth{#1}{#1}\fi
 \vspace*{5pt}\par} \nopagebreak[4]

\newcommand*{\dictchar}[1]{\centerline{\LARGE\textbf{#1}}\vspace*{10pt}\par}
%---------------------------------------------------------------------------------------------%




%---------------------------------------------------------------------------------------------%
% use fancyhdr or whatever you want to add
% the boxes to the header to make them appear
% on every page

% new counter to hold the current number of the
% letter to determine the vertical position
\newcounter{letternum}
% newcounter for the sum of all letters to get
% the right height of a box
\newcounter{lettersum}
\setcounter{lettersum}{26}
% some margin settings
\newlength{\thumbtopmargin}
\setlength{\thumbtopmargin}{1cm}
\newlength{\thumbbottommargin}
\setlength{\thumbbottommargin}{3cm}
% calculate the box height by dividing the page height
\newlength{\thumbheight}
\pgfmathsetlength{\thumbheight}{%
(\paperheight-\thumbtopmargin-\thumbbottommargin)%
/%
\value{lettersum}
}
% box width
\newlength{\thumbwidth}
\setlength{\thumbwidth}{1.5cm}
% style the boxes
\tikzset{
thumb/.style={
   fill=black!50!red,
   text=white,
   minimum height=\thumbheight,
   text width=\thumbwidth,
   outer sep=0pt,
   font=\sffamily\bfseries,
}
}
\newcommand{\oddthumb}[1]{%
    % see pgfmanual.pdf for more information about this part
    \begin{tikzpicture}[remember picture, overlay]
        \node [thumb,text centered,anchor=north east,] at ($%
            (current page.north east)-%
            (0,\thumbtopmargin+\value{letternum}*\thumbheight)%
        $) {#1};
   \end{tikzpicture}
}
\newcommand{\eventhumb}[1]{%
    % see pgfmanual.pdf for more information about this part
    \begin{tikzpicture}[remember picture, overlay]
        \node [thumb,text centered,anchor=north west,] at ($%
            (current page.north west)-%
            (0,\thumbtopmargin+\value{letternum}*\thumbheight)%
            $) {#1};
   \end{tikzpicture}
}

% create a new command to set a new lettergroup
\newcommand{\lettergroup}[1]{%

 \fancypagestyle{chapterstart}{%
 \fancyhf{}
 \pagestyle{fancy}
 \renewcommand{\headrulewidth}{0pt}
 \chead{\oddthumb{#1}}% chapters start only on odd pages
 \cfoot{\thepage}
 }

 %\renewcommand{\headrulewidth}{0pt}
 %\fancyhead{}

  \fancyhead[LO]{ \raisebox{1em}{ \fontfamily{phv} \selectfont{\textbf{\rightmark}} } \oddthumb{#1}}
  \fancyhead[RE]{ \raisebox{1em}{ \fontfamily{phv}    \selectfont{\textbf{\leftmark}} } \eventhumb{#1}}



  \fancyhead[LE]{{\fontfamily{phv}\selectfont{\textbf{\raisebox{1em}{\rightmark}}}}}
  \fancyhead[CO,CE]{\headrule}
  \fancyhead[RO]{{\fontfamily{phv}\selectfont{\textbf{\raisebox{1em}   {\leftmark}}}}}

% step the counter of the letters
\stepcounter{letternum}%
}
%---------------------------------------------------------------------------------------------%



    %---------------------------------------------------------------------------------------------%
        \makeatletter%标题的headrule
       \def\headrule{ { \color{darkgray} \raisebox{-2.1pt}[10pt][10pt]{\leafright} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{~~~\decofourleft \decotwo \decofourright~~~} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{ \leafleft}  } }
        \makeatother

     % \renewcommand\headrule{ {\color{darkgray}\raisebox{-2.1pt}[10pt][10pt]{\leafright} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{~~~\decofourleft \decotwo \decofourright~~~} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{ \leafleft}} }

    % % \renewcommand\headrule{{\leafright} \hrulefill
    % % \raisebox{-2.1pt}[10pt][10pt]{\quad\decofourleft\decotwo\decofourright    \quad}{\hrulefill}\leafleft}
    %---------------------------------------------------------------------------------------------%




    %---------------------------------------------------------------------------------------------%
 \fancypagestyle{basicstyle}{%
 \fancyhf{}
 \renewcommand{\headrulewidth}{0.4pt}
 \renewcommand{\footrulewidth}{0pt}
 \fancyhead[LE,RO]{\textbf{\chaptitle}}
 \fancyhead[LO,RE]{\textbf{\thepage}}
 \fancyfoot[LE,RO]{\thepage}}



\fancypagestyle{dictstyle}{%
  \fancyhf{}


  % \fancyhead[LE,LO]{{\fontfamily{phv}\selectfont{\textbf{\raisebox{1em}   {\rightmark}}}}}
  % \fancyhead[CO,CE]{\headrule}%\thepage,\headrule
  % \fancyhead[RE,RO]{{\fontfamily{phv}\selectfont{\textbf{\raisebox{1em}   {\leftmark}}}}}
  \renewcommand{\headrulewidth}{0pt} 
  \fancyhead{}

  \fancyfoot[LO]{
  \ornimpar \\ \hfill \textcolor{darkgray}{\large \leafNE ~~~    \raisebox{-0.35em}{\textsf{\textbf{\thepage}}} }  }

  \fancyfoot[RE]{\ornpar   \\ \textcolor{darkgray}{\large    \raisebox{-0.35em}   {\textsf{\textbf{\thepage}}} ~~~ \reflectbox{\leafNE}} \hfill  }
  }


\setlength{\columnsep}{20pt}
\setlength{\columnseprule}{0pt}
%---------------------------------------------------------------------------------------------%

\usepackage{hyperref}







%\pagestyle{basicstyle}


%----------------------------------------------------------------------------------------------%

\begin{document}
%\maketitle
\begin{titlepage}
  \centering\Huge \adforn{26}\adforn{21}\quad\adforn{11}\quad\adforn{49}   \adforn{54}

\vspace*{2em}\centering\bf 
\texttt{My Dictionary}\par

\vspace{2em}
{\hfill\centering \large{The Author}\hfill} 
\end{titlepage}

\newpage
%\adforn{21}\quad\adforn{11}\quad\adforn{49}
%----------------------------------------------------------------------------------------------%
 \twocolumn
 \fancyhf{}
\pagestyle{dictstyle}%dictstyle

\lettergroup{A}
\dictchar{A}
% \hyperlink{A}{\dictchar{A}} 
\entry[headwords]{headwords}{translations}{\textsf{/yinfu/}}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\entry[philosophy]{philosophy} {Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut purus elit, vestibulum ut, \emph{plac- erat ac}}{/yinfu/}
\entry[Math]{Math}{Lorem ipsum dolor sit amet}{/yinfu/}
\entry[Physics]{Physics}{\lipsum[1-2]}{/yinfu/}
\entry[Nature]{Nature}{\lipsum}{/yinfu/}
\clearpage


\lettergroup{B}
\dictchar{B}
\entry[headwords]{headwords}{translations}{/yinfu/}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\clearpage

\lettergroup{C}
\dictchar{C}
\entry[headwords]{headwords}{translations}{/yinfu/}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\clearpage
\end{document}
1
\documentclass[twoside,10pt,twocolumn]{book}
\usepackage{lipsum}
\usepackage{adforn}
\usepackage[top=2.0cm, bottom=3.5cm, left=2cm, right=2cm]{geometry}%default top=1.5cm
\usepackage{fancyhdr}
\usepackage[french, english]{babel}
\usepackage[utf8x,utf8]{inputenc}
\usepackage{color}
\definecolor{marron}{RGB}{60,30,10}
\definecolor{darkblue}{RGB}{0,0,80}
\definecolor{lightblue}{RGB}{80,80,80}
\definecolor{darkgreen}{RGB}{0,80,0}
\definecolor{darkgray}{RGB}{0,80,0}
\definecolor{darkred}{RGB}{80,0,0}
\definecolor{shadecolor}{rgb}{0.97,0.97,0.97}
\usepackage[T1]{fontenc}
\usepackage{hanging}
\usepackage{tikz}
\usetikzlibrary{calc}

%---------------------------------------------------------------------------------------------%
\usepackage{fourier-orns}
\newcommand{\ornpar}{\noindent \textcolor{darkgray}{ \raisebox{-1.9pt}[10pt][10pt]{\leafright} \hrulefill \raisebox{-1.9pt}[10pt][10pt]{\leafright \decofourleft \decothreeleft  \aldineright \decotwo \floweroneleft \decoone}}}%even-footer part
\newcommand{\ornimpar}{\textcolor{darkgray}{\raisebox{-1.9pt}[10pt][10pt]{\decoone \floweroneright \decotwo \aldineleft \decothreeright \decofourright \leafleft} \hrulefill \raisebox{-1.9pt}[10pt][10pt]{\leafleft}}}%odd-footer part
%---------------------------------------------------------------------------------------------%


%---------------------------------------------------------------------------------------------%
\newcommand\entry[4][]{\hangpara{2em}{1}{\fontfamily{phv}\selectfont{\textbf{{#2}}}}\ #4\ 
#3 \ifx\relax #1 \relax \markboth{#2}{#2}\else\markboth{#1}{#1}\fi
\vspace*{5pt}\par} \nopagebreak[4]%entry of dictionary

\newcommand*{\dictchar}[1]{\centerline{\LARGE\textbf{#1}}\vspace*{10pt}\par}
%---------------------------------------------------------------------------------------------%




%---------------------------------------------------------------------------------------------%
% use fancyhdr or whatever you want to add
% the boxes to the header to make them appear
% on every page

% new counter to hold the current number of the
% letter to determine the vertical position
\newcounter{letternum}
% newcounter for the sum of all letters to get
% the right height of a box
\newcounter{lettersum}
\setcounter{lettersum}{26}
% some margin settings
\newlength{\thumbtopmargin}
\setlength{\thumbtopmargin}{1cm}
\newlength{\thumbbottommargin}
\setlength{\thumbbottommargin}{3cm}
% calculate the box height by dividing the page height
\newlength{\thumbheight}
\pgfmathsetlength{\thumbheight}{%
(\paperheight-\thumbtopmargin-\thumbbottommargin)%
/%
\value{lettersum}
}
% box width
\newlength{\thumbwidth}
\setlength{\thumbwidth}{1.5cm}
% style the boxes
\tikzset{
thumb/.style={
   fill=black!50!red,
   text=white,
   minimum height=\thumbheight,
   text width=\thumbwidth,
   outer sep=0pt,
   font=\sffamily\bfseries,
}
}
\newcommand{\oddthumb}[1]{%
    % see pgfmanual.pdf for more information about this part
    \begin{tikzpicture}[remember picture, overlay]
        \node [thumb,text centered,anchor=north east,] at ($%
            (current page.north east)-%
            (0,\thumbtopmargin+\value{letternum}*\thumbheight)%
        $) {#1};
   \end{tikzpicture}
}
\newcommand{\eventhumb}[1]{%
    % see pgfmanual.pdf for more information about this part
    \begin{tikzpicture}[remember picture, overlay]
        \node [thumb,text centered,anchor=north west,] at ($%
            (current page.north west)-%
            (0,\thumbtopmargin+\value{letternum}*\thumbheight)%
        $) {#1};
   \end{tikzpicture}
}

% create a new command to set a new lettergroup
\newcommand{\lettergroup}[1]{%
\fancypagestyle{chapterstart}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\chead{\oddthumb{#1}}% chapters start only on odd pages
\cfoot{\thepage}
}
\fancyhead[LO]{\fontfamily{phv}\selectfont{\textbf{\rightmark}}\oddthumb{#1}}%
\fancyhead[RE]{\fontfamily{phv}\selectfont{\textbf{\leftmark}}\eventhumb{#1}}%

% step the counter of the letters
\stepcounter{letternum}%
}
%---------------------------------------------------------------------------------------------%



%---------------------------------------------------------------------------------------------%
   \makeatletter%headrule
      \def\headrule{ {\color{black}\raisebox{3.1pt}{\leafright} \raisebox{1ex}{\rule{7.2cm}{1pt}} \raisebox{3.1pt}{~~~\decofourleft \decotwo \decofourright~~~} \raisebox{1ex}{\rule{7.2cm}{1pt}} \raisebox{3.1pt}{ \leafleft}} }
   \makeatother

 % \renewcommand\headrule{ {\color{darkgray}\raisebox{-2.1pt}[10pt][10pt]{\leafright} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{~~~\decofourleft \decotwo \decofourright~~~} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{ \leafleft}} }

% % \renewcommand\headrule{{\leafright} \hrulefill
% % \raisebox{-2.1pt}[10pt][10pt]{\quad\decofourleft\decotwo\decofourright\quad}{\hrulefill}\leafleft}
%---------------------------------------------------------------------------------------------%




%---------------------------------------------------------------------------------------------%
\fancypagestyle{basicstyle}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhead[LE,RO]{\textbf{\chaptitle}}
\fancyhead[LO,RE]{\textbf{\thepage}}
\fancyfoot[LE,RO]{\thepage}}



\fancypagestyle{dictstyle}{%
  \fancyhf{}

  %\renewcommand{\headrulewidth}{0pt}
  \fancyhead[LE,LO]{{\fontfamily{phv}\selectfont{\textbf{\raisebox{-0.4em}{\rightmark}}}}}%[LE,LO]
  %\fancyhead[CO,CE]{\headrule}%\thepage
  \fancyhead[RE,RO]{{\fontfamily{phv}\selectfont{\textbf{\raisebox{-0.4em}{\leftmark}}}}}%[RE,RO]
  \renewcommand{\headrulewidth}{0pt}  

  \fancyfoot[LO]{
  \ornimpar \\ \hfill \textcolor{darkgray}{\large \leafNE ~~~ \raisebox{-0.35em}{\textsf{\textbf{\thepage}}} }  
  }%奇数面的footer

  \fancyfoot[RE]{\ornpar   \\ \textcolor{darkgray}{\large \raisebox{-0.35em}{\textsf{\textbf{\thepage}}} ~~~ \reflectbox{\leafNE}} \hfill}
  }%偶数面的footer, \fancyfoot[RE]{\ornpar   \\ \large  \sffamily\bf \textcolor{darkgray}{\thepage ~~~ \reflectbox{\leafNE}}  \hfill}}


\setlength{\columnsep}{20pt}
\setlength{\columnseprule}{0pt}
%---------------------------------------------------------------------------------------------%

\usepackage{hyperref}







%\pagestyle{basicstyle}


%----------------------------------------------------------------------------------------------%

\begin{document}
%\maketitle
\begin{titlepage}
  \centering\Huge \adforn{26}\adforn{21}\quad\adforn{11}\quad\adforn{49}\adforn{54}

\vspace*{2em}{\centering\bf %9em, \usefont{OT1}{cmr}{m}{it} 
\texttt{\textbf{My Own Dictionary}}\par}

\vspace{2em}
{\hfill\centering \large{The Author}\hfill} %\hfill \itshape A story of love, hate and fame
\end{titlepage}

\newpage
%\adforn{21}\quad\adforn{11}\quad\adforn{49}
%----------------------------------------------------------------------------------------------%
\fancyhf{}
\pagestyle{dictstyle}

\lettergroup{A}
\dictchar{A}
\entry[headwords]{headwords}{translations}{/yinfu/}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\entry[philosophy]{philosophy} {Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut purus elit, vestibulum ut, \emph{plac- erat ac}}{/yinfu/}
\entry[Math]{Math}{Lorem ipsum dolor sit amet}{/yinfu/}
\entry[Physics]{Physics}{\lipsum[1-2]}{/yinfu/}
\entry[Nature]{Nature}{\lipsum}{/yinfu/}
\clearpage


\lettergroup{B}
\dictchar{B}
\entry[headwords]{headwords}{translations}{/yinfu/}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\clearpage

\lettergroup{C}
\dictchar{C}
\entry[headwords]{headwords}{translations}{/yinfu/}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\clearpage
\end{document}

enter image description here enter image description here enter image description here enter image description here

My compilation in Texlive-2017 using Texmaker-4.1.1

enter image description here enter image description here enter image description here enter image description here

  • @ Biki Teron I compiled your Tex code, and the output (compiled by XeTex engine and pdfTex engine ) is not what I want to obtain. PS: I don't know how to insert the pictures in my comment. So I will insert a picture of the output according to your code in my original post. – GL_n Jul 8 '17 at 19:58
  • I am getting the output what i have shown in my answer, I am using TeXlive-2017 and updated version, and compiled on Texmaker, i will show you again my compilation with texmaker screenshot in my answered, can you please mention what you are using?@GL_n – Biki Teron Jul 9 '17 at 0:40
  • @ Biki Teron First of all, thank you very much for your presentation of output. I am using TeXlive-2016, and compiled on Sublime Text 3 with Mac OS Sierra-Version 10.12.5. – GL_n Jul 9 '17 at 1:00
  • Try using pdflatex filename in your terminal,Please kindly let me know what you are getting@GL_n – Biki Teron Jul 9 '17 at 1:16
  • @ Biki Teron The output of the command mentioned above in terminal is as follows: > This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) > (preloaded format=pdflatex) > restricted \write18 enabled. > entering extended mode > ! I can't find file `filename'. > <*> filename – GL_n Jul 9 '17 at 1:26
0

I have adjusted the code, and eventually solved the header-formatting problem. If we do not define a global decorative head-rule by the command renewcommand or the internal Tex definition \makeatleter \define\headrule{...}\makeatother then this decorative head-rule will not appear as a left column header. This solve the second question. On the other hand, we can control the lifting or dropping of left-header and right-header of the whole page (which contains two columns) by using the command \raisebox{\leftmark or \rightmark}. This solves the first question. My improved Tex code is as follows:

\documentclass[twoside,10pt,twocolumn]{book}
\usepackage{lipsum}
\usepackage{adforn}
\usepackage[top=2.0cm, bottom=3.5cm, left=2cm, right=2cm]{geometry}%
\usepackage{fancyhdr}
\usepackage[icelandic, czech, english]{babel}%
\usepackage[utf8x,utf8]{inputenc}
\usepackage{color}
\definecolor{marron}{RGB}{60,30,10}
\definecolor{darkblue}{RGB}{0,0,80}
\definecolor{lightblue}{RGB}{80,80,80}
\definecolor{darkgreen}{RGB}{0,80,0}
\definecolor{darkgray}{RGB}{0,80,0}
\definecolor{darkred}{RGB}{80,0,0}
\definecolor{shadecolor}{rgb}{0.97,0.97,0.97}
\usepackage[T1]{fontenc}
\usepackage{hanging}
\usepackage{tikz}
\usetikzlibrary{calc}

%---------------------------------------------------------------------------------------------%
\usepackage{fourier-orns}
\newcommand{\ornpar}{\noindent \textcolor{darkgray}{ \raisebox{-1.9pt}       [10pt][10pt]{\leafright} \hrulefill \raisebox{-1.9pt}[10pt][10pt] {\leafright \decofourleft \decothreeleft  \aldineright \decotwo                    \floweroneleft \decoone}}}%

\newcommand{\ornimpar}{\textcolor{darkgray}{\raisebox{-1.9pt}[10pt][10pt]{\decoone \floweroneright \decotwo \aldineleft \decothreeright  \decofourright \leafleft} \hrulefill \raisebox{-1.9pt}[10pt][10pt]{\leafleft}}}%
%---------------------------------------------------------------------------------------------%


%---------------------------------------------------------------------------------------------%
\newcommand\entry[4][]{\hangpara{2em}{1}  {\fontfamily{phv}\selectfont{\textbf{{#2}}}}\ #4\ 
#3 \ifx\relax #1 \relax \markboth{#2}{#2}\else\markboth{#1}{#1}\fi
\vspace*{5pt}\par} \nopagebreak[4]%
\newcommand*{\dictchar}[1]{\centerline{\LARGE\textbf{#1}}\vspace*{10pt}\par}%
%---------------------------------------------------------------------------------------------%




%---------------------------------------------------------------------------------------------%
% use fancyhdr or whatever you want to add
% the boxes to the header to make them appear
% on every page

% new counter to hold the current number of the
% letter to determine the vertical position
\newcounter{letternum}
% newcounter for the sum of all letters to get
% the right height of a box
\newcounter{lettersum}
\setcounter{lettersum}{26}
% some margin settings
\newlength{\thumbtopmargin}
\setlength{\thumbtopmargin}{2.06cm}%1cm
\newlength{\thumbbottommargin}
\setlength{\thumbbottommargin}{3cm}
% calculate the box height by dividing the page height
\newlength{\thumbheight}
\pgfmathsetlength{\thumbheight}{%
(\paperheight-\thumbtopmargin-\thumbbottommargin)%
/%
\value{lettersum}
}
% box width
\newlength{\thumbwidth}
\setlength{\thumbwidth}{1.5cm}
% style the boxes
\tikzset{
thumb/.style={
fill=black!50!red,
text=white,
minimum height=\thumbheight,
text width=\thumbwidth,
outer sep=0pt,
font=\sffamily\bfseries,
}
}
\newcommand{\oddthumb}[1]{%
% see pgfmanual.pdf for more information about this part
\begin{tikzpicture}[remember picture, overlay]
    \node [thumb,text centered,anchor=north east,] at ($%
        (current page.north east)-%
        (0,\thumbtopmargin+\value{letternum}*\thumbheight)%
    $) {#1};                                              
\end{tikzpicture}                                          
}
\newcommand{\eventhumb}[1]{%
% see pgfmanual.pdf for more information about this part
\begin{tikzpicture}[remember picture, overlay]
    \node [thumb,text centered,anchor=north west,] at ($%
        (current page.north west)-%
        (0,\thumbtopmargin+\value{letternum}*\thumbheight)%
    $) {#1};
\end{tikzpicture}
}

% create a new command to set a new lettergroup
\newcommand{\lettergroup}[1]{%

\fancypagestyle{chapterstart}{%
\fancyhf{}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\chead{\oddthumb{#1}}% chapters start only on odd pages
\cfoot{\thepage}
}

%\renewcommand{\headrulewidth}{0pt}
%\fancyhead{}

\fancyhead[LO]{ \raisebox{1em}{ \fontfamily{phv}     \selectfont{\textbf{\rightmark}} } \oddthumb{#1}}%
\fancyhead[RE]{ \raisebox{1em}{ \fontfamily{phv}   \selectfont{\textbf{\leftmark}} } \eventhumb{#1}}


\fancyhead[LE]{{\fontfamily{phv}\selectfont{\textbf{\raisebox{1em}{\rightmark}}}}}


\fancyhead[CO,CE]{\color{darkgray} \raisebox{-2.1pt}[10pt][10pt]  {\leafright} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{~~~\decofourleft \decotwo \decofourright~~~} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{  \leafleft}}


\fancyhead[RO]{{\fontfamily{phv}\selectfont{\textbf{\raisebox{1em}{\leftmark}}}}}

 % step the counter of the letters
 \stepcounter{letternum}
 }
 %---------------------------------------------------------------------------------------------%







%---------------------------------------------------------------------------------------------%
\fancypagestyle{basicstyle}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhead[LE,RO]{\textbf{\chaptitle}}
\fancyhead[LO,RE]{\textbf{\thepage}}
\fancyfoot[LE,RO]{\thepage}}



\fancypagestyle{dictstyle}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0pt} 
\fancyhead{}

\fancyfoot[LO]{
\ornimpar \\ \hfill \textcolor{darkgray}{\large \leafNE ~~~   \raisebox{-0.35em}{\textsf{\textbf{\thepage}}} }  }

\fancyfoot[RE]{\ornpar   \\ \textcolor{darkgray}{\large  \raisebox{-0.35em}{\textsf{\textbf{\thepage}}} ~~~ \reflectbox{\leafNE}}  \hfill  }
}


\setlength{\columnsep}{20pt}
\setlength{\columnseprule}{0pt}
%---------------------------------------------------------------------------------------------%

\usepackage[bookmarks=true]{hyperref}







%\pagestyle{basicstyle}


%----------------------------------------------------------------------------------------------%

\begin{document}
%\maketitle
\begin{titlepage}
\centering\Huge   \adforn{26}\adforn{21}\quad\adforn{11}\quad\adforn{49}\adforn{54}

\vspace*{2em}\centering\bf  
\texttt{My Dictionary}\par

\vspace{2em}
{\hfill\centering \large{The Author}\hfill} 
\end{titlepage}

\newpage

%----------------------------------------------------------------------------------------------%


\pagestyle{dictstyle}%dictstyle
\lettergroup{A}
\dictchar{A}
% \hyperlink{A}{\dictchar{A}} 
\entry[headwords]{headwords}{translations}{\textsf{/yinfu/}}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\entry[philosophy]{philosophy} {Lorem ipsum dolor sit amet,  consectetuer
adipiscing elit. Ut purus elit, vestibulum ut, \emph{plac- erat ac}}  {/yinfu/}
\entry[Math]{Math}{Lorem ipsum dolor sit amet}{/yinfu/}
\entry[Physics]{Physics}{\lipsum[1-2]}{/yinfu/}
\entry[Nature]{Nature}{\lipsum}{/yinfu/}
\clearpage


\lettergroup{B}
\dictchar{B}
\entry[headwords]{headwords}{translations}{/yinfu/}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\clearpage

\lettergroup{C}
\dictchar{C}
\entry[headwords]{headwords}{translations}{/yinfu/}
\entry[headwords2]{headwords2}{translations2}{/yinfu/}
\clearpage
\end{document} 

The photo appears as follows:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.