我的机器没有安装 TexLive。我设法从源代码构建了一个 XeTeX 二进制文件(步骤如何从源代码构建 XeTeX 和 dvipdfmx(TexLive 2020))
我现在正在尝试创建格式文件(我执行的完整脚本是这里)。我收到一条错误消息,xelatex -ini -etex latex.ltx
指出无法找到字体。字体位于./texlive
填充的目录中./install-tl
。
我如何指示xetex
二进制文件查看该目录?(我复制了cp xetex xelatex
)。
@DonHosek建议我为调试的这一部分创建一个单独的问题。更广泛的背景:我正在尝试更新过时的xetex-js和texlive.js到 TexLive 2020 以创建一个简单的浏览器内 LaTeX 渲染器。
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/10\endcsname=cmex10\relax
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
更新不知何故kpathsea
无法找到mktextfm
哪个$TEXLIVE_SOURCE_DIR/texk/texlive/linked_scripts/texlive
。如果我将其添加到 PATH,则./prefix/bin/kpsewhich
找不到mktex.opt
中的哪个./texlive/texmf-dist/web2c/mktex.opt
。./prefix/share/texmf-dist/web2c/texmf.cnf
对 一无所知./texlive
。我如何确保./prefix/bin/kpsewhich
可以发现./texlive
并生成格式文件?
答案1
我必须添加export TEXMFDIST=$PWD/texlive/texmf-dist
,以便kpsewhich
可以发现本机安装,如建议的那样https://github.com/lyze/xetex-js/issues/4#issuecomment-682257902。
我的完整脚本为了完整性:
# 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
```