2열 페이지 레이아웃의 헤더 문제

2열 페이지 레이아웃의 헤더 문제

2열 페이지 레이아웃을 사용하여 사전을 디자인하고 싶은데, 페이지 헤더 형식을 지정할 때 예상치 못한 문제가 발생합니다. 헤더와 관련된 문제는 다음과 같습니다.

  1. 모든 왼쪽 열 페이지의 시작 부분에서 열 머리글을 제거하는 방법은 무엇입니까? 이미지는 다음과 같습니다:

여기에 이미지 설명을 입력하세요

  1. 짝수 페이지의 오른쪽 머리글과 홀수 페이지의 왼쪽 머리글을 더 높은 위치로 올리는 방법은 무엇입니까? 다음 사진을 참조하세요:

여기에 이미지 설명을 입력하세요

여기에 이미지 설명을 입력하세요

  1. 출력 PDF 문서에 책갈피를 추가하는 방법(모든 단어 그룹의 헤드 위치에서 , , 등의 모든 대문자로 전환)을 A추가 B하는 방법입니다 . C정확하게 말하면 Acrobat Adobe Pro를 통해 출력을 열었을 때 왼쪽에 있는 책갈피를 찾을 수 없었습니다. 이미 패키지를 로드했지만 hyperref작동하지 않았습니다.

최소 작업 예는 다음과 같습니다.

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

추신: My Tex는 @Fran이 제공한 두 가지 아름다운 예를 기반으로 합니다.여기

그리고 @chejnik님의 글입니다여기

어떤 제안이라도 감사드리며, 미리 감사드립니다.


다음 그림은 @Biki Teron 코드의 출력입니다.

여기에 이미지 설명을 입력하세요


이제 개선된 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}

여기에 이미지 설명을 입력하세요 여기에 이미지 설명을 입력하세요 여기에 이미지 설명을 입력하세요 여기에 이미지 설명을 입력하세요

Texmaker-4.1.1을 사용하여 Texlive-2017에서 편집했습니다.

여기에 이미지 설명을 입력하세요 여기에 이미지 설명을 입력하세요 여기에 이미지 설명을 입력하세요 여기에 이미지 설명을 입력하세요

답변2

코드를 조정하고 결국 헤더 형식 문제를 해결했습니다. 명령 renewcommand이나 내부 Tex 정의 로 전역 장식 머리 규칙을 정의하지 않으면 \makeatleter \define\headrule{...}\makeatother이 장식 머리 규칙은 왼쪽 열 머리글로 표시되지 않습니다. 이로써 두 번째 질문이 해결되었습니다. 반면에 명령을 사용하여 전체 페이지(두 개의 열 포함)의 왼쪽 머리글과 오른쪽 머리글을 올리거나 내리는 것을 제어할 수 있습니다 \raisebox{\leftmark or \rightmark}. 이로써 첫 번째 질문이 해결되었습니다. 내 개선된 Tex 코드는 다음과 같습니다.

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

사진은 다음과 같이 나타납니다.

여기에 이미지 설명을 입력하세요

관련 정보