1. rbeezer
  2. tex2sws


rbeezer  committed 533213b

Make data directory explicit for graphics, CSS files

  • Participants
  • Parent commits eac47d3
  • Branches default

Comments (0)

Files changed (1)

File tex2sws.py

View file
         for e in tree.getElementsByTagName('object'):
             if e.hasAttribute('data'):
+                new_data = os.path.basename(e.getAttribute('data'))
+                new_data = os.path.join('data', new_data)
+                e.setAttribute('data', new_data)
         # Mirror above to grab "regular" graphicx \includegraphics
         for e in tree.getElementsByTagName('img'):
             if e.hasAttribute('src'):
                 new_src = os.path.basename(e.getAttribute('src'))
+                new_src = os.path.join('data', new_src)
                 e.setAttribute('src', new_src)
         # Find and modify links in place
         # We first link in the CSS information from the data directory
         # The CSS file should be in with the graphics files, so doesn't need a path,
         # We add it to the data directory along with all the graphics files
-        content.append( r'<link type="text/css" rel="stylesheet" href="' + css_name + r'" />' )
+        content.append( r'<link type="text/css" rel="stylesheet" href="data/' + css_name + r'" />' )
         # Recognize cells, adorn compute cells