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

RStudio does not detect TeX installation #103

Closed
Keabla opened this issue Mar 6, 2019 · 58 comments
Closed

RStudio does not detect TeX installation #103

Keabla opened this issue Mar 6, 2019 · 58 comments

Comments

@Keabla
Copy link

Keabla commented Mar 6, 2019

I am working with R, and Rmarkdown works for Html and Word documents, but I have issues with translating to pdf document.

I installed the required packages and installed as well Tiny Tex as the website indicates. However, even though it says "To compile an R Markdown document to PDF, there is nothing else you have to know", so presume that you don't need to download further Tex files, I get the following error running the demo markdown file:

Error: Failed to compile Test.tex.
In addition: Warning message:
In system2(..., stdout = FALSE, stderr = FALSE) : '"pdflatex"' not found
Execution halted

No TeX installation detected (TeX is required to create PDF output). You should install a recommended TeX distribution for your platform:

Windows: MiKTeX (Complete) - http://miktex.org/2.9/setup
(NOTE: Be sure to download the Complete rather than Basic installation)

Mac OS X: TexLive 2013 (Full) - http://tug.org/mactex/
(NOTE: Download with Safari rather than Chrome strongly recommended)

Linux: Use system package manager

Could anyone please help me?

@yihui
Copy link
Member

yihui commented Mar 6, 2019

Update on May 20, 2019: to users who came to this page by searching for the RStudio error message "No TeX installation detected", you may try to install TinyTeX: https://yihui.name/tinytex/#for-r-users


Please provide

xfun::session_info('rmarkdown')
tinytex::tinytex_root()

Did you restart RStudio after tinytex::install_tinytex() (as indicated in the messages during installation)?

@Keabla
Copy link
Author

Keabla commented Mar 6, 2019

Thank you for replying. I did restart RStudio. This is what I get running the codes
xfun::session_info('rmarkdown')
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200), RStudio 1.1.463

Locale:
LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
LC_MONETARY=English_United States.1252 LC_NUMERIC=C
LC_TIME=English_United States.1252

Package version:
base64enc_0.1.3 digest_0.6.18 evaluate_0.13 glue_1.3.0 graphics_3.5.2 grDevices_3.5.2
highr_0.7 htmltools_0.3.6 jsonlite_1.6 knitr_1.21 magrittr_1.5 markdown_0.9
methods_3.5.2 mime_0.6 Rcpp_1.0.0 rmarkdown_1.11 stats_3.5.2 stringi_1.3.1
stringr_1.4.0 tinytex_0.10 tools_3.5.2 utils_3.5.2 xfun_0.5 yaml_2.2.0

Pandoc version: 2.7

tinytex::tinytex_root()
[1] "C:\Users\Martin Albaek\AppData\Roaming\TinyTeX"

@yihui
Copy link
Member

yihui commented Mar 6, 2019

By "restart RStudio", I mean close RStudio and open it again, instead of only restarting the R session within RStudio.

Does your Sys.getenv('PATH') contain the path returned by tinytex::tinytex_root()? What does (tinytex::tlmgr_path()) return?

@Keabla
Copy link
Author

Keabla commented Mar 6, 2019

Sorry by restart I meant close RStudio and open it again. This is what I get:
(tinytex::tlmgr_path())
tlmgr path add
[1] 127

Sys.getenv('PATH')
[1] "C:\Program Files\R\R-3.5.2\bin\x64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Pandoc\;C:\Program Files (x86)\LyX 2.3\Perl\bin;C:\Users\Martin Albaek\Anaconda3;C:\Users\Martin Albaek\Anaconda3\Library\mingw-w64\bin;C:\Users\Martin Albaek\Anaconda3\Library\usr\bin;C:\Users\Martin Albaek\Anaconda3\Library\bin;C:\Users\Martin Albaek\Anaconda3\Scripts;C:\Users\Martin Albaek\AppData\Local\Microsoft\WindowsApps;%DASHLANE_DLL_DIR%;C:\Users\Martin Albaek\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;C:\Users\Martin Albaek\AppData\Local\Pandoc\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\"

@yihui
Copy link
Member

yihui commented Mar 6, 2019

That is weird. What's the output of the code below?

(function() { tinytex:::tweak_path(); Sys.getenv('PATH') })()
p = tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'tlmgr.bat')
p
file_test('-x', p)

@Keabla
Copy link
Author

Keabla commented Mar 6, 2019

(function() { tinytex:::tweak_path(); Sys.getenv('PATH') })()
[1] "C:\Users\Martin Albaek\AppData\Roaming\TinyTeX\bin\win32;C:\Program Files\R\R-3.5.2\bin\x64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Pandoc\;C:\Program Files (x86)\LyX 2.3\Perl\bin;C:\Users\Martin Albaek\Anaconda3;C:\Users\Martin Albaek\Anaconda3\Library\mingw-w64\bin;C:\Users\Martin Albaek\Anaconda3\Library\usr\bin;C:\Users\Martin Albaek\Anaconda3\Library\bin;C:\Users\Martin Albaek\Anaconda3\Scripts;C:\Users\Martin Albaek\AppData\Local\Microsoft\WindowsApps;%DASHLANE_DLL_DIR%;C:\Users\Martin Albaek\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;C:\Users\Martin Albaek\AppData\Local\Pandoc\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\"

p = tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'tlmgr.bat')
p
[1] "C:\Users\Martin Albaek\AppData\Roaming/TinyTeX/bin/win32/tlmgr.bat"
file_test('-x', p)
C:\Users\Martin Albaek\AppData\Roaming/TinyTeX/bin/win32/tlmgr.bat
TRUE

@yihui
Copy link
Member

yihui commented Mar 6, 2019

Thanks! I think we are getting closer to the problem, but I still need more info:

(function() {
  tinytex:::tweak_path()
  print(Sys.which('pdflatex'))
  system2('pdflatex', '--version')
})()

@Keabla
Copy link
Author

Keabla commented Mar 6, 2019

Thank you for your time and dedication! Here there is the result

> (function() {
+     tinytex:::tweak_path()
+     print(Sys.which('pdflatex'))
+     system2('pdflatex', '--version')
+ })()
pdflatex 
      "" 

@Keabla
Copy link
Author

Keabla commented Mar 6, 2019

Also, I do not understand why in PATH it still appears "MikTex 2.9" at the bottom of it, as I deleted all the files with that time, could that be a reason for this problem?

@yihui
Copy link
Member

yihui commented Mar 6, 2019

If MiKTeX has been deleted, it doesn't matter if it is still in PATH (invalid paths in PATH will be ignored).

Now I wonder why pdflatex cannot be found:

p = tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'pdflatex.exe')
file.info(p)

@Keabla
Copy link
Author

Keabla commented Mar 6, 2019

> p = tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'pdflatex.exe')
> file.info(p)
                                                                          size isdir mode mtime ctime atime  exe
C:\\Users\\Martin Albaek\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe   NA    NA <NA>  <NA>  <NA>  <NA> <NA>

@yihui
Copy link
Member

yihui commented Mar 6, 2019

So what are the files under that directory?

list.files(tinytex:::win_app_dir('TinyTeX', 'bin', 'win32'))

@Keabla
Copy link
Author

Keabla commented Mar 6, 2019

> list.files(tinytex:::win_app_dir('TinyTeX', 'bin', 'win32'))
 [1] "eps2eps.exe"      "fmtutil-sys.exe"  "fmtutil-user.exe" "fmtutil.exe"      "kpathsea630.dll"  "kpseaccess.exe"   "kpsereadlink.exe" "kpsestat.exe"    
 [9] "kpsewhich.exe"    "mkocp.exe"        "mkofm.exe"        "mktexfmt.exe"     "mktexlsr.exe"     "mktexmf.exe"      "mktexpk.exe"      "mktextfm.exe"    
[17] "mktexupd.exe"     "msvcp140.dll"     "msvcr100.dll"     "pdf2dsc.exe"      "pdfopt.exe"       "ps2ascii.exe"     "ps2pdf.exe"       "ps2pdf12.exe"    
[25] "ps2pdf13.exe"     "ps2pdf14.exe"     "ps2ps.exe"        "ps2ps2.exe"       "psv.exe"          "runscript.dll"    "runscript.exe"    "runscript.tlu"   
[33] "texhash.exe"      "tlmgr-gui.exe"    "tlmgr.bat"        "updmap-sys.exe"   "updmap-user.exe"  "updmap.exe"       "wrunscript.exe"  

@yihui
Copy link
Member

yihui commented Mar 6, 2019

It appears your TinyTeX installation was incomplete for some reason. Could you retry tinytex::install_tinytex(TRUE)?

@Keabla
Copy link
Author

Keabla commented Mar 6, 2019

I retryied, close R and reopened it. But when I run your code

p = tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'pdflatex.exe')
file.info(p)

I get the same results as before, and markdown to pdf still does not work

@yihui
Copy link
Member

yihui commented Mar 6, 2019

I just tried to install TinyTeX on Windows and couldn't reproduce the problem. Perhaps pdflatex.exe was killed by your anti-virus software. I don't know. This is the first time I have heard such a weird case about TinyTeX.

The last resort would be tinytex:::install_prebuilt(). If this doesn't work, I'm afraid there isn't anything else I could do...

@Keabla
Copy link
Author

Keabla commented Mar 6, 2019

Is there anything that I should do after running tinytex:::install_prebuilt(), except closing and reopening R Studio, to make markdown to pdf work?

@yihui
Copy link
Member

yihui commented Mar 6, 2019

No. So it sounds like after you restart RStudio, it still doesn't work? pdflatex.exe still doesn't exist?

file.info(tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'pdflatex.exe'))

@yihui yihui changed the title R Studio does not detect Tex installation RStudio does not detect TeX installation Mar 6, 2019
@dawidh15
Copy link

dawidh15 commented Mar 7, 2019

Hello. I'm having the same issue. Actually, I was teaching my students how to use rmarkdown using tinytex. Some of then had no problem, but many found the same error message reported by @Keabla.

Of those who didn't have this issue, many installed tinytex weeks ago. I also installed tinytex some weeks ago in another windows computer, and had no issue at all.

In my PC I had MikTex installed. I uninstalled Miktex, and then restart the PC. Afterwards I installed tinytex:

tinytex::install_tinytex()

Then closed RStudio and reopen it. tinytex:::is_tinytex() was TRUE.

> xfun::session_info('rmarkdown')
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200), RStudio 1.1.463

Locale:
  LC_COLLATE=Spanish_Costa Rica.1252  LC_CTYPE=Spanish_Costa Rica.1252   
  LC_MONETARY=Spanish_Costa Rica.1252 LC_NUMERIC=C                       
  LC_TIME=Spanish_Costa Rica.1252    

Package version:
  base64enc_0.1.3 digest_0.6.18   evaluate_0.13   glue_1.3.0      graphics_3.5.2 
  grDevices_3.5.2 highr_0.7       htmltools_0.3.6 jsonlite_1.6    knitr_1.21     
  magrittr_1.5    markdown_0.9    methods_3.5.2   mime_0.6        Rcpp_1.0.0     
  rmarkdown_1.11  stats_3.5.2     stringi_1.3.1   stringr_1.4.0   tinytex_0.10   
  tools_3.5.2     utils_3.5.2     xfun_0.5        yaml_2.2.0     

Pandoc version: 1.19.2.1
> Sys.getenv('PATH')
 "C:\\Program Files\\R\\R-3.5.2\\bin\\x64;C:\\ProgramData\\Oracle\\Java\\javapath;c:\\Rtools\\bin;c:\\Rtools\\mingw_32\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\MySQL\\MySQL Utilities 1.6\\;C:\\Program Files\\Java\\jdk-9.0.1\\bin;C:\\Program Files\\Java\\jre-9.0.1\\bin;C:\\Program Files\\SourceGear\\Common\\DiffMerge\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\Firebird\\Firebird_3_0;C:\\Program Files\\Git\\cmd;C:\\Users\\Henry Marin\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Henry Marin\\AppData\\Roaming\\TinyTeX\\bin\\win32"

See below, the path is not exactly the same. Sys.getenv('PATH') returns \bin\win32 whereas > tinytex::tinytex_root() does not. I don't know if this is important, though.

> tinytex::tinytex_root()
[1] "C:\\Users\\Henry Marin\\AppData\\Roaming\\TinyTeX"

These are the other command @yihui asked for:

> (tinytex::tlmgr_path())
tlmgr path add
Use of uninitialized value in bitwise or (|) at C:\Users\HENRYM~1\AppData\Roaming\TinyTeX\texmf-dist\scripts\texlive\tlmgr.pl line 1482.
[1] 0
> (function() { tinytex:::tweak_path(); Sys.getenv('PATH') })()
[1] "C:\\Users\\Henry Marin\\AppData\\Roaming\\TinyTeX\\bin\\win32;C:\\Program Files\\R\\R-3.5.2\\bin\\x64;C:\\ProgramData\\Oracle\\Java\\javapath;c:\\Rtools\\bin;c:\\Rtools\\mingw_32\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\MySQL\\MySQL Utilities 1.6\\;C:\\Program Files\\Java\\jdk-9.0.1\\bin;C:\\Program Files\\Java\\jre-9.0.1\\bin;C:\\Program Files\\SourceGear\\Common\\DiffMerge\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\Firebird\\Firebird_3_0;C:\\Program Files\\Git\\cmd;C:\\Users\\Henry Marin\\AppData\\Local\\Microsoft\\WindowsApps"
> p = tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'tlmgr.bat')
> p
[1] "C:\\Users\\Henry Marin\\AppData\\Roaming/TinyTeX/bin/win32/tlmgr.bat"
> file_test('-x', p)
C:\\Users\\Henry Marin\\AppData\\Roaming/TinyTeX/bin/win32/tlmgr.bat 
                                                                TRUE
(function() {
  tinytex:::tweak_path()
  print(Sys.which('pdflatex'))
  system2('pdflatex', '--version')
})()
pdflatex 
      "" 
    
    
      
> p = tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'pdflatex.exe')
> file.info(p)
                                                                        size isdir mode
C:\\Users\\Henry Marin\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe   NA    NA <NA>
                                                                        mtime ctime
C:\\Users\\Henry Marin\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe  <NA>  <NA>
                                                                        atime  exe
C:\\Users\\Henry Marin\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe  <NA> <NA>


> list.files(tinytex:::win_app_dir('TinyTeX', 'bin', 'win32'))
 [1] "eps2eps.exe"      "fmtutil-sys.exe"  "fmtutil-user.exe" "fmtutil.exe"     
 [5] "kpathsea630.dll"  "kpseaccess.exe"   "kpsereadlink.exe" "kpsestat.exe"    
 [9] "kpsewhich.exe"    "mkocp.exe"        "mkofm.exe"        "mktexfmt.exe"    
[13] "mktexlsr.exe"     "mktexmf.exe"      "mktexpk.exe"      "mktextfm.exe"    
[17] "mktexupd.exe"     "msvcp140.dll"     "msvcr100.dll"     "pdf2dsc.exe"     
[21] "pdfopt.exe"       "ps2ascii.exe"     "ps2pdf.exe"       "ps2pdf12.exe"    
[25] "ps2pdf13.exe"     "ps2pdf14.exe"     "ps2ps.exe"        "ps2ps2.exe"      
[29] "psv.exe"          "runscript.dll"    "runscript.exe"    "runscript.tlu"   
[33] "texhash.exe"      "tlmgr-gui.exe"    "tlmgr.bat"        "updmap-sys.exe"  
[37] "updmap-user.exe"  "updmap.exe"       "wrunscript.exe"  

I will also install the prebuild and report later.

Thanks.

@Keabla
Copy link
Author

Keabla commented Mar 7, 2019

@yihui here are the results that I get (sorry for the :

> file.info(tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'pdflatex.exe'))
                                                         size isdir mode               mtime               ctime               atime   exe                         
>C:\\Users\\Martin Albaek\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe 1536 FALSE  777 2019-03-06 18:14:52 2019-03-06 18:14:52 2019-03-06 18:14:52 win32

@yihui
Copy link
Member

yihui commented Mar 7, 2019

@Keabla So it seems you have pdflatex.exe now. Does it work for building R Markdown to PDF?

BTW, please take a minute to read the Markdown syntax: https://guides.github.com/features/mastering-markdown/ You should use code blocks to show verbatim content, such as R code and its output.

@dawidh15
Copy link

dawidh15 commented Mar 7, 2019

Hello. I've uninstalled Tex Live and tinytex. Then, reinstalled tinytex v0.9, and used the command tinytex::install_prebuilt(). Then I could compile PDFs with no problem.

If you need detailed info, please tell me how to help.

Thanks

@yihui
Copy link
Member

yihui commented Mar 7, 2019

@dawidh15 Good to know. Thank you!

@Keabla
Copy link
Author

Keabla commented Mar 7, 2019

@yihui Sorry for the format, I am new to GitHub so I still need to learn how to do it.
For me it still does not work. Here is what I did after I unistalled tinytex and removed the package:

install.packages('tinytex')
tinytex::install_tinytex()

closed R Studio

tinytex:::install_prebuilt()

But it is still not working, did I do anything different from you @dawidh15 that might be the reason why it is not working?

@yihui
Copy link
Member

yihui commented Mar 7, 2019

@Keabla Click the Code tab in the Examples section: https://guides.github.com/features/mastering-markdown/ I have been editing almost every single reply you posted in this thread, and I really hope you could learn how to use three backticks by yourself :)

After you tinytex::install_prebuilt(), what's the output of

file.info(tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'pdflatex.exe'))

?

@dawidh15
Copy link

dawidh15 commented Mar 7, 2019

@Keabla The only thing different I did was installing the previous version of tinytex (v0.9). Also, after installing tinytex , I went straight to tinytex::install_prebuild().

As I mentioned earlier, some students went into this problem (all of then using Windows 10). They just had a new version of tinytex installed, whereas the students with a previous version could actually run the PDF. So, it looks to me that this problem might be related to some recent change in tinytex (one to two weeks back... maybe).

BTW this is the output of file.info(tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'pdflatex.exe')).

> file.info(tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'pdflatex.exe'))
                                                                        size isdir mode
C:\\Users\\Henry Marin\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe 1536 FALSE  777
                                                                                      mtime
C:\\Users\\Henry Marin\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe 2019-03-07 09:09:11
                                                                                      ctime
C:\\Users\\Henry Marin\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe 2019-03-07 09:09:11
                                                                                      atime
C:\\Users\\Henry Marin\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe 2019-03-07 09:09:11
                                                                          exe
C:\\Users\\Henry Marin\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe win32

@yihui
Copy link
Member

yihui commented Mar 7, 2019

@dawidh15 Thank you! I think you are all set now (and I guess you are correct that the upstream TeX Live installer might be broken recently). I'm continuing to help @Keabla.

@QQ910
Copy link

QQ910 commented Mar 14, 2019

Hi Yihui, I have the issue to use tinytex::install_tinytex() function here, it show I could not download from "http://mirror.ctan.org/systems/texlive/tlnet/install-tl.zip" , because of the security. However, if I change to "https" , it shows the ULR is ok. Do you have the solution for this? Thanks.

yihui added a commit that referenced this issue Mar 14, 2019
@MichaelTuchman
Copy link

I would have hoped this step would have been more prominently placed on the website.

Which website are you referring exactly ?

Currently ˋtinytex::install_tinytex()` is in the first chunk under R users setup on the documentation website https://yihui.name/tinytex/

OK, thanks. Apparently, I overlooked it. I didn't say it wasn't there; just that it would have been more prominent.

@MichaelTuchman
Copy link

MichaelTuchman commented May 20, 2019

I would have hoped this step would have been more prominently placed on the website.

Which website are you referring exactly ?

Currently ˋtinytex::install_tinytex()` is in the first chunk under R users setup on the documentation website https://yihui.name/tinytex/

Can you kindly give me the complete link to the 'R Users Setup?'. Right now, the message I get from your post is "It's there, dummy, so why didn't you find it?". And yet, I didn't find it, so perhaps communication should be clearer.

The current menu on the left hand side of the page does not mention the word 'Setup'. In my view, this is where it should be mentioned for easiest navigation.

Here's the menu. In my view, it would be more helpful if the link to the chunk you describe were placed in this menu, at the top level of the website.

TinyTeX: A lightweight and easy-to-maintain LaTeX distribution

Home
FAQs
R package
Hall of Pain
中文文档
Github repo
Yihui Xie
Edit this page
Subscribe

@yihui
Copy link
Member

yihui commented May 20, 2019

@MichaelTuchman It is in the first section on https://yihui.name/tinytex/ with the section title "For R Users", after an initial introduction/overview (which consists of three paragraphs and a logo).

image

The "complete" link is (still the same page): https://yihui.name/tinytex/#for-r-users

Right now, the message I get from your post is "It's there, dummy, so why didn't you find it?".

I'm sorry you felt that way, but I'm sure @cderv didn't mean the message. He is one of the kindest people in the R community I have ever met.

I appreciate your suggestion of making tinytex::install_tinytex() more prominent on that page, but I don't know how. It appeared quite early on the page. Do you mean that we should move it all the way up to the very first paragraph? That doesn't feel natural to me. I mean a project typically needs an introduction/overview in the beginning, then we talk about specifics (like installation, etc).

Anyway, there is a menu item "Edit this page", on which you can click to make a concrete suggestion of improving the documentation. Thank you!

@MichaelTuchman
Copy link

MichaelTuchman commented May 20, 2019 via email

@MichaelTuchman
Copy link

MichaelTuchman commented May 20, 2019 via email

@cderv
Copy link
Contributor

cderv commented May 20, 2019

@MichaelTuchman I am deeply sorry if you misundersood me and that you feel like you describe. As @yihui explain (Thanks!), it was far from my intention. I just wanted to point to you the doc website if you had not seen it. I wasn't sure you were talking about this website.
I'll be less concise in my answers in the future to be more clear about my intention. Thanks for the feedback.

Glad everything is ok now ! ☺️

@MichaelTuchman
Copy link

MichaelTuchman commented May 21, 2019 via email

@ghost
Copy link

ghost commented May 23, 2019

I actually want to say: Why do we need tinytex::install_tinytex() at all? It is not straightforward. For other R packages, we just run install.packages(packageaname).

@yihui
Copy link
Member

yihui commented May 23, 2019

@cowlumbus tinytex::install_tinytex() installs TinyTeX, a LaTeX distribution (not an R package).

@ghost
Copy link

ghost commented May 24, 2019

@yihui I mean, maybe you can have R automatically run tinytex::install_tinytex() after install.packages('tinytex')?

@yihui
Copy link
Member

yihui commented May 24, 2019

@cowlumbus That is not a trivial decision for me to make for users. Users may hate it when one software package installs other software packages secretly. However, it could be a good idea to pop up a dialog box asking users whether they'd like to install TinyTeX. For now, it is only mentioned in the RStudio error message: https://github.com/rstudio/rstudio/pull/3979/files

@rongdong366
Copy link

@yihui 你好,上面的Tinytex安装没问题,pdflatex.exe文件也有,但是生成pdf报错了。

13V8T%6EH{9R871S086L9XG

@rongdong366
Copy link

@yihui 你好,上面的Tinytex安装没问题,pdflatex.exe文件也有,但是生成pdf报错了。

13V8T%6EH{9R871S086L9XG

image
这是报错的结果

@yihui
Copy link
Member

yihui commented Jun 12, 2019

@myfollowers Your problem seems to be a different one. Please file a new issue instead of replying to this thread infinitely. This thread is about installing LaTeX/TinyTeX. You have successfully installed it.

The only reason I haven't closed this issue is that I haven't heard back from @Keabla, and I don't know if the problem has been solved.

@ghost
Copy link

ghost commented Jun 13, 2019

@cowlumbus That is not a trivial decision for me to make for users. Users may hate it when one software package installs other software packages secretly. However, it could be a good idea to pop up a dialog box asking users whether they'd like to install TinyTeX. For now, it is only mentioned in the RStudio error message: https://github.com/rstudio/rstudio/pull/3979/files

I understand that it is not a good thing that one software package installs other software packages secretly. However, here we have a different scenario. Our goal is to use TinyTeX. The tinytex R package is just the midman. We always need to run tinytex::install_tinytex() after install.packages('tinytex'). I cannot think of a scenario that only requires the tinytex pacakge, but not to run tinytex::install_tinytex(). So don't be too pedantic.

@yihui
Copy link
Member

yihui commented Jun 13, 2019

@cowlumbus You can use other LaTeX distributions with the R package tinytex: https://yihui.name/tinytex/r/#other-latex-distributions TinyTeX is not your only choice.

@ghost
Copy link

ghost commented Jun 13, 2019

@yihui I see. Thanks for the open-minded feature of tinytex - open to support other latex distributions!
As you can see, I am new to latex things. I tried MikeTex first, but failed to get it work on my machine. Then I found out TinyTeX and it works like a charm.

@yihui
Copy link
Member

yihui commented Oct 15, 2019

The RStudio IDE will suggest you install TinyTeX in the future if no LaTeX installation is detected: rstudio/rstudio#5490

@stormnorm87
Copy link

tinytex:::install_prebuilt()

helps for me

@RI1900
Copy link

RI1900 commented Mar 20, 2021

at the end works on a windows machine without the powershell crap. We all love you @yihui Thanks

@AmeliaMN
Copy link

AmeliaMN commented Nov 3, 2022

We're mid-semester, and one of my students (who has been rendering Quarto documents fine until now) just had the "no TeX installation detected" error pop up. After trying the usual quarto install tool tinytex and tinytex::install_tinytex() options to no avail, I ended up here. I'm assuming it was overenthusiastic virus control software, and tinytex:::install_prebuilt() fixed it!

@yihui
Copy link
Member

yihui commented Nov 3, 2022

@AmeliaMN That's really odd... I can't think of a reason why tinytex:::install_prebuilt() could fix the problem but tinytex::install_tinytex() couldn't. But thanks for posting the solution anyway!

@tsquall121
Copy link

tsquall121 commented Nov 3, 2022

@AmeliaMN @yihui I had the same problem. When I tried to use tinytex:::install_prebuilt(), it gave me the following error.

add_link_dir_dir: destination /usr/local/bin not writable, no links from /Users/*/Library/TinyTeX/bin/universal-darwin.
tlmgr: An error has occurred. See above messages. Exiting.
TLUtils::add_remove_symlinks: add of symlinks had 1 error(s), see messages above.

@yihui
Copy link
Member

yihui commented Nov 4, 2022

@tsquall121 The internal function tinytex:::install_prebuilt() is not supposed to be called by average users. As I said, I have no idea why it worked in @AmeliaMN's case. For your problem (/usr/local/bin not writable), the public function tinytex::install_tinytex() should tell you how to fix it.

@tsquall121
Copy link

@yihui the public function tinytex::install_tinytex() didn't work. I installed and uninstalled for multiple times. But the code you recommended to put in the terminal worked. See here.

@yihui
Copy link
Member

yihui commented Nov 4, 2022

Hmm. tinytex::install_tinytex() should run the code I provided in #24. I'm not sure why it didn't. Again, it's a mystery to me...

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