微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用LaTeX在学习英语语法中标记主题S和动词V

如何解决使用LaTeX在学习英语语法中标记主题S和动词V

任何人都可以帮忙。 如何在 LaTeX 的句子中标记英语语法符号? 例如。

  1. 日本是国家。 日本这个词上面的标签是名词,IS是动词

感谢您的帮助。

解决方法

尽管它们适用于文本模式,但我发现许多使用数学模式语法“作弊”的解决方案。所以这是我的“作弊”草图。我定义了两个 newcommand 以根据需要多次使用:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\isnoun}[1]{\ensuremath{\overset{\mathbf{N}}{\text{#1}}}}
\newcommand{\isverb}[1]{\ensuremath{\overset{\mathbf{V}}{\text{#1}}}}

\begin{document}
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\end{document}

记住标题中的 \usepackage{amsmath}。输出如下:

screenshot of output pdf


要为标签或文本添加颜色,您可以执行以下操作:

\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}}}}}

\begin{document}
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\isnoun{Japan} \isverb{is} a country. 
\end{document}

same with colors

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。