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

Tex software #3

Closed kellijohnson-NOAA closed 3 years ago

kellijohnson-NOAA commented 3 years ago

Miktex vs. tinytex and I am sure there are others out there. The latter installs packages on the fly, where the former has a setting that must be changed to allow packages to be updated / installed on the fly. NOAA computers are a pain with respect to permissions and this leads to drama when trying to install things on the fly. The readme page and or a helper function should be installed such that users know things will break because they don't have the proper LaTex installation. Thanks @chantelwetzel-noaa for bringing this issue to my attention. More information to come later.

iantaylor-NOAA commented 3 years ago

I get that bringing everyone over to tinytex could be hard, but I have found it much easier to deal with than MikTeX and have been able to get everything installed without admin privileges. It seems that making the switch is all-or-nothing in that having parallel tex installations on the computer caused a lot of problems for me at first.

chantelwetzel-noaa commented 3 years ago

@iantaylor-NOAA tinytex has actually changed the error thrown when there were other tex installations to just a warning. It appears that when there are parallel versions of tex installed if the user is rendering their file from R it will default to tinytex and ignore other installations. I have been testing this on my machine that had MikTeX installed and have had success using tinytex. However, getting this to work I have to successfully install tinytex which was a two-step process that had to be done by hand. The process was easy but was not automatically done with installing the sa4ss package (install.packages('tinytex') and tinytex::install_tinytex() ). We will need to evaluate if this process can be forced to automate when the package is first installed (e.g. check for correct tinytex installation and if not installed complete this process) or if the installation steps for the package should have the user do these steps separately.

iantaylor-NOAA commented 3 years ago

Thanks for the information @chantelwetzel-noaa, and welcome to the happy world of tinytex. I think it's totally reasonable to require everyone using this package to go through the 2-step tinytex install manually.

I just learned that require() returns (invisibly) a logical indicating whether the required package is available, so it's possible to add a command like

if (!require(tinytex)) { 
  stop("install tinytex and run tinytex::install_tinytex()") 
}

However, I don't know if there's an easy way to check for whether tinytex::install_tinytex() was run successfully.

kellijohnson-NOAA commented 3 years ago

I think we want to be careful of things like require() and library() that load / install packages within other functions. Supposedly, bookdown has tinytex as a dependency and it should be installed because bookdown is a dependency here. I will look into why that broke for Chantel. Maybe because there was an installation of MikTex?

melissamonk-NOAA commented 3 years ago

I am 100% also behind everyone switching to tinytex and recommend it be installed directly from GitHub. I've found it can often take a little tinkering to install, but have managed to be successful and much easier than dealing with admin privileges to install packages via MiKTeX, especially for those venturing into markdown and tex for the first time.

kellijohnson-NOAA commented 3 years ago

The package will ONLY WORK WITH TINYTEX or TexLive, which is what tinytex installs. MikTeX doesn't have the necessary packages that are used to create 508 compliance right now. The readme is updated to try to provide users with this guidance prior to failing. @melissamonk-NOAA please feel free to update the tinytex section of the readme if you feel more guidance is needed. If you think it is sufficient can you please close this issue.

Note, I did not put a stop or warning message in the sa4ss package if tinytex isn't installed b/c I thought the information in the readme was sufficient. Please feel free to comment if you feel otherwise or submit a pull request with a proposed change.

melissamonk-NOAA commented 3 years ago

@kellijohnson-NOAA please close #3 (I don't have permissions to do so)