From: Myles English <mylesenglish@gmail.com>
To: help-guix <help-guix@gnu.org>
Subject: using texlive class from a private texmf tree
Date: Tue, 26 Nov 2019 13:36:57 +0000 [thread overview]
Message-ID: <87blsysqun.fsf@gmail.com> (raw)
Hello guix,
I don't know if the problem I am having is with texlive or Guix.
How do I use my own (xe)latex class with the guix texlive? Why does
using a private texmf.cnf to specify the path to my class not work?
Does anyone have a setup that works or any suggestions what else can be
tried?
In what follows I try to put my private latex tree under ~/.texmf but
have also tried it under ~/texmf with the same results. This is on Arch
Linux with a recent guix.
This is what is installed:
$ guix package -I | grep tex
texlive-bin 20180414 out /gnu/store/x9c77i6r5fmarslij6ng81awgrxblplm-texlive-bin-20180414
texlive 20180414 out /gnu/store/7mxkdn6cp7x8sac49p2g80qw5j1aavi3-texlive-20180414
texlive-latex-koma-script 49435 out /gnu/store/fgk6c4xqs6vzhsnkslid88hmy4czyk21-texlive-latex-koma-script-49435
texlive-base 49435 out /gnu/store/6n4hmllzljyv8ai63k7dgslza7sl3kzi-texlive-base-49435
$ which -a xelatex
/home/myles/.guix-profile/bin/xelatex
Set up directories:
#+begin_src sh
mkdir -p ~/.texmf/tex/latex/mytest
mkdir ~/tmp/tex
#+end_src
Create these test files:
#+begin_src sh :tangle ~/.texmf/tex/latex/mytest/my-class.cls
\ProvidesClass{my-class}
\NeedsTeXFormat{LaTeX2e}
\LoadClass[11pt]{article}
\pagestyle{plain}
#+end_src
#+begin_src sh :tangle ~/tmp/tex/a.tex
\documentclass{my-class}
\begin{document}
\end{document}
#+end_src
Check there are no environment variables that might effect things:
$ env | grep TEX
[nothing]
$ source ~/.guix-profile/etc/profile
$ env | grep TEX
TEXMF=/gnu/store/bmdzgjxr0xjyz03gislmwvv1p8vid8qp-profile/share/texmf-dist
TEXMFCNF=/gnu/store/bmdzgjxr0xjyz03gislmwvv1p8vid8qp-profile/share/texmf-dist/web2c
$ kpsewhich -all -var-value TEXMF
/gnu/store/bmdzgjxr0xjyz03gislmwvv1p8vid8qp-profile/share/texmf-dist
$ kpsewhich -all -var-value TEXMFCNF
/gnu/store/bmdzgjxr0xjyz03gislmwvv1p8vid8qp-profile/share/texmf-dist/web2c
$ grep "^TEXMF " `kpsewhich -all -var-value TEXMFCNF`/texmf.cnf
TEXMF = $TEXMFROOT/share/texmf-dist
It it not going to find my-class.cls unless the path TEXMF in the texmf.cnf
(above) is changed. So making a private texmf.cnf file as recommended in [1],
and noting that "definitions in earlier files override those in later files"
[2]:
#+begin_src sh :tangle ~/.texmf/web2c/texmf.cnf
TEXMFHOME = $HOME/.texmf
TEXMF = {$TEXMFHOME,$TEXMFROOT/share/texmf-dist}
#+end_src
Change TEXMFCNF so it should be found:
$ export TEXMFCNF={$HOME/.texmf/web2c,/home/myles/.guix-profile/share/texmf-dist/web2c}
Check to see if that variable has been adopted by texlive:
$ kpsewhich -all -var-value TEXMFCNF
{/home/myles/.texmf/web2c,/home/myles/.guix-profile/share/texmf-dist/web2c}
$ kpsewhich -show-path=cnf
/home/myles/.texmf/web2c:/home/myles/.guix-profile/share/texmf-dist/web2c
But when I check TEXMF it has not changed:
$ kpsewhich -all -var-value TEXMF
/gnu/store/bmdzgjxr0xjyz03gislmwvv1p8vid8qp-profile/share/texmf-dist
However, TEXMF is also an environment variable set in
~/.guix-profile/etc/profile. Try compiling the test file anyway:
$ cd ~/tmp/a
$ xelatex a
#+begin_quote
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./a.tex
LaTeX2e <2018-04-01> patch level 2
! LaTeX Error: File `my-class.cls' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)
Enter file name:
#+end_quote
Well that didn't work. Try unsetting the environment variable TEXMF first:
$ unset TEXMF
$ kpsewhich -all -var-value TEXMF
{/home/myles/.texmf,/gnu/store/b28kk24c3b0hspzb4787xb50mf074l0g-texlive-configuration/share/share/texmf-dist}
$ kpsewhich -show-path=cnf
/home/myles/.texmf/web2c:/home/myles/.guix-profile/share/texmf-dist/web2c
$ cd ~/tmp/tex
$ xelatex a
#+begin_quote
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex)
restricted \write18 enabled.
kpathsea: Running mktexfmt xelatex.fmt
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_MESSAGES = "",
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order):
mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes:
mktexfmt: /home/myles/.texlive2018/texmf-config/web2c/fmtutil.cnf
mktexfmt [INFO]: writing formats under /home/myles/.texlive2018/texmf-var/web2c
mktexfmt [INFO]: did not find entry for byfmt=xelatex, skipped
mktexfmt [INFO]: Total formats: 0
mktexfmt [INFO]: exiting with status 0
I can't find the format file `xelatex.fmt'!
#+end_quote
Thanks,
Myles
[1] https://texfaq.org/FAQ-privinst
[2] https://tug.org/texinfohtml/kpathsea.html#Config-files
next reply other threads:[~2019-11-26 13:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-26 13:36 Myles English [this message]
2019-12-04 20:33 ` using texlive class from a private texmf tree Andreas Enge
2019-12-06 11:31 ` Myles English
2019-12-08 14:30 ` Andreas Enge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87blsysqun.fsf@gmail.com \
--to=mylesenglish@gmail.com \
--cc=help-guix@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).