TransWikia.com

How to create a LaTeX format file without an existing TexLive install

TeX - LaTeX Asked on May 14, 2021

My machine does not have an existing TexLive install. I managed to build a XeTeX binary from sources (steps in How to build XeTeX and dvipdfmx from source (TexLive 2020))

I am now trying to create format files (complete script that I execute is here). I am getting an error from xelatex -ini -etex latex.ltx indicating that it can’t locate the fonts. Fonts are present in ./texlive directory populated by ./install-tl.

How do I instruct xetex binary to look into this directory? (I copied cp xetex xelatex).

@DonHosek suggested I create a separate question for this part of debugging. Broader context: I am trying to update outdated xetex-js and texlive.js to TexLive 2020 in order to create a simple in-browser LaTeX renderer.

Local config file preload.cfg used

=====================================
(base/preload.cfg (base/preload.ltx
kpathsea: Running mktextfm cmex10
mktextfm: No such file or directory
kpathsea: Appending font creation commands to missfont.log.

! Font OMX/cmex/m/n/10=cmex10 not loadable: Metric (TFM) file or installed fon
t not found.
<to be read again>
                   relax
l.41 ...ame OMX/cmex/m/n/10endcsname=cmex10relax
TEXLIVE_BASE_URL=http://mirrors.ctan.org/macros/latex/base.zip
TEXLIVE_INSTALLER_URL=http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz

# path to my newly built xetex
XELATEX_EXE=$PWD/prefix/bin/xelatex

mkdir -p texlive
echo selected_scheme scheme-basic > texlive/profile.input
echo TEXDIR $PWD/texlive >> texlive/profile.input
echo TEXMFLOCAL $PWD/texlive/texmf-local >> texlive/profile.input
echo TEXMFSYSVAR $PWD/texlive/texmf-var >> texlive/profile.input
echo TEXMFSYSCONFIG $PWD/texlive/texmf-config >> texlive/profile.input
echo TEXMFVAR $PWD/home/texmf-var >> texlive/profile.input

wget $TEXLIVE_INSTALLER_URL
pushd texlive
tar xzvf ../install-tl-unx.tar.gz
./install-tl-*/install-tl -profile profile.input
rm -rf bin readme* tlpkg install* *.html texmf-dist/doc texmf-var/web2c
echo "Done! Please run 'make texlive.lst' now!"
popd

wget $TEXLIVE_BASE_URL

mkdir -p latex_format
pushd latex_format
unzip -o ../base.zip
pushd base
$XELATEX_EXE -ini -etex unpack.ins
$XELATEX_EXE -ini -etex latex.ltx

UPDATE somehow kpathsea cannot find mktextfm which is in $TEXLIVE_SOURCE_DIR/texk/texlive/linked_scripts/texlive. If I add it to PATH, then ./prefix/bin/kpsewhich cannot find mktex.opt which is in ./texlive/texmf-dist/web2c/mktex.opt. ./prefix/share/texmf-dist/web2c/texmf.cnf does not know anything about ./texlive. How do I make sure that ./prefix/bin/kpsewhich can discover ./texlive and produce format files?

One Answer

I had to add export TEXMFDIST=$PWD/texlive/texmf-dist, so that kpsewhich can discover the native install as suggested in https://github.com/lyze/xetex-js/issues/4#issuecomment-682257902.

My complete script is for completeness:

# http://www.linuxfromscratch.org/blfs/view/svn/pst/texlive.html
# https://www.tug.org/texlive/build.html
# https://www.tug.org/texlive/doc/tlbuild.html#Build-one-engine

export MAKEFLAGS=-j20

TEXLIVE_TEXMF_URL=ftp://tug.org/texlive/historic/2020/texlive-20200406-texmf.tar.xz
TEXLIVE_SOURCE_URL=ftp://tug.org/texlive/historic/2020/texlive-20200406-source.tar.xz
TEXLIVE_TLPDB_URL=ftp://tug.org/texlive/historic/2020/texlive-20200406-tlpdb-full.tar.gz
TEXLIVE_BASE_URL=http://mirrors.ctan.org/macros/latex/base.zip
TEXLIVE_INSTALLER_URL=http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
TEXLIVE_SOURCE_DIR=$PWD/texlive-20200406-source

ROOT=$PWD
TEXLIVE=$PWD/texlive
PREFIX=$PWD/prefix
CACHE=$PWD/config.cache
XELATEX_EXE=$PREFIX/bin/xelatex
XETEX_EXE=$PREFIX/bin/xetex
mkdir -p $PREFIX

wget --no-clobber $TEXLIVE_SOURCE_URL
tar -xvf $(basename $TEXLIVE_SOURCE_URL)
cd $TEXLIVE_SOURCE_DIR
mkdir -p texlive-build
cd texlive-build


#  --disable-dvipng                                 
#  --disable-dvisvgm                            
#  --disable-dvi2tty                            
#  --disable-luatex                              
#  --disable-luajittex                           
#  --disable-luahbtex                            
#  --disable-luajithbtex                         
#  --disable-mflua                               
#  --disable-mfluajit                            
#  --disable-etex                               
#  --disable-detex                              
#  --disable-lcdf-typetools                         
#  --disable-ps2eps                                 
#  --disable-psutils                            
#  --disable-t1utils                            
#  --disable-texinfo                            
#  --disable-xindy                              
#  --disable-biber                              

../configure                                    
  --cache-file=$CACHE                           
  --prefix=$PREFIX                              
  --enable-static                               
  --enable-xetex                                
  --enable-dvipdfm-x                            
  --disable-shared                              
  --disable-multiplatform                       
  --disable-native-texlive-build                
  --disable-all-pkgs                            
  --without-x                                   
  --without-system-cairo                        
  --without-system-gmp                          
  --without-system-graphite2                    
  --without-system-harfbuzz                     
  --without-system-libgs                        
  --without-system-libpaper                     
  --without-system-mpfr                         
  --without-system-pixman                       
  --without-system-poppler                      
  --without-system-xpdf                         
  --without-system-icu                          
  --without-system-fontconfig                   
  --without-system-freetype2                    
  --without-system-libpng                       
  --without-system-zlib                         
  --with-banner-add=" - BLFS"

make $MAKEFLAGS
make $MAKEFLAGS install
cd texk/web2c
make $MAKEFLAGS xetex
cp xetex $XETEX_EXE
cp $XETEX_EXE $XELATEX_EXE

cd $ROOT
mkdir -p $TEXLIVE
echo selected_scheme scheme-basic > $TEXLIVE/profile.input
echo TEXDIR $TEXLIVE >> $TEXLIVE/profile.input
echo TEXMFLOCAL $TEXLIVE/texmf-local >> $TEXLIVE/profile.input
echo TEXMFSYSVAR $TEXLIVE/texmf-var >> $TEXLIVE/profile.input
echo TEXMFSYSCONFIG $TEXLIVE/texmf-config >> $TEXLIVE/profile.input
echo TEXMFVAR $PWD/home/texmf-var >> $TEXLIVE/profile.input
wget --no-clobber $TEXLIVE_INSTALLER_URL
cd $TEXLIVE
tar xzvf ../install-tl-unx.tar.gz
./install-tl-*/install-tl -profile $TEXLIVE/profile.input
rm -rf bin readme* tlpkg install* *.html texmf-dist/doc texmf-var/web2c

cd $ROOT
export TEXMFDIST=$PWD/texlive/texmf-dist
wget --no-clobber $TEXLIVE_BASE_URL
mkdir -p latex_format
cd latex_format
unzip -o ../base.zip
cd base
$XELATEX_EXE -ini -etex unpack.ins
touch hyphen.cfg
$XELATEX_EXE -ini -etex latex.ltx
                                                                            ```

Correct answer by Vadim Kantorov on May 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP