config which texlive is installed?
George Georgalis
george at galis.org
Tue Jul 9 01:50:32 CEST 2024
Thanks for the input Herbert!
tlmgr --version provides the info I was looking for; I didn't know about
that program and it looks useful for other operations too.
As a bit of context, I'm approaching texlive software from a systems
engineering perspective with the following precepts; users know best their
requirements, they should have ultimate control of their env, and they
should not have root. Likewise, management of $HOME, /usr/local/, and /usr
have distinct and specific management protocols. Many tex users may use
root to manage their environment, which is fine. However, in environments
where there are separate authorizations for system vs user changes, it is
expedient to empower users to meet their needs, according to the policy
which applies to them.
That is a somewhat long way of saying, the use of multiple prefixes enables
simultaneous installation of multiple software versions from which users
can select or extend according to their needs.
Hopefully, we still have consensus. Developing my doc for user-installed
true type fonts, TTF files, my path discovery effort (no pun) was
convoluted. Initially I discovered ~/Library/texlive/2023/texmf-config/ and
presumed the versioned path was required, according to the TexLive prefix
in use. Then LLM convinced me ~/Library/texlive/texmf would be better, I
have since confirmed the year must be included in the texlive path, and
contrary to the pdf section Installing fonts in the Personal Tree, which
indicates $HOME/Library/texmf/texmf-config/web2c for the updmap.cfg file
(and contrary for reasons that are not immediately obvious to me). For
system-installed TeX Live distributions, I believe this is correct (not all
regressions tested):
Mac:
User's personal TeX tree: ~/Library/texmf
User's config for system TeX Live: ~/Library/texlive/{version}/texmf-config
Linux:
User's personal TeX tree: ~/texmf
User's config for system TeX Live: ~/.texlive/{version}/texmf-config
This is my guidance for user installed TTF files (Mac confirmed):
h3: "True Type Fonts in TexLive"
p: |
Adding True Type Fonts to a Latex user environment is easy with the
autoinst program,
from https://ctan.org/tex-archive/fonts/utilities/fontools/ and
bundled with TexLive,
only a few manual steps are required. These instructions are for a
user env install (and the sudo root averse). The steps are
1) populating a directory with the (.ttf) font files,
2) running the autoinst command on the font files,
3) creating map config data,
4) running texhash and updmap, and
5) confirming available fonts, weights, and shapes, with a demo tex
file.
p: |
Obtain your TTF files, typically distributed within a zip file.
Create a directory `{FontName}` and extract the TTF files into it.
p: |
A TeX and Metafont directory `texmf` is used to store fonts and
styles.
On Darwin, `mkdir -p ~/Library/texmf/fonts/truetype`
other posix systems, use `mkdir -p ~/texmf/fonts/truetype`
Throughout this document the `./texmf` directory refers to the path
on your system.
Move the `{FontName}` directory with the ttf files into the
`./texmf/fonts/truetype` directory.
p: |
Use the autoinst command to install the font, there are many
options but you are probably
only interested in -serif/-sanserif/-typewriter, group your fonts
in these categories,
then use wildcards to install each group together with the
corresponding option, eg
<pre>
autoinst -serif ./texmf/fonts/truetype/{FontName}/*{serif}*.ttf
autoinst -sanserif
./texmf/fonts/truetype/{FontName2}/*{sanserif}*.ttf
autoinst -typewriter ./texmf/fonts/truetype/{FontName3}/*{mono}*.ttf
</pre>
If you don't use this option autoinst may incorrectly guess the
font type.
p: |
The next step is difficult to explain, but the script should take
care of it.
Set the paths and create the dir, before writing a updmap.cfg file
with the map files created by autoinst.
<pre>
v="$(tlmgr --version | sed -e '/version/!d' -e 's/.*version //')"
case $(uname) in
Darwin) a="$HOME/Library/texmf/fonts/map"
b="$HOME/Library/texlive/$v/texmf-config/web2c" ;;
Linux) a="$HOME/texmf/fonts/map"
b="$HOME/.texlive/$v/texmf-config/web2c" ;;
esac
[ -d "$a" ] && { mkdir -p "$b"
find "$a" -type f -name \*map -exec basename \{\} \; \
| sed 's/^/Map /' >"$b/updmap.cfg" ;}
</pre>
p: |
Rebuild the ls-R filename databases with texhash, and
configure the user env fonts (and administratively installed fonts)
with the updmap command, this step may take tens of seconds
(repeat this step in the future to add new administratively
installed fonts).
<pre>
texhash ./texmf (Mac: texhash ~/Library/texmf)
updmap --user
</pre>
p: |
Use the font in your document, reference the style package file
(.sty) and use the respective font commands. For package name hints,
<pre>
find ./texmf/tex/latex/ -mtime -1 -name \*sty -exec grep
ProvidesPackage \{\} \;
</pre>
It is unclear why tex has difficulty scanning both user and
administratively installed styles at runtime, but in my world the simple
solution is letting users run 'texhash ./texmf && updmap --user' when they
install new fonts, or want to uplift to administratively installed styles.
Maybe in 2025 we will be able to use
$HOME/Library/texmf/texmf-config/web2c/...
For completeness, I'll add some comments on TexLive MacTex symlinks, which
have been less than intuitive:
/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/universal@ ->
../../../../../../../usr/local/texlive/2024/bin/universal-darwin
I found the simplest way to prevent unsettling of users, is to have them
adjust their path, remove the "current" symlink and replace it with their
specific version of choice, eg
PATH=$(echo "$PATH" | sed 's=\(/Library/TeX/texbin\)=x\1=')
texlive=/usr/local/texlive/2024/bin/universal-darwin
test -d "$texlive" && PATH="$texlive:$PATH"
I know there have been problems in the past handing off texlive releases
and updates to other OS package managers, and I wish I could devote time to
smoothing that out. For now, this hopefully will simplify installing latex
true type fonts, for some.
-George
On Sun, Jul 7, 2024 at 2:11 PM Herbert Schulz <herbs2 at mac.com> wrote:
>
>
> > On Jul 7, 2024, at 2:14 PM, George Georgalis <george at galis.org> wrote:
> >
> > Hello!
> >
> > I have over 20 years experience using latex, generally just preparing
> > basic documents, but lately I've been trying AI LLM, with mixed
> > results for macro development of various tasks. Anyone reading this is
> > probably already aware of the challenge, there are more shortsighted
> > solutions for a rendering task than optimal ones, and the multitude of
> > solution options muddle the question of which is best, in the sea of
> > first working vs non-working options.
> >
> > Recently, I decided to revisit the task of installing fonts and
> > documenting the process for users who are not necessarily able to
> > become root. While the updmap step can be confusing if your
> > documentation does not align with site practice; I have found the
> > steps are not complicated, if the site process is established before
> > the documentation.
> >
> > When I completed a careful explanation of the steps with my MacTex
> > 2023 install, and using a shell function for managing the step users
> > don't need to understand (creating and enabling map cfg files), I
> > decided to test the guidance with a fresh MacTex 2024 install. But, it
> > seems some critical path management has changed?
> >
> > The symlinks relating to the support of multiple texlive installs
> > seems overly complicated, but I don't have an opinion about changing
> > that. What I am concerned with is: 1) How should a user determine
> > which texlive version they are using? 2) How should a user configure
> > the use of a different installed version? 3) What is the best way to
> > determine the texmf-config/web2c/updmap.cfg path (eg
> > ~/Library/texlive/2023/texmf-config/web2c/updmap.cfg)?
> >
> > It would seem `/Library/TeX/Distributions/.DefaultTeX/Contents` is the
> > pivot, but I am looking for a more deterministic way to identify the
> > appropriate placement of web2c/updmap.cfg, I had been using the
> > command `which autoinst` but that no longer provides the needful info.
> > Please copy me on replies, I'm not subscribed to the list.
> >
> > -George
> >
> >
> > --
> > George Georgalis, (415) 894-2710, http://www.galis.org/
>
> Howdy,
>
> Assuming the installation is MacTeX, you should have TeX Live Utility
> (TLU), a gui interface to tlmgr and other things MacTeX. Under the
> Configure menu in (TLU) you can choose the `Change Default Live Version…'
> which will bring up a window showing the versions that have been detected
> and the present active version shown. You can change the active version
> there but you'll need admin privileges. Simple pressing the Done button
> dismisses the window.
>
> You should NOT chnage anything is the distribution itself. There are two
> placess to add fonts.
>
> The first is in the texmf-local tree which allows you to add fonts to be
> be used by all users of the system. You need admin privileges to this but
> this is the much preferred location to add fonts. You can get to
> texmf-locat via the /Library/TeX/Local symlink (no need to to go though
> that complex structure).
>
> The second and less preferred method is to use the user's personal tree
> located in ~/Library/texmf (this tree is not created at install time so you
> need to create texmf (and internal paths) in ~/Library yourself. Fonts
> installed in the personal tree can only be used by that user. The only
> advantage (and there are real disadvantages to doing this) is that you
> don't need admin privileges to do things there since the user owns those
> files
>
> I enclose a short document that contains information about thw two install
> locations and what changes in dealing with them are needed.
>
>
>
> I hope this helps.
>
> Good Luck,
>
> Herb Schulz
> herbs2 at mac.com
>
>
>
--
George Georgalis, (415) 894-2710, http://www.galis.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/mactex-support/attachments/20240708/66448a94/attachment.htm>
More information about the mactex-support
mailing list.