
에 대한 후속 질문입니다.통화 기호: 프랑스 프랑.
다음 예를 고려하십시오.
\documentclass{article}
\usepackage{fontspec}
\usepackage{siunitx}
\DeclareRobustCommand*{\myfranc}{%
\begingroup
\fontspec{FreeSerif.otf}%
^^^^20a3%
\endgroup
}
\DeclareSIUnit{\franc}{\myfranc}
\setmainfont[
BoldFont = lmroman10-bold.otf,
ItalicFont = lmroman10-italic.otf,
BoldItalicFont = lmroman10-bolditalic.otf,
SlantedFont = lmromanslant10-regular.otf,
BoldSlantedFont = lmromanslant10-bold.otf,
SmallCapsFont = lmromancaps10-regular.otf
]{lmroman10-regular.otf}
\begin{document}
\SI{1000}{\franc}
\end{document}
이것은 (Heiko Oberdiek의 마지막 제안입니다.답변) 이전에는 작동했지만 더 이상 작동하지 않습니다. 이제 단위(프랑스 프랑 기호)가 아닌 수량만 인쇄됩니다. 이 문제를 어떻게 해결합니까?
또한 다음 글꼴 경고를 어떻게 제거합니까?
\normalsize
입력 라인 26의 수학 모드에서는 명령이 유효하지 않습니다.
답변1
이 명령은 \fontspec
문서에서 절대 사용해서는 안 됩니다. 글꼴 모음을 정의하고 사용하세요.
\documentclass{article}
\usepackage{fontspec}
\usepackage{siunitx}
\DeclareRobustCommand*{\myfranc}{%
\mbox{\freeserif^^^^20a3}%
}
\DeclareSIUnit{\franc}{\myfranc}
\setmainfont[
BoldFont = lmroman10-bold.otf,
ItalicFont = lmroman10-italic.otf,
BoldItalicFont = lmroman10-bolditalic.otf,
SlantedFont = lmromanslant10-regular.otf,
BoldSlantedFont = lmromanslant10-bold.otf,
SmallCapsFont = lmromancaps10-regular.otf
]{lmroman10-regular.otf}
\newfontfamily{\freeserif}{FreeSerif.otf}
\begin{document}
\SI{1000}{\franc}
\end{document}
₣
원하는 경우 직접 입력할 수도 있습니다 .
\documentclass{article}
\usepackage{fontspec}
\usepackage{siunitx}
\usepackage{newunicodechar}
\setmainfont[
BoldFont = lmroman10-bold.otf,
ItalicFont = lmroman10-italic.otf,
BoldItalicFont = lmroman10-bolditalic.otf,
SlantedFont = lmromanslant10-regular.otf,
BoldSlantedFont = lmromanslant10-bold.otf,
SmallCapsFont = lmromancaps10-regular.otf
]{lmroman10-regular.otf}
\newfontfamily{\freeserif}{FreeSerif.otf}
\newunicodechar{₣}{\text{\freeserif ₣}}
\newcommand{\FF}{₣}
\DeclareSIUnit{\franc}{\FF}
\begin{document}
\SI{1000}{\franc} is 1000\,₣ or \SI{1000}{₣}
\end{document}
답변2
v2.6 때문에 문제가 발생한 것 같습니다.siunitx
모드 옵션의 표준 설정을 에서 로 전환 text
합니다 math
.
\documentclass{article}
\usepackage{fontspec}
\usepackage{siunitx}
\DeclareRobustCommand*{\myfranc}{% thanks to egreg and Manuel
\begingroup
\freeserif^^^^20a3%
\endgroup
}
\DeclareSIUnit[mode = text]{\franc}{\myfranc}
\newfontfamily{\freeserif}{FreeSerif.otf}
\begin{document}
\SI{1000}{\franc}
\end{document}