Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pdf-miner
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qin Kaijie
pdf-miner
Commits
e91d5929
Commit
e91d5929
authored
Apr 29, 2024
by
许瑞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update equation code
parent
564bdca2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
equations_replace.py
magic_pdf/pre_proc/equations_replace.py
+3
-3
No files found.
magic_pdf/pre_proc/equations_replace.py
View file @
e91d5929
...
@@ -191,13 +191,13 @@ def insert_interline_equations_textblock(interline_eq_bboxes, pymu_block_list):
...
@@ -191,13 +191,13 @@ def insert_interline_equations_textblock(interline_eq_bboxes, pymu_block_list):
"spans"
:
[
"spans"
:
[
{
{
"size"
:
9.962599754333496
,
"size"
:
9.962599754333496
,
"
_
type"
:
TYPE_INTERLINE_EQUATION
,
"type"
:
TYPE_INTERLINE_EQUATION
,
"flags"
:
4
,
"flags"
:
4
,
"font"
:
TYPE_INTERLINE_EQUATION
,
"font"
:
TYPE_INTERLINE_EQUATION
,
"color"
:
0
,
"color"
:
0
,
"ascender"
:
0.9409999847412109
,
"ascender"
:
0.9409999847412109
,
"descender"
:
-
0.3050000071525574
,
"descender"
:
-
0.3050000071525574
,
"
text"
:
f
"
\n
$$
\n
{latex_content}
\n
$$
\n
"
,
"
latex"
:
latex_content
,
"origin"
:
[
bbox
[
0
],
bbox
[
1
]],
"origin"
:
[
bbox
[
0
],
bbox
[
1
]],
"bbox"
:
bbox
,
"bbox"
:
bbox
,
}
}
...
@@ -320,7 +320,7 @@ def replace_line_v2(eqinfo, line):
...
@@ -320,7 +320,7 @@ def replace_line_v2(eqinfo, line):
"bbox"
:
eqinfo
[
"bbox"
]
"bbox"
:
eqinfo
[
"bbox"
]
}
}
# equation_span = line['spans'][0].copy()
# equation_span = line['spans'][0].copy()
equation_span
[
"latex"
]
=
f
" ${eqinfo['latex']}$ "
equation_span
[
"latex"
]
=
eqinfo
[
'latex'
]
equation_span
[
"bbox"
]
=
[
x0
,
equation_span
[
"bbox"
][
1
],
x1
,
equation_span
[
"bbox"
][
3
]]
equation_span
[
"bbox"
]
=
[
x0
,
equation_span
[
"bbox"
][
1
],
x1
,
equation_span
[
"bbox"
][
3
]]
equation_span
[
"origin"
]
=
[
equation_span
[
"bbox"
][
0
],
equation_span
[
"bbox"
][
1
]]
equation_span
[
"origin"
]
=
[
equation_span
[
"bbox"
][
0
],
equation_span
[
"bbox"
][
1
]]
equation_span
[
"chars"
]
=
delete_chars
equation_span
[
"chars"
]
=
delete_chars
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment