如何添加句子格式(逗号、句号和加号)

如何添加句子格式(逗号、句号和加号)

问候 我想在以下乳胶代码中添加句子格式逗号、句号和加号:

\documentclass{article}
\usepackage{amsmath}
\usepackage{xcolor}

\definecolor{color1}{RGB}{219, 48, 122}
\definecolor{color2}{RGB}{48, 122, 219}
\newcommand{\isnoun}[1]{\ensuremath{\overset{{\color{color1}\mathbf{N}}}{\text{#1}}}}
\newcommand{\isverb}[1]{\ensuremath{\overset{\mathbf{V}}{{\color{color2}\text{#1}}}}}
% new command comma, plus sign and period
\newcommand{\iscomma}[1].......
\newcommand{\isplusign}[1]..............
\newcommand{\isperiod}[1]................
\begin{document}
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 

\end{document}

再次感谢您的帮助。

答案1

如果我理解正确的话,像这样带注释的版本甚至会选取第二个示例的非标准设置。

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath}
\usepackage{xcolor}

\definecolor{color1}{RGB}{219, 48, 122}
\definecolor{color2}{RGB}{48, 122, 219}
\definecolor{color3}{RGB}{200,0,0}
\newcommand{\isnoun}[1]{\ensuremath{\overset{\makebox[0pt]{\scriptsize\color{color1}\textbf{N}}}{\strut\text{#1}}}}
\newcommand{\isverb}[1]{\ensuremath{\overset{\makebox[0pt]{\scriptsize\color{color2}\textbf{V}}}{\strut\text{#1}}}}
% new command comma, plus sign and period
\newcommand{\iscomma}[1]{\ensuremath{\overset{\makebox[0pt]{\scriptsize\color{color3}\textbf{P}}}{\strut\text{#1}}}\spacefactor\sfcode`#1 }
\let\isplusign\iscomma
\let\isperiod\iscomma

\begin{document}


Japan is a country, France is a country.
Japan is a country, France is a country.
Japan is a country, France is a country.
Japan is a country, France is a country.


\isnoun{Japan} \isverb{is} a country\iscomma{,} \isnoun{France} \isverb{is} a country\isperiod{.} 
\isnoun{Japan} \isverb{is} a country\iscomma{,} \isnoun{France} \isverb{is} a country\isperiod{.} 
\isnoun{Japan} \isverb{is} a country\iscomma{,} \isnoun{France} \isverb{is} a country\isperiod{.} 
\isnoun{Japan} \isverb{is} a country\iscomma{,} \isnoun{France} \isverb{is} a country\isperiod{.} 


\bigskip
% big sentence space
\spaceskip=1em plus .5em minus .2em 
\xspaceskip=2em  plus 1em minus .1em

Japan is a country, France is a country.
Japan is a country, France is a country.
Japan is a country, France is a country.
Japan is a country, France is a country.

\isnoun{Japan} \isverb{is} a country\iscomma{,} \isnoun{France} \isverb{is} a country\isperiod{.} 
\isnoun{Japan} \isverb{is} a country\iscomma{,} \isnoun{France} \isverb{is} a country\isperiod{.} 
\isnoun{Japan} \isverb{is} a country\iscomma{,} \isnoun{France} \isverb{is} a country\isperiod{.} 
\isnoun{Japan} \isverb{is} a country\iscomma{,} \isnoun{France} \isverb{is} a country\isperiod{.} 

\end{document}

相关内容