Skip to content

ZurichNLP/latex2html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

latex2html

The UZH latex corporate design is distributed with a latex2html script (by Andreas Säuberli). This repository includes additions to that script, implementing the following:

  • Heading hierarchy is fixed. Now only the title attribute is tagged as <h1>. With --shift-heading-level-by=1, pandoc translates latex as follows:

    • \title --> h1
    • \section --> h2
    • \subsection --> h3
    • \frametitle --> h4
    • \subsubsection --> h4
    • \framesubtitle h5

    The python script fix_headers.py removes any skipped levels (e.g. if no subsections were used) and automatically detects and numbers duplicate headings.

  • \bigbreak should be represented with <p>...</p> in the html. Solved: sed -e 's/\\bigbreak/\\par\n\n/g'

  • <em> causes problems. Removed <em> and <strong>. This removes semantic markup, which is an accessibility feature!

  • removed <span style="color: uzh@blue">. Mostly solved: sed command over html. requires --wrap=none setting in pandoc. fails when other html tag is nested in span.

  • replace $\rightarrow$. Solved: sed -e 's/\$\s*\\rightarrow\s*\$/→/g'

  • PDF images are converted to png before calling pandoc.

  • --citeproc flag includes bibliography in html

  • Videos are not present in html. Idea: Replace \movie with raw html. Has tendency to break other parts of the file.

Requirements

  • ImageMagick
  • Pandoc

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published