metrumresearchgroup / pmtables

TeX tables for pharmacometrics.
https://metrumresearchgroup.github.io/pmt-book
11 stars 1 forks source link

Optionally print project path in table notes annotation #341

Closed kylebaron closed 3 months ago

kylebaron commented 3 months ago

Summary

Current default

Currently, we can take in the output file name and that gets included in a table note. However, the decision about where to save that file is deferred until we actually call stable_save().

The changes to pmtables include accepting the output file path when we create the table. Now, if the user passes the output path and it is included in the table annotation, we have to respect that information when saving; it can't be changed after the annotation is created.

Implementation detail

Currently, it is the tab_notes() function that handles all the arguments for R source file, output file, output directory etc. But this is a but of a misnomer now, because the function doing more than just writing a note and saving the file name for later; real decisions about output file locations are being made.

I have added a non-exported function tab_files() that handles all the file / path manipulation and arguments that get passed to tab_notes() eventually go to tab_files(). In the future, I will open up tab_files() since that more accurately reflects where the file / path proecessing is taking place.

source-path.pdf

kyleam commented 3 months ago

I'll interactively test this a bit, but this is looking good to me aside from my minor comments above.

kylebaron commented 3 months ago

Thanks, @kyleam ; working on the typos now.