Skip to content

Commit d93d767

Browse files
committed
fixed a problem with figure sizing in paper-with-errors
1 parent 9cebd6d commit d93d767

16 files changed

+1017
-90
lines changed

NEWS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# rjtools 1.0.18
22

3-
Fix issues #132, 133, 134. Warnings instead of errors reported when potential problems with section headings and title given.
3+
Fix issues #129, 132, 133, 134. Warnings instead of errors reported when potential problems with section headings and title given.
44

55
# rjtools 1.0.17
66

inst/paper-with-errors/RJwrapper.aux

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
\relax
2+
\providecommand\hyper@newdestlabel[2]{}
3+
\providecommand\HyField@AuxAddToFields[1]{}
4+
\providecommand\HyField@AuxAddToCoFields[2]{}
5+
\bibstyle{abbrvnat}
6+
\citation{plotly}
7+
\citation{crosstalk}
8+
\citation{RJ-2021-050}
9+
\citation{palmerpenguins}
10+
\bibdata{RJreferences.bib}
11+
\@writefile{toc}{\contentsline {chapter}{\numberline {1}ToOoOlTiPs: An R package for Customizable Tooltips in Interactive Graphics}{1}{section*.1}\protected@file@percent }
12+
\@writefile{toc}{\contentsline {section}{\numberline {2.1}Introduction}{1}{section.2.1}\protected@file@percent }
13+
\newlabel{introduction}{{2.1}{1}{Introduction}{section.2.1}{}}
14+
\@writefile{toc}{\contentsline {section}{\numberline {2.2}Background}{1}{section.2.2}\protected@file@percent }
15+
\newlabel{background}{{2.2}{1}{Background}{section.2.2}{}}
16+
\@writefile{brf}{\backcite{plotly}{{1}{2.2}{section.2.2}}}
17+
\@writefile{brf}{\backcite{crosstalk}{{1}{2.2}{section.2.2}}}
18+
\@writefile{brf}{\backcite{RJ-2021-050}{{1}{2.2}{section.2.2}}}
19+
\@writefile{toc}{\contentsline {section}{\numberline {2.3}Customizing tooltip design with {\normalfont \fontseries {b}\selectfont ToOoOlTiPs}}{1}{section.2.3}\protected@file@percent }
20+
\newlabel{customizing-tooltip-design-with}{{2.3}{1}{\texorpdfstring {Customizing tooltip design with \pkg {ToOoOlTiPs}}{Customizing tooltip design with }}{section.2.3}{}}
21+
\@writefile{toc}{\contentsline {section}{\numberline {2.4}A gallery of tooltips examples}{1}{section.2.4}\protected@file@percent }
22+
\newlabel{a-gallery-of-tooltips-examples}{{2.4}{1}{A gallery of tooltips examples}{section.2.4}{}}
23+
\@writefile{brf}{\backcite{palmerpenguins}{{1}{2.4}{section.2.4}}}
24+
\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces A basic table}}{1}{table.caption.3}\protected@file@percent }
25+
\newlabel{tab:penguins-tab-static}{{1}{1}{A basic table}{table.caption.3}{}}
26+
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Artwork by \spacefactor \@m {}allison\_horst}}{2}{figure.caption.2}\protected@file@percent }
27+
\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
28+
\newlabel{fig:penguins-alison}{{1}{2}{Artwork by \@allison\_horst}{figure.caption.2}{}}
29+
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces A basic non-interactive plot made with the ggplot2 package on palmer penguin data. Three species of penguins are plotted with bill depth on the x-axis and bill length on the y-axis. Visit the online article to access the interactive version made with the plotly package.}}{2}{figure.caption.4}\protected@file@percent }
30+
\newlabel{fig:penguins-ggplot}{{2}{2}{A basic non-interactive plot made with the ggplot2 package on palmer penguin data. Three species of penguins are plotted with bill depth on the x-axis and bill length on the y-axis. Visit the online article to access the interactive version made with the plotly package}{figure.caption.4}{}}
31+
\bibcite{crosstalk}{{1}{2021}{{Cheng and Sievert}}{{}}}
32+
\bibcite{palmerpenguins}{{2}{2020}{{Horst et~al.}}{{Horst, Hill, and Gorman}}}
33+
\bibcite{plotly}{{3}{2020}{{Sievert}}{{}}}
34+
\bibcite{RJ-2021-050}{{4}{2021}{{Wang and Cook}}{{}}}
35+
\@writefile{toc}{\contentsline {section}{\numberline {2.5}Summary}{3}{section.2.5}\protected@file@percent }
36+
\newlabel{summary}{{2.5}{3}{Summary}{section.2.5}{}}
37+
\ttl@finishall
38+
\gdef \@abspage@last{3}

inst/paper-with-errors/RJwrapper.log

+847
Large diffs are not rendered by default.

inst/paper-with-errors/RJwrapper.out

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
\BOOKMARK [0][-]{section*.1}{\376\377\000T\000o\000O\000o\000O\000l\000T\000i\000P\000s\000:\000\040\000A\000n\000\040\000R\000\040\000p\000a\000c\000k\000a\000g\000e\000\040\000f\000o\000r\000\040\000C\000u\000s\000t\000o\000m\000i\000z\000a\000b\000l\000e\000\040\000T\000o\000o\000l\000t\000i\000p\000s\000\040\000i\000n\000\040\000I\000n\000t\000e\000r\000a\000c\000t\000i\000v\000e\000\040\000G\000r\000a\000p\000h\000i\000c\000s}{}% 1
2+
\BOOKMARK [1][-]{section.2.1}{\376\377\000I\000n\000t\000r\000o\000d\000u\000c\000t\000i\000o\000n}{section*.1}% 2
3+
\BOOKMARK [1][-]{section.2.2}{\376\377\000B\000a\000c\000k\000g\000r\000o\000u\000n\000d}{section*.1}% 3
4+
\BOOKMARK [1][-]{section.2.3}{\376\377\000C\000u\000s\000t\000o\000m\000i\000z\000i\000n\000g\000\040\000t\000o\000o\000l\000t\000i\000p\000\040\000d\000e\000s\000i\000g\000n\000\040\000w\000i\000t\000h\000\040}{section*.1}% 4
5+
\BOOKMARK [1][-]{section.2.4}{\376\377\000A\000\040\000g\000a\000l\000l\000e\000r\000y\000\040\000o\000f\000\040\000t\000o\000o\000l\000t\000i\000p\000s\000\040\000e\000x\000a\000m\000p\000l\000e\000s}{section*.1}% 5
6+
\BOOKMARK [1][-]{section.2.5}{\376\377\000S\000u\000m\000m\000a\000r\000y}{section*.1}% 6

inst/paper-with-errors/RJwrapper.synctex(busy)

Whitespace-only changes.

inst/paper-with-errors/RJwrapper.tex

+21-15
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,35 @@
1414

1515
% Always define CSL refs as bib entries are contained in separate doc
1616
% Pandoc citation processing
17+
%From Pandoc 3.1.8
18+
% definitions for citeproc citations
19+
\NewDocumentCommand\citeproctext{}{}
20+
\NewDocumentCommand\citeproc{mm}{%
21+
\begingroup\def\citeproctext{#2}\cite{#1}\endgroup}
22+
\makeatletter
23+
% allow citations to break across lines
24+
\let\@cite@ofmt\@firstofone
25+
% avoid brackets around text for \cite:
26+
\def\@biblabel#1{}
27+
\def\@cite#1#2{{#1\if@tempswa , #2\fi}}
28+
\makeatother
1729
\newlength{\cslhangindent}
1830
\setlength{\cslhangindent}{1.5em}
1931
\newlength{\csllabelwidth}
2032
\setlength{\csllabelwidth}{3em}
21-
\newlength{\cslentryspacingunit} % times entry-spacing
22-
\setlength{\cslentryspacingunit}{\parskip}
23-
% for Pandoc 2.8 to 2.10.1
24-
\newenvironment{cslreferences}%
25-
{}%
26-
{\par}
27-
% For Pandoc 2.11+
28-
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
29-
{% don't indent paragraphs
30-
\setlength{\parindent}{0pt}
33+
\newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing
34+
{\begin{list}{}{%
35+
\setlength{\itemindent}{0pt}
36+
\setlength{\leftmargin}{0pt}
37+
\setlength{\parsep}{0pt}
3138
% turn on hanging indent if param 1 is 1
3239
\ifodd #1
33-
\let\oldpar\par
34-
\def\par{\hangindent=\cslhangindent\oldpar}
40+
\setlength{\leftmargin}{\cslhangindent}
41+
\setlength{\itemindent}{-1\cslhangindent}
3542
\fi
3643
% set entry spacing
37-
\setlength{\parskip}{#2\cslentryspacingunit}
38-
}%
39-
{}
44+
\setlength{\itemsep}{#2\baselineskip}}}
45+
{\end{list}}
4046
\usepackage{calc}
4147
\newcommand{\CSLBlock}[1]{#1\hfill\break}
4248
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
597 Bytes
Binary file not shown.

inst/paper-with-errors/paper-with-errors.R

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ library(ggplot2)
88
library(palmerpenguins)
99

1010

11-
## ----penguins-alison, out.width = "100%", out.height = "30%", fig.cap = "Artwork by \\@allison\\_horst"----
12-
knitr::include_graphics("penguins.png")
11+
## ----penguins-alison, out.width = "100%", out.height = "30%", fig.cap = "Artwork by \\@allison\\_horst", fig.alt="A picture of three different penguins with their species: Chinstrap, Gentoo, and Adelie. "----
12+
knitr::include_graphics("figures/penguins.png")
1313

1414

1515
## ----penguins-tab-interactive, eval = knitr::is_html_output(), layout = "l-body-outset"----
16-
#> knitr::kable(head(penguins), format = "html", caption = "A basic table")
16+
# knitr::kable(head(penguins), format = "html", caption = "A basic table")
1717

1818

1919
## ----penguins-tab-static, eval = knitr::is_latex_output()---------------------
2020
knitr::kable(head(penguins), format = "latex", caption = "A basic table") %>%
2121
kableExtra::kable_styling(font_size = 7)
2222

2323

24-
## ----penguins-plotly, echo = TRUE, fig.height = 5, fig.cap="A basic interactive plot made with the plotly package on palmer penguin data. Three species of penguins are plotted with bill depth on the x-axis and bill length on the y-axis. When hovering on a point, a tooltip will show the exact value of the bill depth and length for that point, along with the species name.", include=knitr::is_html_output(), eval=knitr::is_html_output()----
25-
#> p <- penguins %>%
26-
#> ggplot(aes(x = bill_depth_mm, y = bill_length_mm,
27-
#> color = species)) +
28-
#> geom_point()
29-
#> ggplotly(p)
24+
## ----penguins-plotly, echo = TRUE, out.width="100%", fig.width = 6, fig.height=5, layout="l-body", fig.cap="A basic interactive plot made with the plotly package on palmer penguin data. Three species of penguins are plotted with bill depth on the x-axis and bill length on the y-axis. When hovering on a point, a tooltip will show the exact value of the bill depth and length for that point, along with the species name.", include=knitr::is_html_output(), eval=knitr::is_html_output()----
25+
# p <- penguins %>%
26+
# ggplot(aes(x = bill_depth_mm, y = bill_length_mm,
27+
# color = species)) +
28+
# geom_point()
29+
# ggplotly(p)
3030

3131

32-
## ----penguins-ggplot, echo = TRUE, fig.height = 5, fig.cap="A basic non-interactive plot made with the ggplot2 package on palmer penguin data. Three species of penguins are plotted with bill depth on the x-axis and bill length on the y-axis. Visit the online article to access the interactive version made with the plotly package.", include=knitr::is_latex_output(), eval=knitr::is_latex_output()----
32+
## ----penguins-ggplot, echo = TRUE, out.width="100%", fig.width = 6, fig.height=5, fig.cap="A basic non-interactive plot made with the ggplot2 package on palmer penguin data. Three species of penguins are plotted with bill depth on the x-axis and bill length on the y-axis. Visit the online article to access the interactive version made with the plotly package.", include=knitr::is_latex_output(), eval=knitr::is_latex_output()----
3333
penguins %>%
3434
ggplot(aes(x = bill_depth_mm, y = bill_length_mm,
3535
color = species)) +

inst/paper-with-errors/paper-with-errors.Rmd

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "ToOoOlTiPs: An R package for Customizable Tooltips in Interactive Graphics"
3+
date: "2022-11-09"
34
abstract: >
45
An abstract of less than 150 words.
56
draft: true
@@ -53,8 +54,8 @@ Some packages on interactive graphics include \CRANpkg{plotly} [@plotly] that in
5354

5455
The \CRANpkg{palmerpenguins} data [@palmerpenguins] features three penguin species which has a lovely illustration by Alison Horst in Figure \@ref(fig:penguins-alison).
5556

56-
```{r penguins-alison, out.width = "100%", out.height = "30%", fig.cap = "Artwork by \\@allison\\_horst"}
57-
knitr::include_graphics("penguins.png")
57+
```{r penguins-alison, out.width = "100%", out.height = "30%", fig.cap = "Artwork by \\@allison\\_horst", fig.alt="A picture of three different penguins with their species: Chinstrap, Gentoo, and Adelie. "}
58+
knitr::include_graphics("figures/penguins.png")
5859
```
5960

6061
Table `r knitr::asis_output(ifelse(knitr::is_html_output(), '\\@ref(tab:penguins-tab-interactive)', '\\@ref(tab:penguins-tab-static)'))` prints at the first five rows of the `penguins` data:
@@ -68,17 +69,17 @@ knitr::kable(head(penguins), format = "latex", caption = "A basic table") %>%
6869
kableExtra::kable_styling(font_size = 7)
6970
```
7071

71-
Figure `r knitr::asis_output(ifelse(knitr::is_html_output(), '\\@ref(fig:penguins-plotly)', '\\@ref(fig:penguins-ggplot)'))` shows an `r ifelse(knitr::is_html_output(), 'interactive', '')` plot of the penguins data, made using the `r knitr::asis_output(ifelse(knitr::is_html_output(), '\\CRANpkg{plotly}', '\\CRANpkg{ggplot2}'))` package.
72+
Figure `r knitr::asis_output(ifelse(knitr::is_html_output(), '\\@ref(fig:penguins-plotly)', '\\@ref(fig:penguins-ggplot)'))` shows a `r ifelse(knitr::is_html_output(), 'interactive', '')` plot of the penguins data, made using the `r knitr::asis_output(ifelse(knitr::is_html_output(), '\\CRANpkg{plotly}', '\\CRANpkg{ggplot2}'))` package.
7273

73-
```{r penguins-plotly, echo = TRUE, fig.height = 5, fig.cap="A basic interactive plot made with the plotly package on palmer penguin data. Three species of penguins are plotted with bill depth on the x-axis and bill length on the y-axis. When hovering on a point, a tooltip will show the exact value of the bill depth and length for that point, along with the species name.", include=knitr::is_html_output(), eval=knitr::is_html_output()}
74+
```{r penguins-plotly, echo = TRUE, out.width="100%", fig.width = 6, fig.height=5, layout="l-body", fig.cap="A basic interactive plot made with the plotly package on palmer penguin data. Three species of penguins are plotted with bill depth on the x-axis and bill length on the y-axis. When hovering on a point, a tooltip will show the exact value of the bill depth and length for that point, along with the species name.", include=knitr::is_html_output(), eval=knitr::is_html_output()}
7475
p <- penguins %>%
7576
ggplot(aes(x = bill_depth_mm, y = bill_length_mm,
7677
color = species)) +
7778
geom_point()
7879
ggplotly(p)
7980
```
8081

81-
```{r penguins-ggplot, echo = TRUE, fig.height = 5, fig.cap="A basic non-interactive plot made with the ggplot2 package on palmer penguin data. Three species of penguins are plotted with bill depth on the x-axis and bill length on the y-axis. Visit the online article to access the interactive version made with the plotly package.", include=knitr::is_latex_output(), eval=knitr::is_latex_output()}
82+
```{r penguins-ggplot, echo = TRUE, out.width="100%", fig.width = 6, fig.height=5, fig.cap="A basic non-interactive plot made with the ggplot2 package on palmer penguin data. Three species of penguins are plotted with bill depth on the x-axis and bill length on the y-axis. Visit the online article to access the interactive version made with the plotly package.", include=knitr::is_latex_output(), eval=knitr::is_latex_output()}
8283
penguins %>%
8384
ggplot(aes(x = bill_depth_mm, y = bill_length_mm,
8485
color = species)) +
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Version: 1.0
2+
ProjectId: cd16b644-7c97-4234-970a-7cb903236720
3+
4+
RestoreWorkspace: Default
5+
SaveWorkspace: Default
6+
AlwaysSaveHistory: Default
7+
8+
EnableCodeIndexing: Yes
9+
UseSpacesForTab: Yes
10+
NumSpacesForTab: 2
11+
Encoding: UTF-8
12+
13+
RnwWeave: Sweave
14+
LaTeX: pdfLaTeX
15+
16+
AutoAppendNewline: Yes
17+
StripTrailingWhitespace: Yes

0 commit comments

Comments
 (0)