[R-pkg-devel] GitHub Action failed re-building 'sos.Rnw'

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sun May 23 18:03:39 CEST 2021


This page

https://bookdown.org/yihui/rmarkdown-cookbook/install-latex-pkgs.html

suggests that executing this in R should fix the tikz issue:

tinytex::parse_install(
   text = "! LaTeX Error: File `tikz.sty' not found."
)

The "ks" message looks like a missing R package rather than a missing 
LaTeX package, so running install.packages("ks") would fix it.

So the only question is how to do these things in a Github action.  I 
don't know if there's a pre-made recipe for this, but this one should do it:

       - name: Install tikz.tex and ks
         run: |
           install.packages(c('tinytex', 'ks')) # Maybe tinytex is 
already there?
           tinytex::parse_install(
              text = "! LaTeX Error: File `tikz.sty' not found."
           )
         shell: Rscript {0}

Duncan Murdoch

On 23/05/2021 11:28 a.m., Spencer Graves wrote:
> Hi, Duncan et al.:
> 
> 
> 	  Thanks very much to Duncan for his suggestion.  I did added the line
> Duncan suggested in three slightly different places.  That fixed the
> problems with missing tex and pdflatex, but exposed two new problems:
> 
> 
> 	  On Windows and ubuntu (both release and devel) I now get:
> 
> 
> LaTeX Error: File `tikz.sty' not found.
> 
> 
> 	  On macOS, I got a different error:
> 
> 
> there is no package called 'ks'
> 
> 
> 	  I added "ks" to "suggests" in DESCRIPTON but still got "no package
> called 'ks'.  And I studied README in https://github.com/r-lib/actions,
> and I did some other searches without figuring out how to fix
> "`tikz.sty' not found."
> 
> 
> 	  For more details, see:
> 
> 
> https://github.com/sbgraves237/sos
> 
> 
> 	  Suggestions?
> 	  Thanks,
> 	  Spencer
> 
> 
> On 5/23/21 4:43 AM, Duncan Murdoch wrote:
>> On 22/05/2021 10:05 p.m., Spencer Graves wrote:
>>> Hello:
>>>
>>>
>>>        What do you suggest I do to enable GitHub Action to process
>>> "sos.Rnw"
>>> properly?
>>>
>>>
>>>        The development version of my "sos" package passes "R CMD check" on
>>> my Mac but fails in all four platforms under GitHub Action on
>>>
>>>
>>> https://github.com/sbgraves237/sos
>>>
>>>
>>>        The error messages on macOS and Ubuntu release and devel all seems
>>> the same:
>>>
>>>
>>>              * Error: processing vignette 'sos.Rnw' failed with
>>> diagnostics:
>>> Running 'texi2dvi' on 'sos.tex' failed.  Messages: You don't have a
>>> working TeX binary (tex) installed anywhere in your PATH, and texi2dvi
>>> cannot proceed without one.
>>>
>>>
>>>        The error message under Windows seemed crudely similar but
>>> different:
>>>
>>>
>>>              * Error: processing vignette 'sos.Rnw' failed with
>>> diagnostics:
>>> pdflatex is not available
>>>
>>>
>>>        What do you suggest?
>>
>> The virtual machines that run Github actions have lots of tools
>> installed, but apparently not LaTeX.  So you need to figure out the
>> "step" to install it.  I'm not currently using Rnw with Github actions,
>> but by looking at the README for https://github.com/r-lib/actions, I'm
>> pretty sure all you need is to add
>>
>>     - uses: r-lib/actions/setup-tinytex using v1
>>
>> somewhere after
>>
>>     - uses: actions/checkout using master



More information about the R-package-devel mailing list