mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
fixup convert_lineno (#13036)
This routine assumed \linenumbers to be preceded by \usepackage{lineno} and that by a lyx2lyx comment. Of course, this is not the case if users loaded lineno manually.
This commit is contained in:
parent
ae423757e9
commit
b00ea51166
@ -1915,12 +1915,13 @@ def convert_lineno(document):
|
||||
use_lineno = 0
|
||||
options = ""
|
||||
i = find_token(document.preamble, "\\linenumbers", 1)
|
||||
if i > -1:
|
||||
if i > 0:
|
||||
usepkg = re.match(r"\\usepackage(.*){lineno}", document.preamble[i-1])
|
||||
if usepkg:
|
||||
use_lineno = 1
|
||||
options = usepkg.group(1).strip("[]")
|
||||
del(document.preamble[i-1:i+1])
|
||||
if i > 1:
|
||||
del_token(document.preamble, "% Added by lyx2lyx", i-2, i-1)
|
||||
|
||||
k = find_token(document.header, "\\index ")
|
||||
|
Loading…
Reference in New Issue
Block a user