You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When tinytex::parse_packages() fails to parse the tex log correctly, it leads to confusing errors.
For example, when I tried to compile the following test.Rmd with a fresh tinytex installation:
---
output: pdf_document
header-includes:
- \usepackage{XCharter}
---
# Test file
This is a test
the following LaTeX error is logged:
! Package fontenc Error: Encoding file `t2aenc.def' not found.
(fontenc) You might have misspelt the name of the encoding.
but tinytex parses it incorrectly, with an extra backtick:
> tinytex:::detect_files(" file `t2aenc.def' not found")
[1] "`t2aenc.def"
which leads tlmgr to search for '/`t2aenc.def' rather than '/t2aenc.def' and thus fail to identify the missing package.
At the very least, can the error be much clearer? e.g.:
LaTeX Error: [error from the log] (check file.log for more details).
Tinytex believes there is a missing package that contains the file "file.def"
Attempting to identify missing package automatically...
[tlmgr command]
Could not automatically identify missing package (see https://yihui.org/tinytex/#maintenance to try manually).
Inevitably, the regex will fail sometimes, which is fine. But it should be obvious that (1) it is a LaTeX error, NOT an rmarkdown or tinytex error, and (2) if tlmgr search fails, it's up to the user to figure out which package is missing.
(Also see item 2 in this answer (https://stackoverflow.com/a/58410965) for a similar situation when regex matched an error that wasn't actually a missing package).
I have provided the necessary information about my issue.
If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('tinytex'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/tinytex').
If I have posted the same issue elsewhere, I have also mentioned it in this issue.
I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered:
>tinytex:::detect_files(" file `t2aenc.def' not found")
[1] "t2aenc.def"
I have made it clear that the error comes from LaTeX. I have also muted some messages by default, since they are not that useful in most cases (can be turned back on via options(tinytex.verbose = TRUE)).
When
tinytex::parse_packages()
fails to parse the tex log correctly, it leads to confusing errors.For example, when I tried to compile the following
test.Rmd
with a fresh tinytex installation:the following LaTeX error is logged:
but tinytex parses it incorrectly, with an extra backtick:
which leads tlmgr to search for
'/`t2aenc.def'
rather than'/t2aenc.def'
and thus fail to identify the missing package.At the very least, can the error be much clearer? e.g.:
Inevitably, the regex will fail sometimes, which is fine. But it should be obvious that (1) it is a LaTeX error, NOT an rmarkdown or tinytex error, and (2) if
tlmgr search
fails, it's up to the user to figure out which package is missing.(Also see item 2 in this answer (https://stackoverflow.com/a/58410965) for a similar situation when regex matched an error that wasn't actually a missing package).
By filing an issue to this repo, I promise that
xfun::session_info('tinytex')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/tinytex')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: