lizzieinvancouver / ospree

Budbreak review paper database
3 stars 0 forks source link

Fix Latex issues in Supp #457

Open DeirdreLoughnan opened 1 year ago

DeirdreLoughnan commented 1 year ago

@lizzieinvancouver @MoralesCastilla I worked through the sweave file for the Supp and found several issues that are causing some of the warning messages to appear.

I have identified/fixed six of these, with comments noted with %DLMay11. But having not run the model, I only ran the text and figure chunks.

One section generating issues is the "[PMM{historical} -PMM{warming}]-[HMM{historical}-HMM{warming}]" on line 83. But I was not sure what this is supposed to be and could not fix it.

The main text also appears to be missing a correctly labeled table for tab:modelanglamb and only tableSupp3 is referenced in the text.]

I did not fix all the "Bad Box" errors, just the ones that prevent the pdf from compiling.

lizzieinvancouver commented 1 year ago

@DeirdreLoughnan Thank you for this! I fixed this:

One section generating issues is the "[PMM{historical} -PMM{warming}]-[HMM{historical}-HMM{warming}]" on line 83. But I was not sure what this is supposed to be and could not fix it.

Could you help with how to get the greek symbols for alpha, beta etc. into the model tables? Just info here on how you did it that we can follow would help. The current code, for example for table 1 is:

print(make.mytable1,
      floating=FALSE,
      size="footnotesize",
      hline.after=c(-1,0),
      caption.placement="top",
      include.rownames=FALSE,
      #tabular.environment = "longtable",
      #add.to.row=add.to.row
      )
lizzieinvancouver commented 1 year ago

@DeirdreLoughnan Wait! I now see (and understand a previous conversation better) that you did not actually include the Greek symbols properly in Sweave. You should! For reproducibility and also because you're missing the wonders of Sweave. I think if you followed Ailene's code she was probably writing stuff out for the journal (her old code for other manuscripts has all this).

You can (and should) do all this in Sweave. Please update synchrony someday and also do this for your new manuscripts. You can check out commit 2740a926c8e16d5ed82f0020c59bee60cf8e607c and see below ... in addition to this you need sanitize.text.function = function(x){x}in your print statement.

names(modellambest)[names(modellambest)=="X"] <- "Parameter"
lookupmodelnames <- c("a_z"="$\\mu_{\\alpha}$",
                      "b_zf"="$\\mu_{\\beta_{force}}$",
                      "b_zc"="$\\mu_{\\beta_{chill}}$",
                      "b_zp"="$\\mu_{\\beta_{photo}}$",
                      "lam_interceptsa"="$\\lambda_{\\alpha}$",
                      "lam_interceptsbf"="$\\lambda_{\\beta_{force}}$",
                      "lam_interceptsbc"="$\\lambda_{\\beta_{chill}}$",
                      "lam_interceptsbp"="$\\lambda_{\\beta_{photo}}$",
                      "sigma_interceptsa"="$\\sigma_{\\alpha}$",
                      "sigma_interceptsbf"="$\\sigma_{\\beta_{force}}$",
                      "sigma_interceptsbc"="$\\sigma_{\\beta_{chill}}$",
                      "sigma_interceptsbp"="$\\sigma_{\\beta_{photo}}$",
                      "sigma_y"="$\\sigma_y$")
modellambest$Parameter <- unname(lookupmodelnames[modellambest$Parameter])
names(modellambest)[names(modellambest)=="X2.5."] <- "2.5\\%"
names(modellambest)[names(modellambest)=="X50."] <- "50\\%"
names(modellambest)[names(modellambest)=="X97.5."] <- "97.5\\%"
names(modellambest)[names(modellambest)=="n_eff"] <- "$n_{eff}$"

@MoralesCastilla I fixed your first table in lots of ways, so please follow and fix all tables. You cannot use floating=FALSE see here for why.

I also fixed your cross-ref; I don't think that [supp] additional command was working.

lizzieinvancouver commented 1 year ago

@DeirdreLoughnan See also xtable gallery

lizzieinvancouver commented 1 year ago

@MoralesCastilla All your align commands are upsetting Sweave (in the supp -- maybe fix?), but it compiles.

lizzieinvancouver commented 1 year ago

But having not run the model, I only ran the text and figure chunks.

@DeirdreLoughnan Do you need to run the model? I think the supp file runs without it, so you may just need to add yourself to the else setwd at the start. But if you can show me I am wrong I can upload the model for you. Let me know!

DeirdreLoughnan commented 1 year ago

@lizzieinvancouver you are right, I was thinking more about the cross referencing between the supp and main text, I didn't think I could get the \Sexpr values to work without the model output. But it sounds like it was easy for you to fix the cross referencing issue.

Is there additional help you need with the tables? It appeared to me as though you had already updated the tables with the greek letters, but perhaps I am forgetting something else you asked me to help with.

lizzieinvancouver commented 1 year ago

Is there additional help you need with the tables? It appeared to me as though you had already updated the tables with the greek letters, but perhaps I am forgetting something else you asked me to help with.

@DeirdreLoughnan Thanks! I think I fixed most of the things today, but if you (or @AileneKane or @cchambe12 ) know how to add italics to species names in an xtable, let me know.