Problem:
If there is no punctuation in the text, the Chinese words could be aligned perfectly vertically, however, if I add punctuation, somehow the punctuation will be mis-alighed, for example
Compiled with XeLatex, code:
%!TeX program = XeLaTeX
\documentclass{article}
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{Noto Sans CJK TC}
\usepackage[overlap,CJK]{ruby}
\usepackage{setspace}
\usepackage{geometry}
\usepackage{parskip}
% Margin Settings
\geometry{
a4paper,
total={170mm,257mm},
left=25mm,
right=25mm,
top=30mm,
bottom=20mm
}
% Chinese Pinyin Setttings
\renewcommand\rubysep{-3em}
\renewcommand{\CJKglue}{\hskip 14}
\renewcommand\rubysize{0.6}
\let\oldruby\ruby
\def\ruby#1#2{\oldruby{#1}{#2}\futurelet\next\addCJKglue}
\def\addCJKglue{\ifx\next\ruby \CJKglue \fi}
\newcommand{\myruby}[2]{\renewcommand\rubysep{-3em}{\chn\ruby{#1}{\textsf{#2}}}}
\newenvironment{chineseenvcustom}[2][2]
{
\begin{spacing}{#1}
\huge \justifying\renewcommand{\CJKglue}{\hskip #2}}
{\end{spacing}}
\begin{document}
\begin{chineseenvcustom}{12}
\ruby{彌}{Mí}\ruby{勒}{Lè}\ruby{世}{Shì}\ruby{尊}{Zūn}~\ruby{,}{}\ruby{既}{Jì}\ruby{慈}{Cí}\ruby{隆}{Lóng}\ruby{即}{Jí}\ruby{世}{Shì}~\ruby{,}{}\ruby{悲}{Bēi}\ruby{臻}{Zhēn}\ruby{後}{Hòu}\ruby{劫}{Jié}~\ruby{,}{}\ruby{依}{Yī}\ruby{事}{Shì}\ruby{題}{Tí}\ruby{名}{Míng}\ruby{弗}{Fú}\ruby{敢}{Gǎn}\ruby{移}{Yí}\ruby{易}{Yì}~\ruby{.}{}\ruby{承}{Chéng}\ruby{此}{Cǐ}\ruby{念}{Niàn}\ruby{力}{Lì}~\ruby{,}{}\ruby{欲}{Yù}\ruby{守}{Shǒu}\ruby{護}{Hù}\ruby{三}{Sān}\ruby{寶}{Bǎo}~\ruby{,}{}\ruby{令}{Lìng}\ruby{魔}{Mó}\ruby{隱}{Yǐn}\ruby{蔽}{Bì}~\ruby{.}{}\ruby{摧}{Cūi}\ruby{伏}{Fú}\ruby{自}{Zì}\ruby{大}{Dà}\ruby{增}{Zēng}\ruby{上}{Shàng}\ruby{慢}{Màn}\ruby{者}{Zhě}~\ruby{,}{}\ruby{未}{Wèi}\ruby{種}{Zhòng}\ruby{善}{Shàn}\ruby{根}{Gēn}\ruby{者}{Zhě}~\ruby{,}{}\ruby{今}{Jīn}\ruby{當}{Dāng}\ruby{令}{Lìng}\ruby{種}{Zhòng}~\ruby{.}{}\ruby{已}{Yǐ}\ruby{種}{Zhòng}\ruby{善}{Shàn}\ruby{根}{Gēn}\ruby{者}{Zhě}~\ruby{,}{}\ruby{今}{Jīn}\ruby{令}{Lìng}\ruby{增}{Zēng}\ruby{長}{Zhǎng}~\ruby{.}{}\ruby{若}{Ruò}\ruby{計}{Jì}\ruby{有}{Yǒu}\ruby{所}{Suǒ}\ruby{得}{Dé}~\ruby{,}{}\ruby{住}{Zhù}\ruby{諸}{Zhū}\ruby{見}{Jiàn}\ruby{者}{Zhě}~\ruby{,}{}\ruby{皆}{Jiē}\ruby{悉}{Xī}\ruby{令}{Lìng}\ruby{發}{Fā}\ruby{捨}{Shě}\ruby{離}{Lí}\ruby{之}{Zhī}\ruby{心}{Xīn}~\ruby{.}{}\ruby{樂}{Lè}\ruby{小}{Xiǎo}\ruby{法}{Fǎ}\ruby{者}{Zhě}~\ruby{,}{}\ruby{令}{Lìng}\ruby{不}{Bù}\ruby{疑}{Yí}\ruby{大}{Dà}\ruby{法}{Fǎ}~\ruby{.}{}\ruby{樂}{Lè}\ruby{大}{Dà}\ruby{法}{Fǎ}\ruby{者}{Zhě}~\ruby{,}{}\ruby{令}{Lìng}\ruby{生}{Shēng}\ruby{歡}{Huān}\ruby{喜}{Xǐ}~\ruby{.}{}
\end{chineseenvcustom}
\end{document}
Question:
Is it possible to let punctuation doesn't take space, for example, put it in the right corner of the previous character, therefore, the non-punctuation Chinese character could still get aligned.
Reference:
The same quesiton: Is there a punctuation mark that does not take up any space?. But since I am using rudy to add pinyin to the Chinese characters, the method suggested there is not working anymore.
Any help is appreciated, thank you in advance :)
