all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* using texlive class from a private texmf tree
@ 2019-11-26 13:36 Myles English
  2019-12-04 20:33 ` Andreas Enge
  0 siblings, 1 reply; 4+ messages in thread
From: Myles English @ 2019-11-26 13:36 UTC (permalink / raw)
  To: help-guix

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-08 14:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-26 13:36 using texlive class from a private texmf tree Myles English
2019-12-04 20:33 ` Andreas Enge
2019-12-06 11:31   ` Myles English
2019-12-08 14:30     ` Andreas Enge

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.