Hi Yihui,
Thanks for your support with this great package. I am having a similar although different issue to what is discussed later on in #103.
After installing TinyTex through RStudio and rebooting I do get tinytex:::is_tinytex(TRUE). Upon Kniting my first document (a bookdown/thesisdown thesis template) TinyTex attempts to install a few missing packages, but is repeatedly met with:
warning: kpathsea: //uh04392.companyname.net/home$/A483432: Unrecognized variable construct `$/'.
It seems to work through the download of the missing packages in terms of fetching the content, but after the 5 or so missing Latex packages are staged it throws a bunch of errors related to the dollar sign ($) in the path.
! Failed to access //uh04392.companyname.net/home$/A483432/.TinyTeX/texmf-var.
! Cannot get destination directory name.! Cannot get destination directory name.
! kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 tcrm1095
! The command name is C:\Users\A483432\AppData\Roaming\TinyTeX\bin\win32\mktexpk
! kpathsea: Appending font creation commands to missfont.log.
Error: Failed to compile thesis.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See thesis.log for more info.
Execution halted
I know TinyTex can be installed to a different location, but on trying this, it continued to look at the old one (from path environment variable) to download/update the missing packages.
I still would like to move the TinyTex install and the whatever tells R and pandoc bookdown etc. to point to it to another location and try again, but so far my attempts to do this with tmlgr commands have been unsuccessful, specifically in being able to change (tinytex::tlmgr_path()) which I think might be the problem (although I'm not sure).
When I do some of what was suggested in #103 I get the following:
xfun::session_info('rmarkdown')
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763), RStudio 1.2.5001
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.22 evaluate_0.14 glue_1.3.1
graphics_3.6.1 grDevices_3.6.1 highr_0.8 htmltools_0.4.0
jsonlite_1.6 knitr_1.25 magrittr_1.5 markdown_1.1
methods_3.6.1 mime_0.7 Rcpp_1.0.2 rlang_0.4.1
rmarkdown_1.16 stats_3.6.1 stringi_1.4.3 stringr_1.4.0
tinytex_0.16 tools_3.6.1 utils_3.6.1 xfun_0.10
yaml_2.2.0
Pandoc version: 2.7.1
| >
Sys.getenv('PATH')
[1] "C:\0R_WILT\R_WILT\R-3.6.1\bin\x64;C:\0R_WILT\Python\;C:\0R_WILT\Python\Scripts;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\0R_WILT\osmosis-latest\bin;C:\Program Files\CenterTools\DriveLock\;C:\0R_WILT\TinyTeX_ill\bin\win32;C:\Users\A483432\AppData\Local\Microsoft\WindowsApps;C:\0R_WILT\Git\cmd;C:\Users\A483432\AppData\Local\GitHubDesktop\bin;C:\0R_WILT\TinyTeX_ill\bin\win32;C:\0R_WILT\MiKTeX\miktex\bin\x64\;C:\Users\A483432\AppData\Roaming\TinyTeX\bin\win32"
(tinytex::tlmgr_path())
tlmgr path add
warning: kpathsea: //uh04392.companyname.net/home$/> (tinytex::tlmgr_path())
tlmgr path add
warning: kpathsea: //uh04392.companyname.net/home$/Q483367: Unrecognized variable construct$/'. Use of uninitialized value in bitwise or (|) at C:\Users\q483367\AppData\Roaming\TinyTeX\texmf-dist\scripts\texlive\tlmgr.pl line 1482. [1] 0: Unrecognized variable construct$/'.
Use of uninitialized value in bitwise or (|) at C:\Users\q483367\AppData\Roaming\TinyTeX\texmf-dist\scripts\texlive\tlmgr.pl line 1482.
[1] 0
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.
I guess I won't be able to help with this issue (it is beyond my capability when kpathsea is involved). If your IT could help you get rid of the dollar sign in the home$ directory (I doubt so), the problem might go away.
Someone else asked the similar question on SO: https://stackoverflow.com/q/57777988/559676
Before you try to install TinyTeX to a different location, be sure to remove the old copy first: tinytex::uninstall_tinytex()
Ok, thanks anyways for the response. If I figure something out I will post it here.
I know this issue has now been closed, but it seems it was closed without a resolution. I think I've figured out the problem (unfortunately, I seem to have ran into a further issue, but I think I've resolved this one anyway).
Basically, kpathsea is searching everywhere in your system for the needed packages. This means it's trying to search in directories that it can't read properly (because of the $ symbol amongst others). The solution was to find the texmf.cnf file which looks something like this:
% (Public domain.)
% This texmf.cnf file should contain only your personal changes from the
% original texmf.cnf (for example, as chosen in the installer).
%
% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
% the distributed file (which is .../texlive/YYYY/texmf-dist/web2c/texmf.cnf).
% And include *only* your changed values, not a copy of the whole thing!
%
TEXMFLOCAL = $SELFAUTOPARENT/texmf-local
TEXMFHOME = $HOME/.TinyTeX/texmf-home
TEXMFVAR = $HOME/.TinyTeX/texmf-var
TEXMFCONFIG = $HOME/.TinyTeX/texmf-config
OSFONTDIR = $SystemRoot/fonts//
ASYMPTOTE_HOME = $TEXMFCONFIG/asymptote
% Prefer external Perl for third-party TeXLive Perl scripts
% Was set to 1 if at install time a sufficiently recent Perl was detected.
TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL = 0
TEXMFAUXTREES = C:/PROGRA~1/R/R-36~1.3/share/texmf,
When searching, kpathsea replaces the $HOME with a directory, which contains a $, e.g., for me $HOME gets replaced by my default Documents folder (which is on a shared network drive) and
I replaced anywhere that had a $HOME/.TinyTeX with ./TinyTeX, which would make kpathsea search in the directory where I have actually installed the TinyTex (and, more specifically to not search in the default directory.
Hope this helps anybody having this issue and provides some help for developers on how to maybe stop this problem in the future.
@MyKo101 That's very helpful. Thanks for the diagnosis and information! With your help, I think I have managed to fix this issue in the install the development version:
remotes::install_github('yihui/tinytex')
It will be great if you and/or @mr-illington could try it (restart R after installing the dev version, then tinytex::reinstall_tinytex()).
Most helpful comment
I know this issue has now been closed, but it seems it was closed without a resolution. I think I've figured out the problem
(unfortunately, I seem to have ran into a further issue, but I think I've resolved this one anyway).Basically, kpathsea is searching everywhere in your system for the needed packages. This means it's trying to search in directories that it can't read properly (because of the
$symbol amongst others). The solution was to find thetexmf.cnffile which looks something like this:When searching, kpathsea replaces the
$HOMEwith a directory, which contains a$, e.g., for me$HOMEgets replaced by my default Documents folder (which is on a shared network drive) andI replaced anywhere that had a
$HOME/.TinyTeXwith./TinyTeX, which would make kpathsea search in the directory where I have actually installed the TinyTex (and, more specifically to not search in the default directory.Hope this helps anybody having this issue and provides some help for developers on how to maybe stop this problem in the future.