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

narrow the margins #104

Closed iantaylor-NOAA closed 1 year ago

iantaylor-NOAA commented 1 year ago

Problem

Jim Hastie made this reasonable suggestion:

Sorry, I meant to pass along a comment earlier that I made to Jason about formatting. I inquired about his document margins, and he indicated that Kelli's default was about 1.75". That not only drags out the text but can have undesirable impacts on table and figure formatting. My suggestion would be to use something like 1-1.25", if you have time to do that without working this weekend or on the 4th. Hope you all are able to have enjoyable weekends!

Proposal

The 00a.Rmd created by sa4ss::draft() includes geometry: margin=1in but that appears to be ignored or overridden by some other LaTeX package. Changing the margin settings on that line didn't make a difference. If anyone knows how to get margin settings working, adding that to the package and/or existing documents could be helpful for fitting some of our larger tables, making our figures slightly bigger and reducing the overall length of the reports.

kellijohnson-NOAA commented 1 year ago

I don't recommend doing this but you could edit sa4ss.sty to include a margin call

\geometry{letterpaper,
   textwidth=14cm,
   margin=1.0in,
   top=2.54cm, bottom=2.54cm,
   includehead, includefoot,
   centering,
   footskip=1.5cm}

I don't encourage users editing this file. I would rather change it in the package and have everyone replace this file with the newest version.

iantaylor-NOAA commented 1 year ago

That short-term worked for me (seems like I had to render it twice for it to stick), but I will happily switch to a package-focused solution.

I edited sa4ss.sty to add

\usepackage{xcolor}
\usepackage{colortbl}

which were needed (maybe just the second one) to allow striping and bold rows in tables. If there's a better place to add those lines, or if these should be added to the package, let me know.

    kableExtra::kable_styling(latex_options = c("striped")) %>%
    kableExtra::row_spec(1, bold = TRUE)

image

brianlangseth-NOAA commented 1 year ago

@kellijohnson-NOAA When implementing the page margin solution within our sa4ss.sty file we get the following warning

"Package geometry warning: Over specification in h-direction...."

When I remove the margin = 1.0in line this warning goes away

The document still compiles, and does not appear to have issues, however it makes me a little worried something is cut off somewhere. Do you know how we can resolve while still keeping the 1in margin so as to be similar to other documents? If that solution is ignore it, because it doesn't affect anything, Im ok with that.

kellijohnson-NOAA commented 1 year ago

Repeating a portion of the commit message here

Warning: Package geometry Warning: Over-specification in `h'-direction.
Warning:     `width' (398.33858pt) is ignored.

because the geometry package is hierarchical where the new input of margin conflicted with the old input of overall textwidth so it was ignoring textwidth.

Solution

Just remove the textwidth argument in favor of margin.