Search In This Website

Jumat, 04 Juli 2025

Typing Chinese Pinyin ( Accent Character ) In Latex

Exercise

  • Create a Latex document that formats like the text shown in below to type accent character ( chinese pinyin ).
  • You must use UTF-8 encoding file!
  • Add the required documentclass on the Latex source code below. Configure the default for all document to 12 pt. click this link to get the hint https://beldnlat147.blogspot.com/2024/02/latex-preamble-font-size.html. Of course you can search the other way to clear the exercise.
  • Add necessary line break for each line.
  • Save the Latex document as typingChinesePinyin.tex
  • Add gkai font to CJK environment ( Simplified Chinese Character )
  • Add bkai font to CJK environment ( Traditional Chinese Character )
WǒYāo
FùQián
我要
ㄨㄛˇ ㄧㄠˋ ㄈㄨˋ ㄑㄧㄢˊ
WǒYāoChūQián
出錢
ㄨㄛˇ ㄧㄠˋ ㄔㄨ ㄑㄧㄢˊ
WǒYāoFùKuǎn

ㄨㄛˇ ㄧㄠˋ ㄈㄨˋ ㄎㄨㄢˇ
Zhè Me Shòu Rén Jìng Yǎng Ne ?
這麼受人敬仰呢?
ㄓㄜˋㄇㄜ˙ ㄕㄡˋ ㄖㄣˊ ㄐㄧㄥˋ ㄧㄤˇ ㄋㄜ˙ ?

Type this following latex code in Latex editor:
% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8
\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage{CJKutf8} % Required for input Chinese Japanese Korean characters

%% Combining or Modifier Grave Accent
\DeclareUnicodeCharacter{0300}{\hspace{-1ex}\`{ }}

%% Combining or Modifier Acute Accent
\DeclareUnicodeCharacter{0301}{\hspace{-1ex}\'{ }}

%% Combining or Modifier Macron Accent (a bar over the letter)
\DeclareUnicodeCharacter{0304}{\hspace{-1ex}\={ }}

%% Combining or Modifier Caron Accent (háček ("v") over the letter)
\DeclareUnicodeCharacter{030C}{\hspace{-1ex}\v{ }}

%% Combining Dot Above Accent (dot over the letter for zhuyin or BoPoMoFo)
\DeclareUnicodeCharacter{0307}{\hspace{-1ex}\.{ }}

\begin{document}
\noindent
WǒYāoFùQián  \\
\begin{CJK*}{UTF8}{gbsn} % Simplified Chinese Character
我要付钱
ㄨㄛˇ ㄧㄠˋ ㄈㄨˋ ㄑㄧㄢˊ
\end{CJK*}\\
WǒYāoChūQián\\
\begin{CJK*}{UTF8}{bsmi} % Traditional Chinese Character
我要出錢
ㄨㄛˇ ㄧㄠˋ ㄔㄨ ㄑㄧㄢˊ
\end{CJK*}
WǒYāoFùKuǎn\\
\begin{CJK*}{UTF8}{bsmi}
我要付款
ㄨㄛˇ ㄧㄠˋ ㄈㄨˋ ㄎㄨㄢˇ
\end{CJK*}\\
\begin{CJK*}{UTF8}{bsmi} % Traditional Chinese Character
Zhè Me Shòu Rén Jìng Yǎng Ne ?
這麼受人敬仰呢?
ㄓㄜˋㄇㄜ˙ ㄕㄡˋ ㄖㄣˊ ㄐㄧㄥˋ ㄧㄤˇ ㄋㄜ˙ ?
\end{CJK*}\\
\end{document}



Bibliography

https://en.wikibooks.org/
https://illinois.edu/ ( university )
https://www.chineseclass101.com/
https://www.cmu.edu/ ( university )
https://www.nyu.edu/ ( university )
https://yorku.ca/ ( university )

Related Post

Tidak ada komentar:

Posting Komentar