在工作中,我已在Ubuntu 14.04.1计算机上设置了一个小备份脚本。该脚本将我的计算机备份到外部硬盘驱动器。完成此操作后,它将LaTeX项目复制到我的Dropbox并进行编译。这个项目是我工作的日志。
我知道这是一个非常常规的用例,我可以复制源代码或将其推送到git repo,但首先git会有点过大,其次我已经很高兴有两个实例了当我不得不启动tty shell时(因为gnome无法启动),在手机上以pdf格式显示它。
现在的问题是,由于某种原因,pdflatex和lualatex都告诉我它们找不到.sty
文件。备份脚本如下:
#!/bin/bash
# .... some system backup code ....
## sync linux setup document to Dropbox
# remove .pdf in order to guarantee that project is compiled
rm /home/user/Documents/LaTeX/logBook/logBook.pdf
# compile project in origin
make -C /home/user/Documents/LaTeX/logBook/ >> /home/user/Documents/LaTeX/logBook/makeLog
# copy files to destination
cp -rp /home/user/Documents/LaTeX/logBook/ /home/wright/Dropbox
并且我Makefile
包含以下几行:
SHELL=bash
TARGET=linuxSetup.pdf
FLAGS= --shell-escape
SRC= ./*.tex ./header/*.tex ./chapters/*.tex ./references/*.bib ./titlepage/*.tex
TIKZ= ./tikz/*.tex
LL= pdflatex
all: $(TARGET)
$(TARGET): $(TARGET:%.pdf=%.tex) $(SRC) $(TIKZ)
@$(LL) $(FLAGS) $<
# makeglossaries $(TARGET:%.pdf=%"")
# makeindex -s headingsStyle.ist $(TARGET:%.pdf=%.idx)
# bibtex $(TARGET:%.pdf=%"")
@$(LL) $(FLAGS) $<
@$(LL) $(FLAGS) $<
备份脚本放置在中,/etc/init.d/backup
并包含指向的符号链接/etc/rc0.d/S01Backup
。
脚本很简单,但是仍然找不到.sty
文件。我试图排除.sty
文件,以找出问题是否是由特定文件引起的,但是无论我排除了多少文件,总会有更多编译器找不到的文件。我切换了编译器,但这似乎也不是问题。另外,我sudo
以root用户身份或以root用户身份执行了完整的备份脚本,两者都工作得很好,没有任何错误。
我想念什么?
编辑:这是输出的最后一位:
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/share/texlive/texmf-dist/tex/latex/cite/cite.sty)
(/usr/share/texlive/texmf-dist/tex/latex/mh/empheq.sty
(/usr/share/texlive/texmf-dist/tex/latex/mh/mhsetup.sty)
(/usr/share/texlive/texmf-dist/tex/latex/mh/mathtools.sty
(/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty)))
(/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fancybox/fancybox.sty
Style option: `fancybox' v1.4 <2010/05/15> (tvz)
) (/usr/share/texlive/texmf-dist/tex/latex/float/float.sty)
! LaTeX Error: File `floatflt.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
floatflt.sty
有问题的文件位于texlive安装目录中/usr/local/texlive/2015/texmf-dist/tex/latex/floatflt
。但是,它在上面找到的其他软件包位于中/usr/share/texlive/texmf-dist/tex/latex/<packagename>
。
您有两个texlive安装。一个由系统(Ubuntu)/usr/share/texlive/
安装在用户中以及用户安装在上的/usr/local/texlive/2015/texmf-dist/tex/latex
。
在您的关闭脚本中,环境变量未调整,因此使用了错误的texlive安装。
尝试/usr/local/texlive/2015/bin/x86_64-linux/pdflatex
直接调用或相应地调整PATH
环境变量。
floatflt.sty
过去存在一些许可证问题。这可能是原因,为什么它没有包含在Ubuntu的texlive安装中。您可以尝试更改为wrapfig
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句