47

I do not know the dependencies b/w the tools provided by the LaTeX bulky lib. A suggested command to install LaTeX tools on Ubuntu is:

sudo apt-get install texlive-full

It's full installation requires almost 1,801 MB of disk-space. What I need is only the pdflatex command line tool. Is it possible to install the required tool(s) only? If not what is the best way to install the required libs/tools?

4
  • 9
    No. You will need also at least some base packages. You can install texlive-core + packages you need.
    – Eddy_Em
    May 6, 2013 at 8:08
  • @Eddy_Em thanks for your comments, should I assume that there not optimal way to install it ?
    – sakhunzai
    May 6, 2013 at 8:49
  • 4
    Every distro have its own package manager. And maintainers of distro have their own point of view onto package building. So, for example, in archlinux texlive is split onto many small packages. In debian, I think, it must be alike. The smallest working set of latex is almost 300 megabytes. For example, my installation is near 0.5GB. The only optimal way is to install texlive-core and after that - some packages you need (you will now that they aren't installed in your system by latex error messages).
    – Eddy_Em
    May 6, 2013 at 10:17
  • thanks @Eddy_Em, I think texlive-core is better than full one
    – sakhunzai
    May 6, 2013 at 10:22

4 Answers 4

12

Almost every distro have its own package manager. Maintainers of any distro have their own point of view onto package building: its dependencies and its contents. So, for example, in Archlinux TeXLive is split onto many small packages. In Debian and Ubuntu, I think, it must be alike.

The smallest working set of LaTeX have volume about 300 megabytes. For example, my installation of TeXLive is near 0.5GB. The only optimal way is to install texlive-core and after that - some packages you need (you will know that they aren't installed in your system by latex error messages).

For example, package texlive-bin contains all binary files, but no style files; texlive-core contains main style files and some auxiliary utils. For using bibtex with different bibliography styles, you will need texlive-bibtex-extra. texlive-langcyrillic contains support of Cyrillic languages. For using different styles to include images into your file you will need texlive-pictures. Et cetera.

42

On Ubuntu 12.04:

sudo apt-get install texlive-latex-base

Seems to have got the job done in 175MB.

3
  • @Angus Carr, fair enough thanks. I assume debian Wheezy will also support that ?
    – sakhunzai
    Aug 15, 2013 at 5:25
  • 2
    It was only 91.9MB on Ubuntu 12.04.1 LTS. I spun up an EC2 box to compile my resume. It was worth the pennies. ;-) Jul 9, 2014 at 12:25
  • 92 mb downloaded, 226 mb used on disk with ubuntu 16.04. Sep 1, 2018 at 9:09
8

Because I rarely needed to use LaTeX, I used to use EC2 for compiling my documents. I liked that I could throw everything away when I was done, but the setup was time consuming. I found a better way.

Docker is a great tool for this because you don't have to make any changes to your main system. Here is a way to use a Docker image I created.

docker run -i richardbronosky/latex-compiler < document.tex > document.pdf

If you need supplementary files you can pipe in an uncompressed tar and it will be detected.

tar cf - *.tex *.sty | docker run -i richardbronosky/latex-compiler > document.pdf

If multiple documents to be created, it returns a tar file that you can expand.

tar cf - *.tex *.sty | docker run -i richardbronosky/latex-compiler --tar | tar x

If you need more (or less) LaTeX packages, you can clone the repo and modify the Dockerfile. Its current state is:

FROM ubuntu

MAINTAINER Bruno Bronosky <richard@bronosky.com>

RUN apt-get update

RUN apt-get install -y texlive-latex-recommended

ADD latexcat /usr/local/bin/latexcat
RUN chmod a+x /usr/local/bin/latexcat

ENTRYPOINT ["/usr/local/bin/latexcat"]
6
  • Thanks Bruno , question was to minimize the download(s).Do you have any stats on how much space this setups requires including all the tools (e.g Docker) ?
    – sakhunzai
    Mar 30, 2015 at 7:12
  • Actually, that is not the OP's concern as he specifies "1,801 MB of disk-space". It's a valid question, and I don't know the answer. Because of the software development I do, I'm going to have Docker (which is rather small) anyway. I'm not worried about bandwidth. I'm worried about disk space and bloating my system with software I don't often need and which may cause conflicts with things I do use often. I'll see if I can get some numbers for you, but the size of Docker is going to depend on your host OS. It's much leaner on Linux. Mar 30, 2015 at 13:56
  • I’m curious about which conflicts may be caused by a latex installation on an Ubuntu system..
    – gigabytes
    Dec 3, 2017 at 12:28
  • @gigabytes Here is an example from one of my Ubuntu 14.04 systems. gist.github.com/RichardBronosky/… Installing LaTeX would require 96 pages to be installed and 1 upgraded. Any of those packages could have different version requirements than what is on your system. In my specific case, libcups2 would get upgraded. Probably isn't a problem. But that's a LOT of changes to make to a system just to output a single document. Even if I used LaTeX daily, I'd do it with Docker. Jan 11, 2018 at 18:56
  • Yes, If you consider upgrading one package a big change, I suppose that makes sense ;)
    – gigabytes
    Jan 12, 2018 at 0:48
4

Depending on what packages your tex project uses, you can run sudo apt install texlive-latex-base or sudo apt install texlive-latex-recommended. The difference is that more libraries are included in the "recommended" version. Start with the base package which was 228 MB on my system (including dependencies). Then install the recommended version if you are missing packages -- pdflatex will tell you if you are missing packages. The recommended was 388 MB on my system. There also exists an "extra" version which I have never needed.

Edit: The sudo apt install texlive-latex-extra installation was 576 MB on my system. And I have actually needed it once or twice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.