allofphysicsgraph / proofofconcept

Physics Derivation Graph: mathematical connections among equations
https://derivationmap.net/
Other
20 stars 6 forks source link

unable to create PDF for SUVAT derivation #249

Closed bhpayne closed 2 years ago

bhpayne commented 2 years ago

A PDF can be generated for https://derivationmap.net/review_derivation/000001 but not for https://derivationmap.net/review_derivation/332170/

Entries in ~/proofofconcept/v7_pickle_web_interface/flask/logs/flask_critical_and_error_and_warning.log are not too helpful

2022-02-21 13:49:15,934|compute.py   |ERROR|3519|generate_pdf_for_derivation|no PDF generated - reason unknown
2022-02-21 13:49:15,936|controller.py|ERROR|3326|review_derivation   |no PDF generated - reason unknown

The error message is coming from https://github.com/allofphysicsgraph/proofofconcept/blob/gh-pages/v7_pickle_web_interface/flask/compute.py#L3520 which indicates that latex -halt-on-error ran and produced the message "No pages of output.".

The corresponding .tex file can be generated -- https://derivationmap.net/static/332170.tex

bhpayne commented 2 years ago

Ran docker-compose locally using docker-compose up --build --remove-orphans and then entered the container environment using docker exec -it CONTAINER_ID /bin/bash

Generated the .tex and saved to disk in a location accessible to the container

Inside the container, ran latex -halt-on-error 332170 and got

! Missing $ inserted.
<inserted text> 
                $
l.145 https://en.wikipedia.org/wiki/Equations_
                                              of_motion
No pages of output.
Transcript written on 332170.log.

That indicates the cause is writing the "notes" field of a derivation directly to .tex; see https://github.com/allofphysicsgraph/proofofconcept/blob/gh-pages/v7_pickle_web_interface/flask/compute.py#L3386

bhpayne commented 2 years ago

Fixing derivation notes that have underscore is tricky because some strings are valid Latex and others are not.

bhpayne commented 2 years ago

Fixed!