Sebastian Walz 860d31cee1
Tohu vaBohu
2023-04-21 00:22:52 +02:00

14 lines
579 B
TeX

\directlua{includeCode("text/spelling")}
\newcommand{\loadDictionary}[1]{\directlua{spellChecker.loadDictionary([[#1]])}}
\def\@SpellCheckerFlag{false}
\def\enableSpellChecker{\def\@SpellCheckerFlag{true}}
\def\disableSpellChecker{\def\@SpellCheckerFlag{false}}
\newcommand{\spellCheck}[2][de/common]
{%
\ifthenelse{\equal{\@SpellCheckerFlag}{true}}%
{\expandafter\directlua{spellChecker.check([[#1]], [[\detokenize{#2}]])}}%
{#2}%
}
\newcommand{\correct}[1]{\ifthenelse{\equal{\@SpellCheckerFlag}{true}}{\PDFmarkupComment{Marked as Correct}{#1}{Correct}{green}}{#1}}