pfmc-assessments / sa4ss

Generate a stock assessment document from Stock Synthesis output
https://pfmc-assessments.github.io/sa4ss/
Other
12 stars 7 forks source link

Adding PDF to main assessment document #29

Closed shcaba closed 1 year ago

shcaba commented 3 years ago

I was attempting to add an appendix that is already in PDF format. I came across the package pdfpages and command \usepackage{pdfpages} that is suppose to go in the preamble that would then alert markdown to insert the pdf via this command (which I put in the 54appnedix.Rmd file): \includepdf[pages={-}]{PDFname.pdf} where PDFname would be the name of the PDF you want to insert.

I included the PDF file and the unzipped CTAN package pdfpages in the write-up folder.

I have little idea what I am actually doing, so I get this error: ! Undefined control sequence. It points to the includepdf line.

My guess is that I need to unzip the package (which I could use guidance on) or that this approach just doesn't work for what I am doing. Any suggestions on how I would actually insert a PDF into my assessment document are very welcome!

chantelwetzel-noaa commented 3 years ago

This is a great question that I have not put effort into figuring out yet. If this is the CA management pdf, Brian and I are providing it as associated material rather than an appendix due to these challenges. Also, we should check to see if the management changes document is the same for all our species and only provide it once as accompanying material.

shcaba commented 3 years ago

It is totally that document (that I also currently have as a separate document as y'all), but I was hoping to surprise you and Brian by ingeniously figuring out how to include it into the document. Fail. I thought this would be easy, and maybe is only a step away from working (unzipping the package and putting it where it needs to be?), but I also thought, given we are using the same document for the CA species, we should just have it someplace once.

If we could figure this out it seems a good way, in general, to include other documents produced by partners that would be time consuming to replicate in markdown.

And for GitHub posterity-- congrats on Liverpool making CL.

kellijohnson-NOAA commented 3 years ago

You can use tinytex to install the package, e.g.,

tinytex::tlmgr_install(pkgs="pdfpages")

but packages should also be automatically installed when building the document if they are not already present.

But, the problem with inserting a already compiled pdf is there is no way to "tag" the document for 508 compliance and if it is already tagged, I have no idea how it will conflict with our existing workflow. I think that I would like to support bringing in pdf images but not pdf documents. Instead, I think this is where the Council should be storing them and giving us a permanent link, that way it is up to them to make sure that the document is compliant and always available.

shcaba commented 3 years ago

Thanks Kelli. I'll move ahead with making documents like this separate attachments to the main document.