JMSLab / Template

Template for research repository using scons.
9 stars 1 forks source link

Fix to handout lyx sourcing #68

Closed rcalvo12 closed 1 year ago

rcalvo12 commented 1 year ago

In this issue we want to make a fix to the LyX builder handout functionality. The issue was first spotted in PolEc #7.

Right now the lyx handout functionality works by taking the original lyx script and making a copy of it that lives in the output folder of the first target. Then this copy is compiled into the handout which temporarily lives in the output folder of the first target. Then the copy is removed and the handout is moved to the proper output folder for the handout. An issue happens here when the lyx script refers to a relative file location, for example when an image is inserted. Because the original and copy of the lyx file are in different locations, if the source file can't be reached by the same relative path from both the original and copy locations - say because they are at different levels of the repo - then the copy won't be able to find the image sources and will break.

My proposed solution: make it so that the copy and the handout are produced in the location of the original lyx file so that the relative pathways will always lead to the same place. We will still remove the copy and move the handout at the end of the process.

@jmshapir if you have a different solution in mind, please let me know.

jmshapir commented 1 year ago

My proposed solution: make it so that the copy and the handout are produced in the location of the original lyx file so that the relative pathways will always lead to the same place. We will still remove the copy and move the handout at the end of the process.

@rcalvo12 the solution you propose sounds good to me. For an original file NAME.lyx, I'd propose to name the temporary files as NAME.handout.lyx and NAME.handout.pdf. That way, we can add *.handout.lyx and *.handout.pdf to the .gitignore and avoid accidental commits of the temporary files even if they aren't successfully removed from the location of NAME.lyx. What do you think?

jmshapir commented 1 year ago

@marcopetterson do you want to give this issue a try?

marcopetterson commented 1 year ago

@jmshapir sure! Happy to do it. I don't seem to be able to assign it to me though

jmshapir commented 1 year ago

Thanks @marcopetterson! I've assigned you here. At the moment you have only Read permissions on this repo but we can elevate when needed.

If you'd like to meet with @rcalvo12 @ew487 to discuss feel free to reach out to me via e-mail and I will connect you.

Thanks!

marcopetterson commented 1 year ago

@jmshapir could you elevate my permissions? I believe I am ready to open a PR for this issue.

Thank you!

jmshapir commented 1 year ago

@jmshapir could you elevate my permissions? I believe I am ready to open a PR for this issue.

Thank you!

Done! Use it wisely, thanks @marcopetterson!

jmshapir commented 1 year ago

@marcopetterson just checking if you wanted to open a pull here? Thanks!

marcopetterson commented 1 year ago

Thread continues here

marcopetterson commented 1 year ago

Summary: in this issue we fixed the handout lyx sourcing changing the location that handout files are temporarily stored before being moved to their final location