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

Convert rendered equations into MS word #222

Open
deparser opened this issue Oct 25, 2024 · 1 comment
Open

Convert rendered equations into MS word #222

deparser opened this issue Oct 25, 2024 · 1 comment

Comments

@deparser
Copy link

I’m looking to convert Jupyter notebooks with calculations rendered by handcalcs into MS Word equations. So far, I’ve been following these steps:

  1. Display the math as MathML using MathJax.
  2. Copy and paste it into Notepad++ to strip formatting.
  3. Copy it again and paste it into Word.

However, I’m encountering some issues. The formatting, particularly the column indentation and text height (like varying font sizes in handcalcs-rendered equations), doesn’t transfer well. The result looks quite different from the original.

Has anyone else faced this issue, or found a more reliable process to maintain the formatting when converting equations?

The goal is to automate the conversion of the jupyter notebook to doc file.

@PascalGitz
Copy link

PascalGitz commented Oct 31, 2024

Hey, let me introduce you to Quarto. This is the perfect solution for this. Quarto translates Markdown into latex, html or word. After following the installation instructions you can create a jupyter notebook like so:

grafik
The first cell does all the formatting for the word export. You can also add a custom template (from your company for example). In this example i disabled the code input cells, so only the celloutput will be in the export.

For handcalcs, I did change the latex_block_start and end, that it follows the markdown syntax (you can also change this in your config file in your handcalcs installation).

The whole Notebook can then be exported to a .docx file, which looks like this:

grafik

Or with one button you can export the notebook to a pdf via latex, looking like this:

grafik

Greetings from another structural engineer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants