Skip to content

pypandoc trials #5

@clairedavid

Description

@clairedavid

Installing locally

In terminal:
pip install pypandoc

In a script, wrote:

from pypandoc.pandoc_download import download_pandoc
download_pandoc()

Testing script:

import pypandoc
test1 = "The leading particle physics laboratory in Europe and home to the ProtoDUNEs. (In French, the Organisation Europ\'{e}enne pour la Recherche Nucl\'{e}aire, derived from Conseil Europ\'{e}en      pour la Recherche Nucl\'{e}aire)"

test2 = "The High Efficiency Particulate Air filters are a type of air filter that remove \num{99.97}\% of particles that have a size greater than or equal to \SI{0.3}{$\mu$m}"

output1 = pypandoc.convert_text(test1, 
                                to='html5',
                                format='latex')
print("\n - - - - - - - \n")
print(test1)
print("\n HTML = ")
print(output1)

output2 = pypandoc.convert_text(test2, 
                                to='html5',
                                format='latex')
print("\n - - - - - - - \n")
print(test2)
print("\n HTML = ")
print(output2)```

## Results:
```The leading particle physics laboratory in Europe and home to the ProtoDUNEs. (In French, the Organisation Europ'{e}enne pour la Recherche Nucl'{e}aire, derived from Conseil Europ'{e}en      pour la Recherche Nucl'{e}aire)

 HTML = 
<p>The leading particle physics laboratory in Europe and home to the ProtoDUNEs. (In French, the Organisation Europ’<span>e</span>enne pour la Recherche Nucl’<span>e</span>aire, derived from Conseil Europ’<span>e</span>en pour la Recherche Nucl’<span>e</span>aire)</p>
 - - - - - - - 

The High Efficiency Particulate Air filters are a type of air filter that remove 
um{99.97}\% of particles that have a size greater than or equal to \SI{0.3}{$\mu$m}

 HTML = 
<p>The High Efficiency Particulate Air filters are a type of air filter that remove um<span>99.97</span>% of particles that have a size greater than or equal to 0.3 <span class="math inline"><em>μ</em></span>m</p>```

## Issues
 - [ ] Escaped characters ```\n``` not showing 
 - [ ] Accents not replaced by HTML unicode
 - [ ] Greek letters replaced properly (but in italic) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions