0

I want to add a Japanese character in front of a chapter. But it is showing an error, Latin alphabets and numbers work fine.

\documentclass{book}
\usepackage{CJKutf8} %for japanese characters

\begin{document}

\begingroup
\renewcommand\thechapter{\begin{CJK}{UTF8}{min} 
的 % character to appear before the chapter title
\end{CJK}}
\titleformat{\chapter}[display] %error here: Undefined control sequence.  Argument of 
                                             %\@xdblarg has an extra }.

{\normalfont\huge\bfseries}{}{20pt}{\Huge}
\chapter{Introduction}
\endgroup

\end{document}

The desired output that I want is

enter image description here

Also before this chapter, the following is shown, which I want to remove enter image description here

  • 1
    You seem to be using the titlesec package (for \titleformat) but this doesn't appear in your MWE. Furthermore, with this command you have explicitly said that you don't want your chapter names labelled. If you put \thechapter inside the empty pair of braces (before {20pt}) does that produce what you want? – Ant Dec 15 '22 at 22:31
  • @Ant this is what I followed https://tex.stackexchange.com/a/50949/284954 Also no, your suggestion doesn't work but thanks for the advice. – GedankenExperimentalist Dec 15 '22 at 23:01

1 Answers1

2

Keep it simple.

\documentclass{book}
\usepackage{CJKutf8} %for japanese characters

\usepackage{lipsum} % let's show the headers

\NewDocumentCommand{\nihonchars}{m}{\begin{CJK}{UTF8}{min}#1\end{CJK}}

\begin{document}

\tableofcontents

\chapter*{\nihonchars{的} Introduction} \markboth{\nihonchars{的} \MakeUppercase{Introduction}} {\nihonchars{的} \MakeUppercase{Introduction}} \addcontentsline{toc}{chapter}{\nihonchars{的} Introduction}

\lipsum

\end{document}

TOC

enter image description here

Chapter page

enter image description here

Header

enter image description here

egreg
  • 1,121,712
  • Extremely sorry for the confusion, I have updated the post please refer to it. – GedankenExperimentalist Dec 15 '22 at 22:56
  • @GedankenExperimentalist Is the new version what you want? – egreg Dec 15 '22 at 23:01
  • The chapter name in TOC and header is still showing "1 Introduction", is there any way to change it? – GedankenExperimentalist Dec 15 '22 at 23:06
  • 1
    @GedankenExperimentalist Would you please, in the future, specify all that you need? See the edited answer. – egreg Dec 15 '22 at 23:14
  • Yes, I will, thank you very much for putting up with me. I realize that it can be annoying to edit the answer again and again but I genuinely had no idea that headers and TOC won't be affected. But as you said, to prevent this I will declare clearly what I want. Thank you once again for being patient with me. – GedankenExperimentalist Dec 15 '22 at 23:20