I'm trying to set up a TexLive installation on Ubuntu to use with VimTex. I installed texlive and texlive-pictures, which should have all the packages I need for using circuitikz -which I need for my circuit analysis labs. However, I found that when I tried to compile my tex file to pdf using latexmk -pdf lab.pdf it gave me an error that xstring.sty couldn't be found.

I decided to wget from CTAN, unzip, and mktexlsr to make sure LaTeX knew where I installed it. It worked for xstring, but when I went back to try and compile again it said another package was missing: siunitx. I did the same steps for siunitx and found that the .sty wasn't already in the .zip file like it was for xstring. I attempted to compile using the latex command, and was bounced to another dependency, alphalph. This is probably the most frustrating part, I attempted to download and compile alphalph.dtx and it told me that it required alphalph.sty to compile!

This is the output of sudo latex alphalph.dtx

! LaTeX Error: File 'alphalph.sty' not found.
Type x to quit or <Return to proceed>,
or enter new name. (Default extension: sty)

This is my first pass at setting up LaTeX locally, usually, I just use Authorea or Overleaf. So far it has been quite frustrating. I have a feeling that there is something very basic that I am missing here. Any help would be appreciated.

  • 4
    `why did you get it from ctan? you are using texlive which means you almost never need to manually install like this, just install the package from texlive. – David Carlisle Feb 27 at 20:25
  • are you using the ubunto/debian packaged texlive? If so you can install the required latex packages via apt-get or whichever system package manager you use. If you are using the upstream texlive installed from tug, then use tlmgr. Not only does installing it by hand mean you have to manually get the steps in the right order you then have the additional complexity of making your locally installed version available without confusing the texlive package manager – David Carlisle Feb 27 at 20:28
  • That sounds like a much better idea, David. Unfortunately, my only response to "Why did you get it from ctan?" is personal ignorance. I'm used to online resources handling all this stuff for me. I searched a bit on SE and saw that the general solution was to find a package that already had the LaTeX packages I needed, like texlive-pictures. How would I go about installing via TexLive? – Kay Feb 27 at 20:29
  • see my next comment, are you using the ubuntu system texlive? – David Carlisle Feb 27 at 20:30
  • Joseph has answered the question you asked but if you are using the ubuntu texlive then sudo apt install texlive-pictures probably does what you need – David Carlisle Feb 27 at 20:34

Unpacking a .dtx to get the package and typesetting .dtx to see the documentation are different things. There are some set ups in which the .dtx will unpack as part of typesetting, but this is not guaranteed.

To unpack, one can use IniTeX, without any format at all. Normally, this is done by using a plain TeX program

tex <name>.ins


pdftex <name>.ins

The result will be one or more .sty files or similar. One can then typeset using

latex <name>.dtx

which will have the .sty available.

  • 1
    I've answered the 'headline' question, but I agree with comments on the question: this is something only developers tend to do (and even then only manually very very rarely). – Joseph Wright Feb 27 at 20:32
  • 1
    Thanks Joseph, this clarified my misunderstanding of how .dtx and .sty files are related! – Kay Feb 27 at 20:38

If you just want to use TeX and friends in the usual sense on your own computer, you shouldn't ever need to process .dtx files and you should use one of the various TeX distributions (e.g. TeX Live or Mac TeX). They come with essentially every package and allow for package updates.

Overleaf doesn't support processing .dtx files so although I use Overleaf quite a bit, especially for classes I teach, I still must do package development (which requires use of .dtx files) on my own local computer.

  • why can't you process dtx files on overleaf? you may need a latexmkrc to give it a bit of help but I don't see why there should be an issue (I either typesetting it or extracting things) – David Carlisle Feb 27 at 20:45
  • All I know is that I asked them about it and I was told it is not supported. Of course something may have changed in the past year. – LaTeXereXeTaL Feb 27 at 20:46
  • 2
    being not supported and not being possible are not the same thing at all:-) – David Carlisle Feb 27 at 20:48
  • True, but it means if I have trouble I'm on my own. If it is indeed possible I'd be interested in experimenting. – LaTeXereXeTaL Feb 27 at 20:50
  • Shall I delete my answer? – LaTeXereXeTaL Feb 27 at 20:51

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.