Skip to content

Regex pattern for newlabel in aux files is too general #67

Open
kthoden opened this issue Jul 9, 2021 · 0 comments
Open

Regex pattern for newlabel in aux files is too general #67

kthoden opened this issue Jul 9, 2021 · 0 comments

Comments

@kthoden
Copy link

kthoden commented Jul 9, 2021

Current pattern is

auxpattern = re.compile("\\\\newlabel\{(?P<label>.*?)\}\{\{(?P<num1>.*?)\}\{(?P<pagenumber>.*?)\}\{(?P<sectionname>.*?)\}\{(?P<another>.*?)\}\{(?P<whatever>.*?)\}\}")

which works ok with

\newlabel{sec1.2}{{1.1.2}{7}{The authors and their works}{section*.3}{}}

but yields wrong results with

\newlabel{facsim001}{{\caption@xref {facsim001}{ on input line 1}}{43}{Bibliography}{figure.caption.30}{}}

because of extra data in the second field. Maybe the pagenumber pattern could be made more specific, but would need to include (probably roman page numbers, as well, and what about blank pages?). Needs to be tested.

Sign in to join this conversation on GitHub.
Labels
None yet
Development

No branches or pull requests

1 participant