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

TinyTeX's TEXMFHOME configuration not deleted #433

Open
auralioth opened this issue Jan 10, 2024 · 10 comments
Open

TinyTeX's TEXMFHOME configuration not deleted #433

auralioth opened this issue Jan 10, 2024 · 10 comments

Comments

@auralioth
Copy link

auralioth commented Jan 10, 2024

Thanks! I just removed TinyTeX's TEXMFHOME configuration, so that it will just use TeX Live's default setting. This will be reflected in the next build of TinyTeX (which will hopefully be ready in about an hour). Or you can delete TEXMFHOME manually:

tlmgr conf texmf --delete TEXMFHOME

Then verify by

kpsewhich -var-value TEXMFHOME

Oddly, it returns ~/texmf instead of ~/Library/texmf on my macOS. I'm not sure if this is a bug, but you can definitely change it:

tlmgr conf texmf TEXMFHOME ~/Library/texmf

Originally posted by @yihui in #377 (comment)

屏幕截图 2024-01-10 120951

As shown in the screenshot, after I installed tinytex with scoop and after each update, the default location of TEXMFHOME became $TEXMFLOCAL instead of ~/texmf, which is the default location of texlive on Windows systems. Could you please make some modifications in install-windows.bat?

@cderv
Copy link
Contributor

cderv commented Jan 10, 2024

Could you please make some modifications in install-windows.bat

Are you using the bat script or scoop install tinytex from the cderv/r-bucket ?

The scoop installation is just downloading the release bundle from https://github.com/rstudio/tinytex-releases/releases/tag/v2024.01

I don't think we do anything specific regarding configuration at https://github.com/cderv/r-bucket/blob/master/bucket/tinytex.json

Which is the version of TinyTeX you have install in scoop ?

I need to check what is the windows default..

@cderv
Copy link
Contributor

cderv commented Jan 10, 2024

I don't use scoop install but install using the R package tinytex and I still get this

> kpsewhich -var-value TEXMFHOME
C:/Users/chris/AppData/Roaming/TinyTeX/texmf-local

I got this as configuration:

> bat c:/Users/chris/AppData/Roaming/TinyTeX/texmf.cnf
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: c:/Users/chris/AppData/Roaming/TinyTeX/texmf.cnf
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ % (Public domain.)
   2   │ % This texmf.cnf file should contain only your personal changes from the
   3   │ % original texmf.cnf (for example, as chosen in the installer).
   4   │ %
   5   │ % That is, if you need to make changes to texmf.cnf, put your custom
   6   │ % settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
   7   │ % the distributed file (which is .../texlive/YYYY/texmf-dist/web2c/texmf.cnf).
   8   │ % And include *only* your changed values, not a copy of the whole thing!
   9   │ %
  10   │ TEXMFLOCAL = $SELFAUTOPARENT/texmf-local
  11   │ OSFONTDIR = $SystemRoot/fonts//;$LOCALAPPDATA/Microsoft/Windows/Fonts//
  12   │ ASYMPTOTE_HOME = $TEXMFCONFIG/asymptote
  13   │ TEXMFHOME = $TEXMFLOCAL
  14   │ TEXMFVAR = $TEXMFSYSVAR
  15   │ TEXMFCONFIG = $TEXMFSYSCONFIG
  16   │
  17   │ % Prefer external Perl for third-party TeXLive Perl scripts
  18   │ % Was set to 1 if at install time a sufficiently recent Perl was detected.
  19   │ TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL = 0
  20   │ max_print_line = 10000
  21   │ TEXMFAUXTREES = C:/PROGRA~1/R/R-42~1.0/share/texmf,

@cderv
Copy link
Contributor

cderv commented Jan 10, 2024

Fresh installation after uninstalling and reinstalling give me the same configuration

TEXMFHOME = $TEXMFLOCAL

@auralioth
Copy link
Author

Are you using the bat script or scoop install tinytex from the cderv/r-bucket ?

I am using scoop install

Which is the version of TinyTeX you have install in scoop ?

v2024.01

Fresh installation after uninstalling and reinstalling give me the same configuration

TEXMFHOME = $TEXMFLOCAL

Yes, it is.

If installing it manually according to the texlive official website, TEXMFHOME should be the default, which is ~/texmf. So where might tinytex change when packaging?

@cderv
Copy link
Contributor

cderv commented Jan 10, 2024

So where might tinytex change when packaging?

That is the question :) Looking into it

@cderv cderv self-assigned this Jan 10, 2024
@cderv
Copy link
Contributor

cderv commented Jan 10, 2024

@yihui some questions about how it is supposed to work

I think the issue relies in texlive.profile which should be used of the configuration as we do
https://github.com/rstudio/tinytex/blob/main/tools/install-windows.bat#L34

We correctly use the profile for installation in CI (https://github.com/rstudio/tinytex/actions/runs/7469845614/job/20327605730#step:8:61)

Automated TeX Live installation using profile: ../tinytex.profile

So it seems the values are correctly passed and should be read so no override of default...

It seems TinyTeX is not overriding this value 🤔 I am trying to understand how texlive installation sets it.

Related topic while reading source code:

echo TEXMFCONFIG $TEXMFSYSCONFIG>> tinytex.profile
echo TEXMFVAR $TEXMFSYSVAR>> tinytex.profile

Is this suppose to write the content of $TEXMFSYSCONFIG into the file or add those line into

TEXMFCONFIG $TEXMFSYSCONFIG >> tinytex.profile 
TEXMFVAR $TEXMFSYSVAR >> tinytex.profile

into the file ?

Because if the latter, it needs quotes

-echo TEXMFCONFIG $TEXMFSYSCONFIG>> tinytex.profile 
+echo 'TEXMFCONFIG $TEXMFSYSCONFIG' >> tinytex.profile 
- echo TEXMFVAR $TEXMFSYSVAR>> tinytex.profile
+echo 'TEXMFVAR $TEXMFSYSVAR' >> tinytex.profile

@cderv
Copy link
Contributor

cderv commented Jan 10, 2024

OK so I think I found it.

The content we see if from installer
https://github.com/TeX-Live/installer/blob/fa5010f553f47ff07d8730efe8de944071dd8e2a/install-tl#L1548-L1585

Specifically this :

  if ($vars{'instopt_portable'}) {
    print TMF "TEXMFHOME = \$TEXMFLOCAL\n";
    print TMF "TEXMFVAR = \$TEXMFSYSVAR\n";
    print TMF "TEXMFCONFIG = \$TEXMFSYSCONFIG\n";
  }

And this is activated because do set portable in the profile we pass

portable 1

So I guess

TEXMFHOME = $TEXMFLOCAL

is the default for portable installation. From man page:

-portable
Install for portable use, e.g., on a USB stick. See the instopt_portable description below for details.

instopt_portable (default 0)
Install for portable use, e.g., on a USB stick, without touching the host system. Specifically, this forces the user directories > TEXMFHOME, TEXMFCONFIG, TEXMFVAR to be identical to the system directories TEXMFLOCAL, TEXMFSYSCONFIG, > TEXMFSYSVAR, respectively (regardless of other options and environment variable.)
In addition, on Windows, it disables the desktop integration, path adjustment, and file associations actions usually performed.

@yihui I don't know if you knew that. This probably means that 170d914
is not exactly doing what was expected. Or that previous value set in profile was better maybe... 🤔

@cderv cderv removed their assignment Jan 10, 2024
@yihui
Copy link
Member

yihui commented Jan 17, 2024

So I guess

TEXMFHOME = $TEXMFLOCAL

is the default for portable installation.

@cderv Thanks for the diagnosis! I didn't know that (or perhaps I knew once but forgot later).

@auryouth I think the solution is tlmgr conf texmf --delete TEXMFHOME after installing TinyTeX, but the question is who should run this command, i.e., whether we (TinyTeX maintainers) or users should delete TeX Live's default TEXMFHOME configuration. I don't have an opinion and am fine with either way.

@cderv
Copy link
Contributor

cderv commented Jan 18, 2024

, whether we (TinyTeX maintainers) or users should delete TeX Live's default TEXMFHOME configuration.

This can be done with tinytex using tinytex::tlmgr_conf(c("texmf", "--delete", "TEXMFHOME")) so a user could run it easily I think. If we were to do it, I think we should make it an option argument in the installation. Not sure which would be the name, or maybe it should be a way to customize TEXMFHOME at installation.

I think we should keep TeX Live default for portable as a default for tinytex but definitely allow helpers on how to change.

@auralioth
Copy link
Author

tlmgr conf texmf --delete TEXMFHOME

I also think this can be included as an option in the scoop app manifest or bat script.

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

3 participants