
방금 MacTex를 설치했고 다음과 같은 간단한 프로그램을 실행하고 있습니다.
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{dejavu}
\begin{document}
\setsansfont{DejaVu Sans}
\setromanfont{DejaVu Serif}
\setmonofont{DejaVu Sans Mono}
\begin{abstract}
This is the paper's abstract \ldots
\end{abstract}
\section{Introduction}
This is time for all good men to come to the aid of their party!
\end{document}
이 명령을 실행하면 다음과 같은 xelatex simple.tex
결과가 나타납니다.
This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./simple.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/texlive/2016/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2016/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))
(/usr/local/texlive/2016/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/local/texlive/2016/texmf-dist/tex/latex/euenc/eu1lmr.fd))
(/usr/local/texlive/2016/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/tipa/t3enc.def
(/usr/local/texlive/2016/texmf-dist/tex/latex/euenc/eu1lmss.fd))
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2016/texmf-dist/tex/xelatex/xetex-def/xetex.def
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)))))
(/usr/local/texlive/2016/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/local/texlive/2016/texmf-dist/tex/latex/dejavu/dejavu.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/dejavu/DejaVuSansMono.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/dejavu/DejaVuSans.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/dejavu/DejaVuSerif.sty))
(./simple.aux) (/usr/local/texlive/2016/texmf-dist/tex/latex/tipa/t3cmr.fd)
LaTeX Font Warning: Font shape `EU1/DejaVuSerif-TLF/m/n' undefined
(Font) using `EU1/lmr/m/n' instead on input line 6.
kpathsea:make_tex: Invalid fontname `DejaVu Sans', contains ' '
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "DejaVu Sans" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................
l.8 \setsansfont{DejaVu Sans}
dejavu
패키지가 설치되어 있는지 확인하기 위해 TexLive 유틸리티를 열었습니다 .
여기서 무슨 일이 일어나고 있는 걸까요?
답변1
Mac OS에서는 xetex + fontspec
글꼴 이름을 사용하는 경우 TeXLive 트리에서 OpenType 글꼴을 찾을 수 없습니다.
파일 이름을 사용하거나
또는 (가장 간단하고 일부에서 권장하는) 필요한 글꼴을 MacOS에서 인식하는 위치에 복사하면 됩니다.
~/Library/Fonts
또는 내부에 심볼릭 링크를 추가합니다
~/Library/Fonts
. 이것이 제가 한 번에 수행한 작업이며 각각 대상과 2개의 심볼릭 링크를 추가/Library/TeX/Root/texmf-dist/fonts/opentype
합니다/Library/TeX/Root/texmf-dist/fonts/truetype
. 이는 "texdist"와 같은 구조가 존재한다고 가정합니다. 이제 MacTeX에서 TeXLiveUtility를 통해 구현된다는 것을 알고 있지만 MacTeX는 TL2017에서 Mavericks와 같은 MacOS를 삭제하기로 결정했기 때문에 더 이상 MacTeX 사용자가 아니므로 위 이름 아래에 이러한 위치(자체 심볼릭 링크)가 존재하는지 100% 확신할 수 없습니다. 이 설정에는아니요연간 업데이트. LuaLaTeX에서는 문제가 발생하지 않습니다. 후자는 (을 통해luaotfload
) TeXLive에서 직접 동일한 글꼴을 찾기 위해 발생하는 중복 글꼴 데이터베이스를 잘라낼 수 있기 때문입니다. 트리 및 TeXLive 트리 레퍼토리를 대상으로 하는 두 명의 사용자가 공식 MacOS 위치에 위의 심볼릭 링크를 추가하여 간접적으로 사용했습니다.
답변2
kpathsea:make_tex: 잘못된 글꼴 이름 `DejaVu Sans', ' ' 포함
글꼴 이름에 공백이 있다고 뜹니다
Ubuntu의 경우 dejavu가 실제로 누락된 경우 다음을 사용하여 설치합니다.
sudo apt install fonts-dejavu*
또는 모든 texlive 글꼴을 설치하십시오.
sudo apt install texlive-fonts-recommended
sudo apt install texlive-fonts-extra
여기서 dejavu 글꼴도 찾았습니다https://ctan.org/pkg/dejavu. 필요한 파일이 포함된 zip 파일을 다운로드할 수 있었지만 texlive-fonts-extra
내 컴퓨터에서 'DejaVuSans.sty' 누락 문제가 해결되었기 때문에 설치하지 않았습니다. 하지만 설치하고 싶다면 다음 블로그를 확인하세요.https://nathanvan.wordpress.com/2012/06/14/managing-latex-packages-manually-in-ubuntu-12-04/
답변3
다음은 macOS에서 저에게 효과적이었습니다.
dejavu
패키지 페이지에서 패키지를 ZIP 파일로 다운로드 :https://ctan.org/tex-archive/fonts/dejavu이 문제를 해결하는 가장 쉬운 방법이었습니다.
dejavu
ZIP 파일에는 파일이 들어있는 폴더 가 있습니다 *.ttf
. 응용 프로그램을 열고 /Applications/Font Book.app
클릭하여 폴더를 +
가리켰습니다 dejavu/truetype
.
파일에 있는 Latex에 대한 Sphinx 구성은 다음과 같습니다 conf.py
.
...
'fontpkg': r'''
\setmainfont{DejaVu Sans}
\setsansfont{DejaVu Sans}
\setmonofont{DejaVu Sans Mono}
''',
apt install
Linux Ubuntu 20에서 작동하도록 하기 위해 Sawan Vaidya가 권장하는 명령을 사용했습니다 .