Latex设置图片等资源文件和.bib 文件以及输出文件与 .tex文件不在同一目录
来源:互联网 发布:如何卸载mac上的app 编辑:程序博客网 时间:2024/06/07 08:53
环境:
xelatex --versionXeTeX 3.14159265-2.6-0.99991 (TeX Live 2014)bibtex --versionBibTeX 0.99d (TeX Live 2014)
OS:
OS X 10.9.4
目标:
设置图片等资源文件和.bib 文件以及输出文件与 .tex文件不在同一目录
folder ├─notes │ ├─sample.tex │ ├─sample │ │ ├─fig1.jpg │ │ └─fig2.jpg │ └─output │ ├─sample.aux │ ├─sample.bbl │ ├─sample.blg │ ├─sample.log │ ├─sample.out │ ├─sample.pdf │ ├─sample.synctex.gz │ └─sample.toc └─pdfs ├─refarticle.pdf └─refarticle.bib
引入图片等资源文件:
如何在编译 .tex 文件的时候找到图片等资源文件,只需要在引入图片的时候指定路径就可以了。如:
\begin{figure} \centering \includegraphics[scale=0.6]{sample/fig1.jpg} \caption{宋赵爽在《周髀算经》注中作的弦图(仿制),该图给出了勾股定理的一个极具对称美的证明。} \label{fig:xiantu}\end{figure}
引用文件 .bib:
对于 .bib 文件可以在\bibliography{path_to_bib_file/bibfile}
[1][3],当然如果每个都这样加就比较麻烦,另外一种方式对于 TeXLive 是设置环境变量 BIBINPUTS1 ,如:BIBINPUTS=.:/path-to-bibfile
。而 MiKTex 是 bibtex -include-directory=sty -include-directory=bib document.tex
[2][4]
输出目录:
使用 xelatex 的 -output-direcotry
选项设置
xelatex -output-directory=output sample.tex
bibtex 找不到 .aux 文件的错误
bibtex: Not writing to <project-path>/src.blg (openout_any = p). I couldn't open file name <project-path>/src.blg
修改 texmf.cnf 文件进行解决[5][6],将 openout_any = p
改为 openout_any = a
我的 OS X 10.9.2
位置是
/usr/local/texlive/2014/texmf-dist/web2c/texmf.cnf/usr/local/texlive/2014/texmf.cnf
经测试,下面那个优先级比较高,需要修改下面那个,这里改为 a
texmf.cnf
里也有说明:
% Allow Tex \openin, \openout, or \input on filenames starting with `.' % (e.g., .rhosts) or outside the current tree (e.g., /etc/passwd)? % a (any) : any file can be opened. % r (restricted) : disallow opening "dotfiles". % p (paranoid) : as `r' and disallow going to parent directories, and % restrict absolute paths to be under $TEXMFOUTPUT.
参考资料:
[1] http://tex.stackexchange.com/questions/120427/where-should-i-put-the-bib-file-to-use-it-directly-in-bibliographybibfile
[2] https://www.tug.org/pipermail/tex-live/2010-May/025698.html
[3] http://tex.stackexchange.com/questions/192917/include-all-bib-files-in-one-directory-to-a-bibliography
[4] http://tex.stackexchange.com/questions/120402/undefined-control-sequence-while-using-bib-file-for-references/120426#120426
[5] http://jansoehlke.com/2012/09/bibtex-going-openout_any-p/
[6] http://tex.stackexchange.com/questions/12686/how-do-i-run-bibtex-after-using-the-output-directory-flag-with-pdflatex-when-f
- Windows下未测试 ↩
- Latex设置图片等资源文件和.bib 文件以及输出文件与 .tex文件不在同一目录
- Latex----bib文件制作
- 关于DLL文件和EXE文件不在同一目录下的设置
- Latex引用bib文件步骤
- BIB文件
- bib 文件
- Latex中bib文件制作(参考文献制作)
- Latex中bib文件制作(参考文献制作)
- Latex中用bib文件添加参考文献
- Latex中bib文件制作(参考文献制作)
- latex中,.tex文件打不开的解决办法
- nginx的sbin和conf文件不在同一目录怎么装安全狗
- .md 文件和 .tex 文件编辑器
- 关于bib文件
- WINCE中的bib文件
- WINCE中的bib文件 .
- wince bib文件合成
- wince bib文件解析
- CODEVS 3162 抄书问题 (复制书稿)
- FLASH 模拟程序学习笔记(2)
- Android Service完全解析,关于服务你所需知道的一切(下)-进程间通信
- android 调试进阶
- leetcode--242-- Valid Anagram
- Latex设置图片等资源文件和.bib 文件以及输出文件与 .tex文件不在同一目录
- DataBinding
- JS 学习笔记
- Android 百度鹰眼轨迹SDK(v2.1.6)
- Java中自定义Exception异常
- 代码自动生成-宏递归思想
- 找工作——jvm复习(二)
- EvenBus3.0中文翻译(二)Priorities and Event Cancellation
- LeetCode 15 3Sum(尺取法或哈希)