mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Fix a couple of issues with macros and previews
* Fix typo causing to only account for the first char of a macro name * Also check for macros as arguments of other macros
This commit is contained in:
parent
46aed6d2b9
commit
98a5072a58
@ -160,7 +160,7 @@ def extract_metrics_info(dvipng_stdout):
|
||||
|
||||
def fix_latex_file(latex_file, pdf_output):
|
||||
documentclass_re = re.compile("(\\\\documentclass\[)(1[012]pt,?)(.+)")
|
||||
def_re = re.compile(r"(\\newcommandx|\\global\\long\\def)(\\[a-zA-Z])(.+)")
|
||||
def_re = re.compile(r"(\\newcommandx|\\global\\long\\def)(\\[a-zA-Z]+)(.+)")
|
||||
usepackage_re = re.compile("\\\\usepackage")
|
||||
userpreamble_re = re.compile("User specified LaTeX commands")
|
||||
enduserpreamble_re = re.compile("\\\\makeatother")
|
||||
|
@ -647,6 +647,10 @@ void InsetMathHull::usedMacros(MathData const & md, DocIterator const & pos,
|
||||
if (macros.find(name) == end)
|
||||
continue;
|
||||
macros.erase(name);
|
||||
// Look for macros in the arguments of this macro.
|
||||
for (idx_type idx = 0; idx < mi->nargs(); ++idx)
|
||||
usedMacros(mi->cell(idx), pos, macros, defs);
|
||||
// Look for macros in the definition of this macro.
|
||||
MathData ar(pos.buffer());
|
||||
MacroData const * data =
|
||||
pos.buffer()->getMacro(name, pos, true);
|
||||
|
Loading…
Reference in New Issue
Block a user