pbs-assess / csasdown

:book: An R package for creating CSAS reports in PDF or Word format with R Markdown and bookdown
Other
47 stars 17 forks source link

Minor style changes requested for tech-report.sty #71

Closed obradovichs closed 5 years ago

obradovichs commented 5 years ago

Would it be possible to make a few more minor style changes in the tech-report.sty file?

(1) SOLVED - First paragraph after a section title (e.g. # Introduction) has does not indent, while all follow paragraphs do and there is no space between paragraphs. May be same issue as references Issue #70 . I changed two lines in the tech-report.sty file and made a pull request. \setlength\parindent{0pt} % No indent paragraphs \parskip 2ex % Increase white space between paragraphs image

(2) SOLVED - The font on the title page is much larger relative to the main body text than in the TTT workshop technical report. Below is a title page generated with csasdown tech-report.sty next to the TTT workshop technical report with the same magnification. Updated \LARGE and \Large to \Large and \large in the tech-report.sty file. image

(3) CLOSED : Landscape tables - the function works well, but is it possible to have a page with landscape tables orient as landscape in the final pdf? Additionally it would then be nice for the page number to at the bottom of the table instead of on the left side of the table, but not really an issue. I understand now why this has not been done. image

(4)SOLVED - Figures section creates a blank page before first figure. This may be specific to our .Rmd files Our first figure is .png that is stored in a folder in the repository. Added fig.pos="h" to the chunk header for the first figure only. image

andrew-edwards commented 5 years ago

@obradovichs - Regarding the other issue about references not being in the desired order in the Reference list [which we thought we fixed here: https://github.com/pbs-assess/csas-style/issues/4 but maybe that got lost along the way?].

I see that bookdown does not create a .bbl file (for the bibliography), but puts all the references into the .tex file. So what you can do for your final version is re-order the references manually in the .tex file, then run (from a shell) pdflatex filename which will build the .pdf from the .tex (not from the .Rmd).

This works for me in a simple non-csasdown example, and should for csasdown. Note that if you run csasdown again it will overwrite your edits as it recreates the .tex file, so only do this on your very final version for submission.

obradovichs commented 5 years ago

@andrew-edwards - Thanks for the suggestion! I had a look at the edits in the .bst file, but it looks like quite different to the .csl, so I think I will need to dig into the language to understand.

Regarding using a shell, I only have .tinytex to use with RMarkdown/csasdown. I tried using Rstudio (and the compilepdf button), but it has a lot of calls to folders in the local git repo. I think it could be done, but would take some editing to get everything pointing to the right file locations for the figures, logos etc.

andrew-edwards commented 5 years ago

No, you should be able to run pdflatex (or some latex compiler) on the .tex file somehow - everything will be pointing to the right places (as the .tex file is built from the .Rmd files, and is what is used to build the .pdf). But only worry about this if someone insists on it for the Tech Report...

seananderson commented 5 years ago

If you want to hand edit the .tex file, you will need to move it up a level out of the index folder.

After any hand editing, with tinytex, in R:

tinytex::latexmk("techreport.tex")

csasdown/bookdown does not use BibTeX style files. It uses .csl files. These are the same as used by Zotero or Mendeley. We are using the CJFAS one with a couple minor tweaks. There might be a way to get that reference ordering to match the CSAS specifications, but it's not obvious to me on a quick reading of the documentation.

I could probably get csasdown to work with BibTeX style files but then it would never work with Word output.

I wouldn't worry about it until somebody from CSAS complains.

andrew-edwards commented 5 years ago

Thanks Sean, good to know how to run the .tex. (And I get now that the bib sty file we created a while back isn't now used since it's .csl - the one we had was Sean's original CJFAS one from way back that I found and then modified and Sean tweaked later).

Good news - I just checked with someone here and she doesn't think that CSAS is that fussy now about the rule about multi-author reference ordering (they were a few years ago). For Tech Reports I expect they're even less fussy (it's not CSAS) so I suggest we say we tried coding the rules but it's fiddly, and no-one should really care. Maybe Shannon can update here regarding Tech Report, and we can see what happens about Res Docs.

cgrandin commented 5 years ago

I have been using tinytex::pdflatex() for testing tex files. Is there a particular reason we should be using tinytex::latexmk()?

If you want to hand edit the .tex file, you will need to move it up a level out of the index folder.

After any hand editing, with tinytex, in R:

tinytex::latexmk("techreport.tex")

csasdown/bookdown does not use BibTeX style files. It uses .csl files. These are the same as used by Zotero or Mendeley. We are using the CJFAS one with a couple minor tweaks. There might be a way to get that reference ordering to match the CSAS specifications, but it's not obvious to me on a quick reading of the documentation.

I could probably get csasdown to work with BibTeX style files but then it would never work with Word output.

I wouldn't worry about it until somebody from CSAS complains.

seananderson commented 5 years ago

tinytex::pdflatex() runs pdflatex once. tinytex::latexmk() runs pdflatex and bibtex as many times as needed for everything to compile. It's short for "latex make". https://mg.readthedocs.io/latexmk.html

obradovichs commented 5 years ago

Would it be possible for someone to add code to the tech-report.sty file to set the size of the subsubheadings? Currently they appear larger than the section headings and subheading. I think it would be a quick patch. Currently the section and subsections are set as \small.

Lines 172/173 of the .sty file set the font size. I tried to set the font size with the third line, but this broke the code. \sectionfont{\small\centering\noindent} % Section formatting \subsectionfont{\small\raggedright\noindent} % Subsection formatting %\subsubsectionfont{\small\raggedright\noident} %Subsubsection formatting

seananderson commented 5 years ago

Fixed here https://github.com/pbs-assess/csasdown/commit/651f2b0999d9e6505617ecac2a7fbb2b7d9293d8