Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for indented lists; support older versions of dvisvgm #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion readme2tex/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def extract_equations(content):
for line, string in enumerate(lines):
cummulative += len(string) + 1
if dollar < cummulative: break
if lines[line].startswith(' '):
if lines[line].startswith(' ') and not re.match(r'^ *(?:-|[\d]+\.) ', lines[line]):
cursor = dollar + 2
continue
if len(content) > dollar and content[dollar + 1] == '$':
Expand Down Expand Up @@ -177,9 +177,13 @@ def render(
xml = (ET.fromstring(svg))
attributes = xml.attrib
gfill = xml.find('{https://www.w3.org/2000/svg}g')
if not gfill:
gfill = xml.find('{http://www.w3.org/2000/svg}g')
gfill.set('fill-opacity', '0.9')
if not block:
uses = gfill.findall('{https://www.w3.org/2000/svg}use')
if not uses:
uses = gfill.findall('{http://www.w3.org/2000/svg}use')
use = uses[0]
# compute baseline off of this dummy element
x = use.attrib['x']
Expand Down