Generalhow should I install a sty file in arch linux?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
latex_git
Posts: 8
Joined: Sat Sep 28, 2024 4:55 am

how should I install a sty file in arch linux?

Post by latex_git »

Hi,

As best I can tell my sty files are located in /usr/local/texlive/2024/texmf-dist/tex/latex/xxx, eg. my amsmath sty files are in the following directory:
/usr/local/texlive/2024/texmf-dist/tex/latex/amsmath

At the moment I (think) I would like to install titlesec.sty.(*)

I tried 'sudo pacman -Syu install texlive-titlesec' - pacman obliged by updating and installing various packages but, alas not titlsec.sty as far as I can see. (There's no /usr/local/texlive/2024/texmf-dist/tex/latex/titlesec directory and when I try to latex a file that requires it I get 'error: target not found: titlesec.sty')

I use emacs and command line for latex and I'm not familiar with any emacs tools that will sort this for me (maybe they exist but ...).

*: I want to use smallcaps in a section title, so my plan is to install titlesec.sty, maybe by downloading from https://ctan.org/pkg/titlesec?lang=en, and see if that works for me.

Thanks very much for any assistance.
Last edited by latex_git on Tue Feb 18, 2025 3:59 am, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: how should I install an sty file in arch linux?

Post by Stefan Kottwitz »

Hi,

on my Linux, the file is here:

/usr/local/texlive/2024/texmf-dist/tex/latex/titlesec/titlesec.sty

If you copy the files there, then run the texhash command.

Stefan
LaTeX.org admin
latex_git
Posts: 8
Joined: Sat Sep 28, 2024 4:55 am

Re: how should I install a sty file in arch linux?

Post by latex_git »

Thanks Stefan,
I copied the files in the package into /usr/local/texlive/2024/texmf-dist/tex/latex/titlesec, executed texhash, but I still get 'LaTeX Error: File `titlesec.sty' not found.'
I tried rebooting, same.
The preamble has '\usepackage[sc]{titlesec}'

Should I perhaps be installing in some other location in my system?

Is there maybe an easier way to use small capitals in section headings / titles?

(If I provide a full path for the file at the prompt I then get other errors, e.g. ! Package titlesec Error: No format for this command. ...
l.132 {\small \tableofcontents
}
)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: how should I install a sty file in arch linux?

Post by Stefan Kottwitz »

latex_git wrote: Sun Feb 16, 2025 1:31 pm Should I perhaps be installing in some other location in my system?
There's a quick and easy way: copy all titlesec files to the same location as your document, same folder/directory. That ensures that it can be found.
latex_git wrote: Sun Feb 16, 2025 1:31 pm Is there maybe an easier way to use small capitals in section headings / titles?
Yes, a modification of the sectioning command of your document class file (article?). However, you could do as above first, can be easier for other modifications.

In general, I would recommend
  • Use a KOMA-Script class, such modifications are very easy with the many class features.
  • Make a full TeX Live installation, so you never have to worry about missing packages or fonts. Make it from the original source tug.org/texlive, not from a Linux repository. But not now, wait for the new TeX Live 2025, coming March 8.
Stefan
LaTeX.org admin
latex_git
Posts: 8
Joined: Sat Sep 28, 2024 4:55 am

Re: how should I install a sty file in arch linux?

Post by latex_git »

Thanks Stefan,

I have some time to improve my knowledge / skills on this (Koma and full TeX Live installation). Could you recommend something for me to look at please?
- I see in an old (2nd ed) copy of the Latex Companion, a section (4.6) on 'Doing layout with class', would that be a good place to start re using a KOMA-script class?
- I see a bit of a plan for doing a full Tex Live installation at https://www.reddit.com/r/LaTeX/comments ... live_2025/. Is there something better I should look at? I'm pretty new to Arch linux, and I think I'm encountering problems because 'download and click' doesn't really cut it in Arch.
Edit: I'll read through https://tug.org/texlive/doc/texlive-en/texlive-en.html and have another look at the arch wiki (https://wiki.archlinux.org/title/TeX_Live) but I think I've previously found the latter a little too brief.

Kind regards

Stephen
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: how should I install a sty file in arch linux?

Post by Stefan Kottwitz »

Hi Stephen,
latex_git wrote: Mon Feb 17, 2025 2:47 am improve my knowledge / skills on this (Koma and full TeX Live installation)
Twenty years ago, also I was worried to learn a new class. However, I quickly noticed that it can be used like a standard class (scrartcl like article, scrbook like book, etc.) and they just provide more featured that I can ignore or use. With an old standard class (created about 30 years ago, a few bug fixes like 20 years ago, ...) some customization can be done adding 10 or 20 packages (or more) because of needed features, some hacks, ... but with KOMA-Script a lot can be adjusted with simple key=value class options. The KOMA-Script manual is an excellent reference, but also a good introduction to read. You can simply read it a while and decide if you want to use it.
latex_git wrote: Mon Feb 17, 2025 2:47 amI see in an old (2nd ed) copy of the Latex Companion, a section (4.6) on 'Doing layout with class', would that be a good place to start re using a KOMA-script class?
I don't have this book at hand right now (I bought the 3rd edition but that doesn't tell me what section you mean), but I would say, the best book is the KOMA-Script manual.
latex_git wrote: Mon Feb 17, 2025 2:47 amI see a bit of a plan for doing a full Tex Live installation at https://www.reddit.com/r/LaTeX/comments ... live_2025/. Is there something better I should look at?
I see you found https://wiki.archlinux.org/title/TeX_Live already. Yes, it's a short description, but it's not complicated to run the TeX Live installer, see also the TeX Live install page. Download and unpack the installer, run it, choose all you can. :-)

But perhaps do it after March 8, because, while TeX Live can be updated every day, the yearly upgrade requires a new installation (delete old, install new year's version). TeX Live 2024 will be frozen in March, then TeX Live 2025 gets updates for one year until March 2026. But no worries if you want to install TeX Live 2024 right now.

Stefan
LaTeX.org admin
latex_git
Posts: 8
Joined: Sat Sep 28, 2024 4:55 am

Re: how should I install a sty file in arch linux?

Post by latex_git »

Thanks again Stefan,
- had another look at arch wiki and I now think that covers it well;
- was using a scrartcl document class and smallcaps is fine now (wondering if perhaps my problems were due to using lmodern, can't quite remember why I started doing that).
All the best.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: how should I install a sty file in arch linux?

Post by Stefan Kottwitz »

Ah, very good, with scrartcl you don't need titlesec. You can simply set

\addtokomafont{section}{\scshape}

As you noticed that it did not work immediately: some font families don't have a combination of bold sans-serif small-caps shape, like the default font and Latin modern. Some have, you could test with

\usepackage{kpfonts}
or
\usepackage{newtxtext}

However, in my opinon, such bold sans-serif small-caps look too heavy. Possibly that's a reason it was not done and published. Even serifs would look lighter I guess. However, with all fonts, this should work fine:

\addtokomafont{section}{\mdseries\scshape}

It's a small-caps font, sans serif, in section font size.

Or with serifs:

\addtokomafont{section}{\rmfamily\scshape}

Stefan
LaTeX.org admin
Post Reply