Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"LaTeX errors when creating PDF version." #96

Closed
ampurr opened this issue Jun 16, 2023 · 12 comments
Closed

"LaTeX errors when creating PDF version." #96

ampurr opened this issue Jun 16, 2023 · 12 comments

Comments

@ampurr
Copy link
Collaborator

ampurr commented Jun 16, 2023

I'm not sure this is a big deal, but Toby encouraged me to throw it up here. When I run build.sh, 00check.log tells me there's an error.

The Log

* using log directory 'C:/Users/nice/try/fbi/animint2.Rcheck'
* using R version 4.3.0 (2023-04-21 ucrt)
* using platform: x86_64-w64-mingw32 (64-bit)
* R was compiled by
    gcc.exe (GCC) 12.2.0
    GNU Fortran (GCC) 12.2.0
* running under: Windows 11 x64 (build 22621)
* using session charset: UTF-8
* using option '--as-cran'
* checking for file 'animint2/DESCRIPTION' ... OK
* this is package 'animint2' version '2023.6.11'
* package encoding: UTF-8
* checking CRAN incoming feasibility ... [15s] WARNING
Maintainer: 'Toby Hocking <toby.hocking@r-project.org>'

Insufficient package version (submitted: 2023.6.11, existing: 2023.6.11)

Days since last update: 2
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'animint2' can be installed ... [23s] OK
* checking installed package size ... OK
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking startup messages can be suppressed ... OK
* checking use of S3 registration ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... [20s] OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of 'data' directory ... OK
* checking data for non-ASCII characters ... OK
* checking LazyData ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking examples ... [53s] OK
* checking examples with --run-donttest ... [106s] OK
* checking for unstated dependencies in 'tests' ... OK
* checking tests ... [55s] OK
  Running 'namespace.R'
  Running 'testthat.R' [53s]
* checking PDF version of manual ... WARNING
LaTeX errors when creating PDF version.
This typically indicates Rd problems.
* checking PDF version of manual without index ... ERROR
Re-running with no redirection of stdout/stderr.
* checking HTML version of manual ... NOTE
Skipping checking HTML validation: no command 'tidy' found
* checking for non-standard things in the check directory ... NOTE
Found the following files/directories:
  'animint2-manual.tex'
* checking for detritus in the temp directory ... OK
* DONE
Status: 1 ERROR, 2 WARNINGs, 2 NOTEs

The Problem & Possible Causes

The log starts registering warnings and an error near the bottom:

LaTeX errors when creating PDF version.
This typically indicates Rd problems.

I doubt there really are Rd problems, since no one else gets this message. (For example: Toby doesn't.) Furthermore, I can manually compile animint2-manual.tex, and it looks like the CRAN reference manual.

It's probably not Windows, either, since Toby doesn't get the same error on Windows.

My current guess is that it's caused in part by mingw or my LaTeX installation. But I haven't thought especially hard or long about this. I'm not even sure this is a problem, since CRAN will be creating the PDF, not me. But here it is.

@tdhock
Copy link
Collaborator

tdhock commented Jun 16, 2023

sounds like something missing on your system, did you try a web search for that exact message? Do you get the same when checking other packages?

@ampurr
Copy link
Collaborator Author

ampurr commented Jun 17, 2023

Do you get the same when checking other packages?

That's a good question (and implicit debugging suggestion). I hadn't checked other packages before writing the issue. So I grabbed the rmini package and checked it. 0 errors, 0 warnings, and 0 notes.

As far as I can tell, this check used the same mingw and LaTeX installations as my animint2 check. So:

  1. If the LaTeX errors were caused by my mingw or LaTeX installations, then the same LaTeX errors would have appeared in my rmini check.
  2. It is not the case that the same LaTeX errors appeared in my rmini check.
  3. Therefore, the LaTeX errors were not caused by my mingw or LaTeX installations, and my hypotheses were wrong.

sounds like something missing on your system,

I appreciate that hypothesis. I thought about it but it doesn't seem right. Lemme know if this syllogism seems sound to you:

  1. If something is missing on my system, then the same LaTeX errors would have appeared in both my animint2 and rmini checks.
  2. It is not the case that the same LaTeX errors appeared in both my animint2 and rmini checks.
  3. Therefore, it is not the case that something is missing on my system.

If the syllogism is correct, then I need a hypothesis that accounts for the different results between the animint2 and rmini checks. One possible hypothesis: there's something wrong or different with the animint2 repository. But then why hasn't this bug appeared on anyone else's computer?

did you try a web search for that exact message?

Oo, good implicit suggestion. I hadn't done a web search either, which is obviously the first thing I should've done and is 100% my bad. When I first encountered these errors, I must've been caught up trying to fix the fortify bugs or something.

I found a Stack Overflow question about it and skimmed through it. The top answer suggests that there's something wrong with the LaTeX code itself, which suggests that there's something wrong with the .Rd files, which suggests that there's something wrong with our R files.

I also took a look at R Packages. The appendix of the book has this:

Checking PDF version of manual. Occasionally you’ll get an error when building the PDF manual. This is usually because the pdf is built by latex and you’ve forgotten to escape something. Debugging this is painful - your best bet is to look up the latex logs and combined tex file and work back from there to .Rd files then back to a roxygen comment. Any such failure is potentially a bug in roxygen2, so open an issue.

So maybe I should troll through our R files and see if I can spot any problems with the roxygen comments. But, again: if that really is the case, then why is this only showing up for me? It's awfully confusing. Maybe there is something missing on my system after all... But then why is the rmini check fine?

I'll try to figure it out, but if you have any thoughts I'd super appreciate them. (No rush, of course. Please enjoy your weekend.) Right now it just feels like there's a massive contradiction between multiple reasonable syllogisms, all of which are consistent with the data. Makes my head hurt.

@tdhock
Copy link
Collaborator

tdhock commented Jun 19, 2023

it looks like you are on windows. Are you using rtools? https://cran.r-project.org/bin/windows/base/howto-R-4.3.html says MikTeX (with basic packages and inconsolata) is needed to build package vignettes and documentation.

@ampurr
Copy link
Collaborator Author

ampurr commented Jun 19, 2023

Thanks for the suggestion and for the link, which I haven't seen before. I am using rtools, but I'm using TinyTeX instead MikTeX. I'll download Inconsolata and see if that works. If that doesn't, I'll download MikTeX and try again. :>

This is really exposing the many gaps in my knowledge. I don't know why something like MikTeX would work while TinyTeX doesn't.

@ampurr
Copy link
Collaborator Author

ampurr commented Jun 19, 2023

You don't have to read this. I'm just including this for my future self, in case it's useful in the future.

In EndeavorOS, both rmini and animint2 produce bugs when checked, but the bugs are different than the bugs in Windows:

rmini Log

* using log directory ‘/home/no/peeping/nsa/rmini.Rcheck’
* using R version 4.3.1 (2023-06-16)
* using platform: x86_64-pc-linux-gnu (64-bit)
* R was compiled by
    gcc (GCC) 13.1.1 20230429
    GNU Fortran (GCC) 13.1.1 20230429
* running under: EndeavourOS
* using session charset: UTF-8
* using options ‘--no-manual --as-cran’
* checking for file ‘rmini/DESCRIPTION’ ... OK
* this is package ‘rmini’ version ‘0.0.4’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking serialization versions ... OK
* checking whether package ‘rmini’ can be installed ... WARNING
Found the following significant warnings:
  init.c:11:13: warning: type of ‘rmini_reverse’ does not match original declaration [-Wlto-type-mismatch]
See ‘/home/chen/Documents/Git Repos/rmini.Rcheck/00install.out’ for details.
* used C compiler: ‘gcc (GCC) 13.1.1 20230429’
* checking installed package size ... OK
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking pragmas in C/C++ headers and code ... OK
* checking compilation flags used ... NOTE
Compilation used the following non-portable flag(s):
  ‘-Werror=format-security’ ‘-Wformat’ ‘-Wp,-D_FORTIFY_SOURCE=2’
  ‘-march=x86-64’
* checking compiled code ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... [1s/21s] OK
Examples with CPU (user + system) or elapsed time > 5s
          user system elapsed
rock_fun 0.058  0.031  20.128
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ... OK
  Running ‘test-split.R’
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking re-building of vignette outputs ... OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE
Status: 1 WARNING, 1 NOTE

animint2 Log

* using log directory ‘/home/cia/torture/bad/animint2.Rcheck’
* using R version 4.3.1 (2023-06-16)
* using platform: x86_64-pc-linux-gnu (64-bit)
* R was compiled by
    gcc (GCC) 13.1.1 20230429
    GNU Fortran (GCC) 13.1.1 20230429
* running under: EndeavourOS
* using session charset: UTF-8
* using option ‘--as-cran’
* checking for file ‘animint2/DESCRIPTION’ ... OK
* this is package ‘animint2’ version ‘2023.6.11’
* package encoding: UTF-8
* checking CRAN incoming feasibility ... [7s/16s] WARNING
Maintainer: ‘Toby Hocking <toby.hocking@r-project.org>’

Insufficient package version (submitted: 2023.6.11, existing: 2023.6.11)

Days since last update: 4
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘animint2’ can be installed ... [13s/14s] OK
* checking installed package size ... OK
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking startup messages can be suppressed ... OK
* checking use of S3 registration ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... [23s/23s] OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking LazyData ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking examples ... [57s/58s] OK
* checking examples with --run-donttest ... [56s/56s] ERROR
Running examples in ‘animint2-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: geom_path
> ### Title: Connect observations.
> ### Aliases: geom_path geom_line geom_step
> 
> ### ** Examples
> 
> # geom_line() is suitable for time series
> ggplot(economics, aes(date, unemploy)) + geom_line()
> ggplot(economics_long, aes(date, value01, colour = variable)) +
+   geom_line()
> 
> # geom_step() is useful when you want to highlight exactly when
> # the y value chanes
> recent <- economics[economics$date > as.Date("2013-01-01"), ]
> ggplot(recent, aes(date, unemploy)) + geom_line()
> ggplot(recent, aes(date, unemploy)) + geom_step()
> 
> # geom_path lets you explore how two variables are related over time,
> # e.g. unemployment and personal savings rate
> m <- ggplot(economics, aes(unemploy/pop, psavert))
> m + geom_path()
> m + geom_path(aes(colour = as.numeric(date)))
> 
> # Changing parameters ----------------------------------------------
> ggplot(economics, aes(date, unemploy)) +
+   geom_line(colour = "red")
> 
> # Use the arrow parameter to add an arrow to the line
> # See ?arrow for more details
> c <- ggplot(economics, aes(x = date, y = pop))
> c + geom_line(arrow = arrow())
> c + geom_line(
+   arrow = arrow(angle = 15, ends = "both", type = "closed")
+ )
> 
> # Control line join parameters
> df <- data.frame(x = 1:3, y = c(4, 1, 9))
> base <- ggplot(df, aes(x, y))
> base + geom_path(size = 10)
> base + geom_path(size = 10, lineend = "round")
> base + geom_path(size = 10, linejoin = "mitre", lineend = "butt")
> 
> # NAs break the line. Use na.rm = T to suppress the warning message
> df <- data.frame(
+   x = 1:5,
+   y1 = c(1, 2, 3, 4, NA),
+   y2 = c(NA, 2, 3, 4, 5),
+   y3 = c(1, 2, NA, 4, 5)
+ )
> ggplot(df, aes(x, y1)) + geom_point() + geom_line()
Warning: Removed 1 rows containing missing values (geom_point).
Warning: Removed 1 rows containing missing values (geom_path).
> ggplot(df, aes(x, y2)) + geom_point() + geom_line()
Warning: Removed 1 rows containing missing values (geom_point).
Warning: Removed 1 rows containing missing values (geom_path).
> ggplot(df, aes(x, y3)) + geom_point() + geom_line()
Warning: Removed 1 rows containing missing values (geom_point).
> 
> ## No test: 
> # Setting line type vs colour/size
> # Line type needs to be applied to a line as a whole, so it can
> # not be used with colour or size that vary across a line
> x <- seq(0.01, .99, length.out = 100)
> df <- data.frame(
+   x = rep(x, 2),
+   y = c(qlogis(x), 2 * qlogis(x)),
+   group = rep(c("a","b"),
+   each = 100)
+ )
> p <- ggplot(df, aes(x=x, y=y, group=group))
> # These work
> p + geom_line(linetype = 2)
> p + geom_line(aes(colour = group), linetype = 2)

Execution halted
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ... [44s/44s] OK
  Running ‘namespace.R’
  Running ‘testthat.R’ [43s/43s]
* checking PDF version of manual ... OK
* checking HTML version of manual ... NOTE
Skipping checking HTML validation: no command 'tidy' found
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE
Status: 1 ERROR, 1 WARNING, 1 NOTE

@ampurr
Copy link
Collaborator Author

ampurr commented Jun 29, 2023

Note to self: it turns out installing Inconsolata did not affect the error, and therefore was not the problem. Current hypotheses are that (a) I'm missing some LaTeX packages; (b) there's some other problem with my computer; or (c) there's at least one problem at least one of the R files, though it's unclear why this isn't happening with anyone else's computer.

@tdhock
Copy link
Collaborator

tdhock commented Jul 1, 2023

to get help with this, you should search and post on r-package-devel list, https://stat.ethz.ch/mailman/listinfo/r-package-devel

@ampurr
Copy link
Collaborator Author

ampurr commented Jul 1, 2023

Oh, thanks! I'll look through the archives and see if anyone's had a similar problem.

Note to self: there's a plain text archive of r-package-devel on GitHub that you can use.

@ampurr
Copy link
Collaborator Author

ampurr commented Jul 25, 2023

Okay. I think xelatex works on my computer, but not pdflatex. I'll need to look closer to see if that's the root cause.

@tdhock
Copy link
Collaborator

tdhock commented Aug 7, 2023

hi, is this still an issue? Did you figure out what was the root cause, and how to solve? if so, please write on the wiki, for the benefit of others in the future.

@ampurr
Copy link
Collaborator Author

ampurr commented Aug 7, 2023

Will do. I've been dealing with the reference website, so I haven't figured it out yet.

@ampurr
Copy link
Collaborator Author

ampurr commented Aug 21, 2023

Closing it for now. Reasons:

  • I'm not sure I'll have time to look into this before GSOC ends.
  • It seems to be exclusive to me, and apparently my LaTeX installation is super messed up.
    • For example, I think I have TinyTeX downloaded multiple times from multiple sources.
    • And pdflatex doesn't work, but xelatex does.
  • The problem emerges only when I run build.sh.
    • The typical animint2 user won't run it.
    • No one else who has worked on this package has encountered this problem before.

@ampurr ampurr closed this as completed Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants