LaTeX forum ⇒ Theses, Books, Title pagesHow to add Chinese characters in header of Masters/Doctoral Thesis format?

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Nafees
Posts: 3
Joined: Thu May 23, 2019 6:05 pm

How to add Chinese characters in header of Masters/Doctoral Thesis format?

Postby Nafees » Thu May 23, 2019 8:19 pm

Hey! I am using the MasterDoctrolThesis.cls format to write my thesis. This format shows the chapter name and heading of the current page in the header. I want to add Chinese specific character on each page of my thesis. The code of MasterDoctrolThesis.cls for a header is:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \providepairofpagestyles[thesisSimple]{thesis}{%
  2. \automark*[section]{}%
  3. }
  4. \providepairofpagestyles[thesisSimple]{review}{%
  5. \ofoot[\shorttitle/\authorname]{\shorttitle/\authorname}
  6. \ifoot[\today]{\today}
  7. }
  8. \pagestyle{thesis}
  9. \ifbool{headsepline}{\KOMAoption{headsepline}{true}}{}
  10. \PreventPackageFromLoading[\ClassError{\classname}{Package `fancyhdr' is
  11. incompatible\MessageBreak with this class}{The pagesyles are defined
  12. using package `scrlayer-scrpage', please consult the\MessageBreak
  13. KOMA-script documentation for details.}]{fancyhdr}
  14.  
  15.  
  16. \newcommand{\blank@p@gestyle}{empty}
  17. \newcommand{\chapter@p@gestyle}{plain}
  18. \NewDocumentCommand{\blankpagestyle}{ m }{%
  19. \ClassWarning{\classname}{\string\blankpagestyle\space is
  20. obsolete,\MessageBreak use \string\setblankpagestyle \space instead}\renewcommand{\blank@p@gestyle}{}{#1}
  21. }
  22. \NewDocumentCommand{\setblankpagestyle}{ m }{\renewcommand{\blank@p@gestyle}{#1}}
  23. \NewDocumentCommand{\setchapterpagestyle}{ m }{\renewcommand{\chapter@p@gestyle}{#1}}
  24.  
  25. \DeclareDocumentCommand\cleardoublepage{}{\clearpage\if@twoside \ifodd\c@page\else
  26. \hbox{}
  27. \thispagestyle{\blank@p@gestyle}
  28. \newpage
  29. \if@twocolumn\hbox{}\newpage\fi\fi\fi%
  30. }


I need to add the following characters given in the picture in my header:

Header.png
Header.png (38.34 KiB) Viewed 555 times

and need to put just red line with the page number footer like showing in the below given picture

Footer.png
Footer.png (21.75 KiB) Viewed 555 times

For this the following code I have used, but it could not work:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \pagestyle{fancy} % all pages will follow same fancy header and footer style except title page
  2. \fancyhf{} % Clear header and footer
  3. \fancyhead[C]
  4. {\begin{CJK*}{UTF8}{gkai}
  5. \fontsize{20}{20} \textbf{\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}} \end{CJK*}}
  6. \fancyfoot[C]{\thepage}
  7. \renewcommand{\headrulewidth}{0.7pt} % Line at the header visible

How should I do this? Please help me out to this problem?

User avatar
Johannes_B
Site Moderator
Posts: 4071
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu May 23, 2019 8:29 pm

Crosspost on TeX.sx
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Nafees
Posts: 3
Joined: Thu May 23, 2019 6:05 pm

Postby Nafees » Thu May 23, 2019 8:41 pm

Johannes_B wrote:Crosspost on TeX.sx

Please give me the solution, I am very bad stuck

User avatar
Johannes_B
Site Moderator
Posts: 4071
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat May 25, 2019 7:32 am

Copied from TeX.SX:

Add footsepline to the global options.
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. headsepline, % Uncomment to get a line under the header
  2. footsepline,% <-------
  3. %chapterinoneline, % Uncomment to place the chapter title next to the number on one line
  4. %consistentlayout, % Uncomment to change the layout of the declaration, abstract and acknowledgements pages to match the default layout
  5. ]{MastersDoctoralThesis} % The class file specifying the document structure
  6.  
  7. %\usepackage[utf8]{inputenc} % Required for inputting international characters
  8. %\usepackage[T1]{fontenc} % Output font encoding for international characters
  9.  
  10. %\usepackage{mathpazo} % Use the Palatino font by default
  11. \usepackage{fontspec}
  12. \setmainfont{Noto Serif CJK}
  13. \clearpairofpagestyles
  14. \cfoot*{\pagemark}
  15. \chead{\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}\hspace{0.5cm}院}
  16. \setkomafont{pagehead}{\normalfont\bfseries}
  17. \addtokomafont{pageheadfoot}{\color{red!80!black}}

On my very old installation, LuaTeX refuses to find the bold font weights. I won't did deeper into this, as the issue is most likely gone with a fresh installation of TeX Live, or the solution for TL17 would be obsolete.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 2 guests