Skip to content
This repository was archived by the owner on Feb 5, 2021. It is now read-only.

Commit 13868db

Browse files
authored
Release 1.2.0
1 parent 3ca1963 commit 13868db

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tex2txt.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,9 @@ def text_get_num(text):
633633
# - if no space in front of first unescaped %:
634634
# join current and next lines (except after \\ alias \newline)
635635
#
636-
text = mysub(r'^(([^\n\\%]|\\.)*[^ \t\n\\%])(?<!\\newline)%.*\n',
637-
r'\1', text, flags=re.M)
638-
# r'(?<!x)y' matches 'y' not preceded by 'x'
639-
# the previous replacement does not join lines on '\%%'
640-
# --> re-try
641-
text = mysub(r'^(([^\n\\%]|\\.)*\\%)%.*\n', r'\1', text, flags=re.M)
636+
text = mysub(r'^(([^\n\\%]|\\.)*(?<![ \t\n\\]))(?<!\\newline)%.*\n',
637+
r'\1', text, flags=re.M)
638+
# r'(?<!x)y' matches 'y' not preceded by 'x'
642639

643640
# - "normal case": just remove rest of line, keeping the line break
644641
#
@@ -812,7 +809,7 @@ def f(m):
812809
Z in caseU.
813810
"""
814811

815-
# 1. split equation environment into 'lines' delimited by \\
812+
# 1. split equation environment into 'lines' delimited by \\ alias \newline
816813
# 2. split each 'line' into 'sections' delimited by &
817814
# 3. split each 'section' into math and \text parts
818815
#

0 commit comments

Comments
 (0)