pylatexenc icon indicating copy to clipboard operation
pylatexenc copied to clipboard

pylatexenc import latexpp NCArgsParser doesn't work

Open zhanghaiyu0511 opened this issue 2 years ago • 1 comments

with open("data/tes.tex") as tex_file: latex = tex_file.read() l2t_context_db = latexwalker.get_default_latex_context_db()

l2t_context_db.set_unknown_macro_spec(MacroSpec("newcommand", NCArgsParser("newcommand"))) output = LatexNodes2Text().latex_to_text(latex, latex_context=l2t_context_db) print(output)

zhanghaiyu0511 avatar Apr 19 '23 04:04 zhanghaiyu0511

Could you provide more context please? As far as I remember, the NCArgsParser from latexpp is not designed to be used outside of latexpp. It also needs to be rewritten because of some design issues.

phfaist avatar Apr 28 '23 09:04 phfaist