From 0357ce82e74c1413df06cab248dc2ab8b39ad9b9 Mon Sep 17 00:00:00 2001 From: Matthias Baumann Date: Sat, 21 Nov 2020 17:38:51 +0100 Subject: [PATCH] Closes #124 --- HISTORY.md | 6 ++++-- list-of-macros.md | 2 ++ tests/test_packages/test_latex_builtins.py | 2 ++ yalafi/parameters.py | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index cfa54d07..d5d6e289 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,8 +3,10 @@ Work in progress - LaTeX macros / environments - package babel: added environments otherlanguage\(\*\) (issue [#114](../../issues/114)) - - builtins: fixed \\usepackage, now accepts multiple package names - (issue [#121](../../issues/121)) + - builtins + - fixed \\usepackage, now accepts multiple package names + (issue [#121](../../issues/121)) + - added macros \\LaTeX, \\TeX (issue [#124](../../issues/124)) - yalafi.shell - added support for multi-language documents (issue [#98](../../issues/98)) - new options --multi-language, --ml-continue-threshold, --ml-rule-threshold, diff --git a/list-of-macros.md b/list-of-macros.md index 747cd607..0b134742 100644 --- a/list-of-macros.md +++ b/list-of-macros.md @@ -67,6 +67,7 @@ tests: [tests/test\_packages/test\_latex\_builtins.py](tests/test_packages/test_ \\L, \\l, \\label, +\\LaTeX, \\LTadd, \\LTalter, \\LTinput (executes code in file), @@ -93,6 +94,7 @@ tests: [tests/test\_packages/test\_latex\_builtins.py](tests/test_packages/test_ \\ss, \\subsection, \\subsubsection, +\\TeX, \\textasciicircum, \\textasciitilde, \\textbackslash, diff --git a/tests/test_packages/test_latex_builtins.py b/tests/test_packages/test_latex_builtins.py index aa49cc53..2d66053f 100644 --- a/tests/test_packages/test_latex_builtins.py +++ b/tests/test_packages/test_latex_builtins.py @@ -30,6 +30,7 @@ def get_plain(latex): (r'\L', 'Ł'), (r'\l', 'ł'), (r'A\label{l}B', 'AB'), + (r'A\LaTeX B', 'ALaTeXB'), (r'A\newline B', 'A B'), (r'\O', 'Ø'), (r'\o', 'ø'), @@ -44,6 +45,7 @@ def get_plain(latex): (r'\ref{l}', '0'), (r'\S', '§'), (r'\ss', 'ß'), + (r'A\TeX B', 'ATeXB'), (r'\textasciicircum', '^'), (r'\textasciitilde', '~'), (r'\textbackslash', '\\'), diff --git a/yalafi/parameters.py b/yalafi/parameters.py index 4b899ca1..562227e4 100644 --- a/yalafi/parameters.py +++ b/yalafi/parameters.py @@ -49,6 +49,7 @@ def init_macros(self): \newcommand{\L}{Ł} \newcommand{\l}{ł} \newcommand{\label}[1]{} + \newcommand{\LaTeX}{LaTeX} \newcommand{\newline}{ } \newcommand{\O}{Ø} \newcommand{\o}{ø} @@ -65,6 +66,7 @@ def init_macros(self): \newcommand{\ref}[1]{0} \newcommand{\S}{§} \newcommand{\ss}{ß} + \newcommand{\TeX}{TeX} \newcommand{\textasciicircum}{\verb?^?} % \^ is accent \newcommand{\textasciitilde}{\verb?~?} % \~ is accent \newcommand{\textbackslash}{\verb?\?} % \\ is line break