0

All of my previous Tex experience has been with the MiKTex distribution. However, I recently installed Ubuntu 21.10 and it appears that MiKTex is not compatible with this version of Ubuntu yet. Moreover, I have heard that TexLive is a better distribution overall for Linux users anyhow. So, my goal is to switch to TexLive. However, I would like to keep using the TexWorks editor because I am familiar with its keyboard shortcuts.

So far, I successfully installed TexLive and TexWorks using sudo apt-get install texlive and sudo apt-get install texworks.

However, when I open one of my documents in TexWorks and try to compile it, I get an error saying that the packages it needs are not installed:

! LaTeX Error: File `enumitem.sty' not found.

In MiKTex, when a package like this is missing, it just automatically installs the package for you as long as you are connected to the internet. How can I make TexLive do the same?

I would prefer not to do sudo apt-get install texlive-full if possible, because I do not need all the other language files etc. and am working on a small HD partition.

Max
  • 325
  • It doesn't say "automatically initialized", it says "initial setup step is necessary"... – user202729 Jan 01 '22 at 01:36
  • Searching for "user mode" in the page you linked has "Before using tlmgr in user mode, you have to set up the user tree with the init-usertree action." Maybe that's it? – user202729 Jan 01 '22 at 01:38
  • Searching around a bit there's https://askubuntu.com/questions/1352322/texlive-2021-tlmgr and https://tex.stackexchange.com/questions/605308/texlive-2021-and-tlmgr-an-unsolved-issue – Not sure if it's the same, I don't use Ubuntu, but it seems that you have to configure some environment variable or something? Does Debian have a wiki/installation instruction or something? – user202729 Jan 01 '22 at 01:40
  • you can query apt to see which ubuntu package has enumitem and install it via apt (rather than tlmgr) but really it's far easier to install texlive-full it's not that big by modern standards, if you are short of space choose to not install teh source or doc trees. – David Carlisle Jan 01 '22 at 01:49
  • Thank you for your comments. From reading the thread linked by @user202729, it seems that either I need to install the full version of TexLive (which, as stated in the question, is what I am trying to avoid), or install packages one at a time using tlmgr install ..., or install a package called texliveonfly that attempts to do what MiKTex does by running tlmgr install texliveonfly. Either of the latter two solutions brings me right back to question posed in the OP, which is how to get the tlmgr to work from the command line. – Max Jan 01 '22 at 06:50
  • • "old" doesn't mean "out of date". If someone really made some tool to solve the issue they would have posted an answer to that question (why not?) • Did you try things in my other comments above as well? – user202729 Jan 01 '22 at 08:11
  • Using Ubuntu texlive you cannot use tlmgr to install packages and thus texliveonfly will probably not work. Ubuntu insist on users having to install via apt. Installing packages via tlmgr only works if you manually install upstream texlive. My suggestion: install apt-file and use it via apt-file search enumitem.sty and it will tell you which Ubuntu package provides that latex package. – daleif Jan 01 '22 at 09:07
  • @user202729 The consensus in the first thread was to install texlive-full, and the second one appears to be an unrelated issue since it was solved using sudo. Fair point about "old" vs. "out of date"; I will edit the post. – Max Jan 01 '22 at 11:33
  • I have now edited the post to remove the issue about initalizing the usertree, which was solved by running tlmgr init-usertree. This brings the main question into focus, namely how to get a TexLive installation in Ubuntu that installs packages on the fly. If I am understanding @daleif correctly the answer may simply be that this is impossible. – Max Jan 01 '22 at 11:37
  • In my opinion, if you only have little room. Drop the ubuntu texlive. Install upsteam texlive (and perhaps the equivs part from https://www.tug.org/texlive/debian.html). When installing upsteam texlive choose a small scheme, perhaps drop documentation as well. You now have a texlive where tlmgr is fully operational and you have even more control over what is being installed. Plus texliveonfly now works (as it uses tlmgr) – daleif Jan 01 '22 at 11:46
  • My home computer also have limited HD and thus I tried the method I described. I only use texliveonfly very seldomly as I usually have the packages that I need. I chose to keep the documentation of that packages that I use. NB: I've never used TeXLive from a Linux dist as they mostly lack behind on updates. – daleif Jan 01 '22 at 11:47
  • @daleif If you wouldn't mind elaborating more in the form of an answer, I would be very grateful. I don't quite understand what you mean by "upstream TexLive," how this differs from the version I have installed, or how to install it ... or what a "scheme" is and what a "small" scheme is. Coming from MiKTex, this is a lot of jargon. – Max Jan 01 '22 at 11:51

1 Answers1

1

First of, Ubuntu/Debian wants you to install stuff via their infrastructure. Thus they will change tlmgr to only be used for configuration, but not install packages as that will use a different infrastructure than Debians.[1]

[1]: I'd really like Debian to add a notice to their changed version of tlmgr explaining why tlmgr install ... does not work.

If one is not technically inclined, just use TeXLive from Debian/Ubuntu. If you have enough HD space, install texlive-full. If space is more limited learn to use the apt-file tool to figure out which Debian package a certain TeXLive package is in (via apt-file search file.sty). It is annoying but that is how it is. Generally HD space is cheap.

If more technically inclined, you can instead install the socalled upsteam TeXLive directly from the TL developers, see https://tug.org/texlive. Just remember you will have to manually add the new TeXLive to your PATH variable (do this in your .profile not just in .bashrc, log out and in again), remember the manually installed TL needs to come first on the PATH.

The upsteam TeXLive installer can install different schemes, which are collections of programmes and packages. The default is to install everything. But if space is limited, you can install a smaller scheme and supplement with extra packages or programmes later on. The installer also allows you to disable the installation of manuals.

Note that a TeXLive release only gets updates for about a year (especially due to the Windows support).

For more information see https://tug.org/texlive/doc/texlive-en/texlive-en.html

As mentioned: Installing upsteam TL requires that you know what you are doing and that you know Linux. If you don't, use Ubuntu TeXLive and live with the fackt that you cannot use texliveonfly with it.

daleif
  • 54,450