2

Please see the writing template I just set up:

\documentclass[UTF8,a4paper]{ctexart}
\usepackage[top=.9in, bottom=.8in, left=.8in, right=.8in]{geometry}
\usepackage[colorlinks,bookmarks=true,CJKbookmarks=true,bookmarksnumbered=true,unicode=true,linkcolor=black,anchorcolor=blue,citecolor=blue,urlcolor=blue]{hyperref}

\usepackage{fancyhdr}
\pagestyle{plain}
\rhead{Some confidential materials}
\lhead{Version 0.1}
\title{The title the title the title}
\author{First Name}
\date{}


\begin{document}
\maketitle
\thispagestyle{fancy}
\newpage
\tableofcontents
\newpage
\section{第一章}
\subsection{第一节}
\newpage
\bibliographystyle{ieeetr}%unsrt
\bibliography{reference}

\end{document}

And the code works good and the result is shown as follows,

enter image description here

But what I am trying to achieve, are:

  1. Add some text blocks shown in the position, (text color is black of course);
  2. The page counting starts after ToC.

Because I am writing in Chinese, so the document class crepart best fits me. Can anyone give me some instructions and help what kind of package I can use? Thanks!

enter image description here

2 Answers 2

1

I wasn't able to build the ctexart class locally, and I had trouble with your chinese characters. However, I feel confident that the following should work:

  1. Add some text blocks shown in the position, (text color is black of course);
\tableofcontents
\vfil%
\hfil TEXT\hfil\makebox[0.5\textwidth]{\hrulefill}\hfil\par
\hfil TEXT\hfil\makebox[0.5\textwidth]{\hrulefill}\hfil
  1. The page counting starts after ToC.

Use \setcounter{page}{1} to reset the page counter and use \pagenumbering{gobble} to turn off the page number, and then \pagenumbering{arabic} for turning it back on:

Resulting code

\documentclass[UTF8,a4paper]{ctexart}
\usepackage{fancyhdr}
\pagestyle{plain}
\rhead{Some confidential materials}
\lhead{Version 0.1}
\title{The title the title the title}
\author{First Name}
\date{}


\begin{document}
% Turn off pagenumbering
\pagenumbering{gobble}
\maketitle
\thispagestyle{fancy}
\newpage
    \tableofcontents
    \vfil%
    \hfil TEXT\hfil\makebox[0.5\textwidth]{\hrulefill}\hfil\par
    \hfil TEXT\hfil\makebox[0.5\textwidth]{\hrulefill}\hfil
\newpage
% Set page number to 1
\setcounter{page}{1}
% Turn on page numbering
\pagenumbering{arabic}
\section{first}
\subsection{second}
\newpage
\section{third}
\bibliographystyle{ieeetr}%unsrt
\bibliography{reference}

\end{document}
1

You should use differently \pagestyle and also issue \pagenumbering{arabic} when you want to start the numbering of pages. I also added the recommended bookmark package. Note the change to \headheight, required by fancyhdr.

Since you are using hyperref, I added \pagenumbering{alph} for the front matter, so to keep hyperref happy and not issue duplicate target errors.

\documentclass[
  a4paper,
  UTF8,
]{ctexart}

\usepackage[
  top=.9in,
  bottom=.8in,
  left=.8in,
  right=.8in
]{geometry}

\usepackage{fancyhdr}

\usepackage[
  colorlinks,
  bookmarks=true,
  CJKbookmarks=true,
  bookmarksnumbered=true,
  unicode=true,
  linkcolor=black,
  anchorcolor=blue,
  citecolor=blue,
  urlcolor=blue
]{hyperref}
\usepackage{bookmark}

\fancypagestyle{first}{%
  \fancyhf{}% clear all fields
  \fancyhead[R]{Some confidential materials}%
  \fancyhead[L]{Version 0.1}%
}
\fancyhf{}
\fancyfoot[C]{\thepage}

\setlength{\headheight}{13pt} % to keep fancyhdr happy

\title{The title the title the title}
\author{First Name}
\date{}

\begin{document}
\pagenumbering{alph} % to keep hyperref happy
\maketitle
\thispagestyle{first}
\clearpage

\pagestyle{empty}

\tableofcontents
\clearpage

\pagenumbering{arabic}
\pagestyle{plain}

\section{北京}
\subsection{北京}
\clearpage

\bibliographystyle{ieeetr}%unsrt
\bibliography{reference}

\end{document}

Production notes. For producing the images I passed a6paper to geometry just to reduce the image size. I also added fontset=windows or I got font errors. Finally, your input produced errors, so I changed it with the Chinese for Beijing.

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.