安装最少的 LaTeX 后 moderncv 没有图标

安装最少的 LaTeX 后 moderncv 没有图标

我使用的是带有最少 LaTeX 安装的小图像。当我创建文档时moderncv,没有任何电话和邮件图标。我已经fontawesome在 Dockerfile 中添加了包,如下所示:

运行 tlmgr 安装 ctex moderncv fontawesome5 fontawesome academicons multirow arydshln && apk 更新 && apk 添加 rsync openssh sshpass && chmod +x cv-render && texhash

我确信 LaTeX 文档没有问题,因为我可以使用 LaTeX 完整安装来渲染图标。我遗漏了什么吗?这是 Dockerfile 如何构建 tex 环境:

# https://github.com/kjarosh/latex-docker
FROM kjarosh/latex:2023.1-small
LABEL org.reddwarf.image.authors="[email protected]"

ENV LANG=en_US.UTF-8 \
    LC_ALL=en_US.UTF-8 \
    TZ=Asia/Shanghai

WORKDIR /app
ENV ROCKET_ADDRESS=0.0.0.0
COPY --from=builder /home/rust/src/settings-production.toml /app/settings.toml
COPY --from=builder /home/rust/src/script /app/
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/cv-render /app/
RUN mkdir -p /usr/share/fonts/ && mkdir -p /app/config/ && mkdir -p /root/.ssh
COPY --from=builder /home/rust/src/texmf/tex/latex/ /opt/texlive/texmf-local/tex/latex/
COPY --from=builder /home/rust/src/config/font /usr/share/fonts/
COPY --from=builder /home/rust/src/log4rs.yaml /app/config/
COPY --from=builder /home/rust/src/config/ssh/known_hosts /root/.ssh/
RUN tlmgr install ctex moderncv fontawesome5 fontawesome academicons multirow arydshln && apk update && apk add rsync openssh sshpass && chmod +x cv-render && texhash
CMD ["sh","./startup-app.sh"]

这是我的文本文件:

\documentclass[10pt,a4paper,roman]{moderncv}

\moderncvstyle{classic}
\moderncvcolor{blue}

\usepackage{ctex}
\usepackage{fontspec}
\usepackage[scale=0.75]{geometry}

\setmainfont{lmroman10-regular.otf}
\setlength{\footskip}{149.60005pt}
\setlength{\hintscolumnwidth}{3cm}

\name{蒋}{小强}
\title{高级Java开发工程师-蒋小强}
\phone[mobile]{15576865433}
\email{[email protected]}
\social[stackoverflow]{https://stackoverflow.com/users/2628868/dolphin}
\social[github]{https://github.com/reddwarf}
\extrainfo{出生日期:1991年03月}

\begin{document}

\makecvtitle

\section{教育经历}

\cventry{2009.09--2013.06}{本科}{中国药科大学}{江苏南京}{信息管理与信息系统}{}
\section{工作经历}

\cventry{2023.07--2023.07}{Java开发工程师}{重庆红矮星科技有限公司}{重庆大足}{}{
\begin{itemize}
\item 开发和维护Java应用程序
\item 根据需求分析进行软件设计和编码
\item 负责对现有系统进行优化和改进
\item 解决软件开发过程中的技术难题
\item 参与软件架构设计和代码评审
\item 与团队成员合作,并按时交付高质量的代码
\item 针对系统性能进行测试和优化
\item 负责系统文档的编写和维护
\item 遵守公司的开发规范和流程要求
\item 研究和应用新的Java技术和工具
\item 参与软件项目的需求分析和评估
\item 协助解决客户的技术问题
\item 提供技术指导和培训给其他团队成员
\end{itemize}
}

\section{专业技能}

\section{项目经历}

\cventry{2023.07--2023.07}{桌游后台}{上海即维信息科技有限公司}{上海}{}{
\begin{itemize}
\item 参与桌游后台项目的需求分析和功能设计
\item 负责后台系统的数据库设计和优化
\item 开发后台系统的接口和业务逻辑
\item 参与项目的部署和维护工作
\item 参与中台系统的需求评审和功能开发
\item 负责中台系统的数据库设计和性能优化
\item 开发中台系统的接口和业务逻辑
\item 参与游戏的压力测试和性能优化
\item 修复项目中的 bug 和问题
\item 协助团队成员解决技术难题
\item 参与项目的进度跟踪和风险评估
\item 提供技术支持和培训给其他团队成员
\end{itemize}
}


\end{document}

这是生成的不包含图标的pdf:

在此处输入图片描述

这是日志输出,我没有发现此日志有任何异常:

Package microtype Info: No adjustment of kerning.
Package microtype Info: Loading generic protrusion settings for font family
(microtype)             `lmroman10-regular.otf' (encoding: TU).
(microtype)             For optimal results, create family-specific settings.
(microtype)             See the microtype manual for details.

Package fontspec Info: Adjusting the maths setup (use [no-math] to avoid
(fontspec)             this).

\symlegacymaths=\mathgroup4
LaTeX Font Info:    Overwriting symbol font `legacymaths' in version `bold'
(Font)                  OT1/cmr/m/n --> OT1/cmr/bx/n on input line 22.
LaTeX Font Info:    Redeclaring math accent \acute on input line 22.
LaTeX Font Info:    Redeclaring math accent \grave on input line 22.
LaTeX Font Info:    Redeclaring math accent \ddot on input line 22.
LaTeX Font Info:    Redeclaring math accent \tilde on input line 22.
LaTeX Font Info:    Redeclaring math accent \bar on input line 22.
LaTeX Font Info:    Redeclaring math accent \breve on input line 22.
LaTeX Font Info:    Redeclaring math accent \check on input line 22.
LaTeX Font Info:    Redeclaring math accent \hat on input line 22.
LaTeX Font Info:    Redeclaring math accent \dot on input line 22.
LaTeX Font Info:    Redeclaring math accent \mathring on input line 22.
LaTeX Font Info:    Redeclaring math symbol \colon on input line 22.
LaTeX Font Info:    Redeclaring math symbol \Gamma on input line 22.
LaTeX Font Info:    Redeclaring math symbol \Delta on input line 22.
LaTeX Font Info:    Redeclaring math symbol \Theta on input line 22.
LaTeX Font Info:    Redeclaring math symbol \Lambda on input line 22.
LaTeX Font Info:    Redeclaring math symbol \Xi on input line 22.
LaTeX Font Info:    Redeclaring math symbol \Pi on input line 22.
LaTeX Font Info:    Redeclaring math symbol \Sigma on input line 22.
LaTeX Font Info:    Redeclaring math symbol \Upsilon on input line 22.
LaTeX Font Info:    Redeclaring math symbol \Phi on input line 22.
LaTeX Font Info:    Redeclaring math symbol \Psi on input line 22.
LaTeX Font Info:    Redeclaring math symbol \Omega on input line 22.
LaTeX Font Info:    Redeclaring math symbol \mathdollar on input line 22.
LaTeX Font Info:    Redeclaring symbol font `operators' on input line 22.
LaTeX Font Info:    Encoding `OT1' has changed to `TU' for symbol font
(Font)              `operators' in the math version `normal' on input line 22.
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  OT1/cmr/m/n --> TU/lmroman10-regular.otf(0)/m/n on inpu
t line 22.
LaTeX Font Info:    Encoding `OT1' has changed to `TU' for symbol font
(Font)              `operators' in the math version `bold' on input line 22.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  OT1/cmr/bx/n --> TU/lmroman10-regular.otf(0)/m/n on inp
ut line 22.
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  TU/lmroman10-regular.otf(0)/m/n --> TU/lmroman10-regula
r.otf(0)/m/n on input line 22.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `normal'
(Font)                  OT1/cmr/m/it --> TU/lmroman10-regular.otf(0)/m/it on in
put line 22.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `normal'
(Font)                  OT1/cmr/bx/n --> TU/lmroman10-regular.otf(0)/b/n on inp
ut line 22.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `normal'
(Font)                  OT1/cmss/m/n --> TU/lmss/m/n on input line 22.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `normal'
(Font)                  OT1/cmtt/m/n --> TU/lmtt/m/n on input line 22.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  TU/lmroman10-regular.otf(0)/m/n --> TU/lmroman10-regula
r.otf(0)/b/n on input line 22.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `bold'
(Font)                  OT1/cmr/bx/it --> TU/lmroman10-regular.otf(0)/b/it on i
nput line 22.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `bold'
(Font)                  OT1/cmss/bx/n --> TU/lmss/b/n on input line 22.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `bold'
(Font)                  OT1/cmtt/m/n --> TU/lmtt/b/n on input line 22.
*geometry* driver: auto-detecting
*geometry* detected driver: xetex
*geometry* verbose mode - [ preamble ] result:
* driver: xetex
* paper: a4paper
* layout: <same size as paper>
* layoutoffset:(h,v)=(0.0pt,0.0pt)
* modes:
* h-part:(L,W,R)=(74.68848pt, 448.1309pt, 74.68849pt)
* v-part:(T,H,B)=(84.50467pt, 633.78513pt, 126.75705pt)
* \paperwidth=597.50787pt
* \paperheight=845.04684pt
* \textwidth=448.1309pt
* \textheight=633.78513pt
* \oddsidemargin=2.41849pt
* \evensidemargin=2.41849pt
* \topmargin=-24.76532pt
* \headheight=12.0pt
* \headsep=25.0pt
* \topskip=10.0pt
* \footskip=149.60005pt
* \marginparwidth=57.0pt
* \marginparsep=11.0pt
* \columnsep=10.0pt
* \skip\footins=9.0pt plus 4.0pt minus 2.0pt
* \hoffset=0.0pt
* \voffset=0.0pt
* \mag=1000
* \@twocolumnfalse
* \@twosidefalse
* \@mparswitchfalse
* \@reversemarginfalse
* (1in=72.27pt=25.4mm, 1cm=28.453pt)

Package hyperref Info: Link coloring OFF on input line 22.
\@outlinefile=\write4
\openout4 = `modern.out'.


Package hyperref Warning: Rerun to get /PageLabels entry.

\makecvheaddetailsbox=\box72

LaTeX Font Warning: Font shape `TU/lmroman10-regular.otf(0)/m/sl' undefined
(Font)              using `TU/lmroman10-regular.otf(0)/m/it' instead on input l
ine 24.


LaTeX Font Warning: Font shape `TU/lmroman10-regular.otf(0)/m/it' undefined
(Font)              using `TU/lmroman10-regular.otf(0)/m/n' instead on input li
ne 24.

LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <9> on input line 24.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <6> on input line 24.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <5> on input line 24.
(/opt/texlive/2023/texmf-dist/tex/latex/microtype/mt-cmr.cfg
File: mt-cmr.cfg 2013/05/19 v2.2 microtype config. file: Computer Modern Roman
(RS)
)
(/opt/texlive/2023/texmf-dist/tex/latex/microtype/mt-TU-empty.cfg
File: mt-TU-empty.cfg 2021/06/22 v1.1 microtype config. file: fonts with nonsta
ndard glyph set (RS)
)
\makecvheadpicturebox=\box73
\makecvheaddetailswidth=\skip107
\makecvheadpicturewidth=\skip108
\makecvheadnamebox=\box74


LaTeX Font Warning: Font shape `TU/lmroman10-regular.otf(0)/m/sl' undefined
(Font)              using `TU/lmroman10-regular.otf(0)/m/it' instead on input l
ine 24.


Underfull \hbox (badness 10000) in paragraph at lines 24--24

 []

LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <7> on input line 26.

LaTeX Font Warning: Font shape `TU/lmroman10-regular.otf(0)/b/n' undefined
(Font)              using `TU/lmroman10-regular.otf(0)/m/n' instead on input li
ne 28.


LaTeX Font Warning: Font shape `TU/lmroman10-regular.otf(0)/m/sl' undefined
(Font)              using `TU/lmroman10-regular.otf(0)/m/it' instead on input l
ine 28.


LaTeX Font Warning: Font shape `TU/lmroman10-regular.otf(0)/m/sl' undefined
(Font)              using `TU/lmroman10-regular.otf(0)/m/it' instead on input l
ine 47.


LaTeX Font Warning: Font shape `TU/lmroman10-regular.otf(0)/m/sl' undefined
(Font)              using `TU/lmroman10-regular.otf(0)/m/it' instead on input l
ine 68.

[1

] [2] (output/2023/7/96/38/1/modern.aux)

LaTeX Font Warning: Some font shapes were not available, defaults substituted.


LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.


Package rerunfilecheck Warning: File `modern.out' has changed.
(rerunfilecheck)                Rerun to get outlines right
(rerunfilecheck)                or use package `bookmark'.

Package rerunfilecheck Info: Checksums for `modern.out':
(rerunfilecheck)             Before: <no file>
(rerunfilecheck)             After:  322BEBFCABCA5EDBE025FC176AD1AC25;300.
 )
Here is how much of TeX's memory you used:
 29836 strings out of 478277
 632444 string characters out of 5839274
 1874482 words of memory out of 5000000
 49412 multiletter control sequences out of 15000+600000
 516400 words of font info for 77 fonts, out of 8000000 for 9000
 319 hyphenation exceptions out of 8191
 129i,13n,122p,1030b,485s stack positions out of 10000i,1000n,20000p,200000b,200000s

Output written on output/2023/7/96/38/1/modern.pdf (2 pages).

答案1

如果你添加\showoutput一个工作版本,你会看到

...........\TU/fontawesomefree/solid/n/9 glyph#562
...........\penalty 10000
...........\glue 2.997 plus 1.49849 minus 0.999
...........\special{pdf:bann<</Type/Annot/Subtype/Link/Border[0 0 0]/H/I/C[0 1 
1]/A<</S/U\ETC.}
...........\TU/lmroman10-regular.otf(0)/m/it/9 15576865433


...........\TU/fontawesomefree/regular/n/9 glyph#97
...........\penalty 10000
...........\glue 2.997 plus 1.49849 minus 0.999
...........\special{pdf:bann<</Type/Annot/Subtype/Link/Border[0 0 0]/H/I/C[0 1 
1]/A<</S/U\ETC.}
...........\TU/lmroman10-regular.otf(0)/m/it/9 [email protected]


...........\TU/fontawesomebrands/regular/n/9 glyph#112
...........\penalty 10000
...........\glue 2.997 plus 1.49849 minus 0.999
...........\special{pdf:bann<</Type/Annot/Subtype/Link/Border[0 0 0]/H/I/C[0 1 
1]/A<</S/U\ETC.}
...........\TU/lmroman10-regular.otf(0)/m/it/9 https://stackoverflow.com/users/
2628868/dolphin


...........\TU/fontawesomebrands/regular/n/9 glyph#97
...........\penalty 10000
...........\glue 2.997 plus 1.49849 minus 0.999
...........\special{pdf:bann<</Type/Annot/Subtype/Link/Border[0 0 0]/H/I/C[0 1 
1]/A<</S/U\ETC.}
...........\TU/lmroman10-regular.otf(0)/m/it/9 https://github.com/reddwarf

因此,与您的图像相比,有效的图标在\TU/fontawesomebrands/regular/n/9,而无效的图标在\TU/fontawesomefree/solid/n/9\TU/fontawesomefree/regular/n/9

所以添加

\expandafter\show\csname TU/fontawesomefree/regular/n/9\endcsname
\expandafter\show\csname TU/fontawesomefree/solid/n/9\endcsname

节目

\TU/fontawesomefree/regular/n/9=select font "[FontAwesome5Free-Regular-400.ot
f]:script=latn;" at 9.0pt.
> \TU/fontawesomefree/solid/n/9=select font "[FontAwesome5Free-Solid-900.otf]:s
cript=latn;" at 9.0pt.

因此你的最小安装缺失FontAwesome5Free-Regular-400.otfFontAwesome5Free-Solid-900.otf

相关内容