\documentclass[12pt]{article}
\usepackage{amsthm,amsmath,ragged2e,relsize,graphicx,bbm,mathtools}
\DeclareFontEncoding{LS1}{}{}
\DeclareFontEncoding{LS2}{}{\noaccents@}
\DeclareFontSubstitution{LS1}{stix2}{m}{n}
\DeclareFontSubstitution{LS2}{stix2}{m}{n}
\DeclareSymbolFont{xsymbols}{LS1}{stix2scr}{m}{n}
\DeclareSymbolFont{xlargesymbols}{LS2}{stix2ex}{m}{n}
\DeclareMathDelimiter{\lfloor}{\mathopen}{symbols}{"E2}{xlargesymbols}{"08}
\DeclareMathDelimiter{\rfloor}{\mathclose}{symbols}{"E3}{xlargesymbols}{"09}
\begin{document}
Why am i not getting $\lfloor x\rfloor$ properly?
\end{document}
答案1
你得到
Missing character: There is no <E2> in font cmsy10!
Missing character: There is no <E3> in font cmsy10!
因為你有一個錯字:symbols
而不是largesymbols
.也就是說,假設您想要使用 STIX2 中的字形。不要忘記\makeatletter
因為\noaccents@
。
\documentclass[12pt]{article}
\usepackage{amsthm,amsmath,ragged2e,relsize,graphicx,bbm,mathtools}
\makeatletter
%\DeclareFontEncoding{LS1}{}{}
\DeclareFontEncoding{LS2}{}{\noaccents@}
\makeatother
%\DeclareFontSubstitution{LS1}{stix2}{m}{n}
\DeclareFontSubstitution{LS2}{stix2}{m}{n}
%\DeclareSymbolFont{xsymbols}{LS1}{stix2scr}{m}{n}
\DeclareSymbolFont{xlargesymbols}{LS2}{stix2ex}{m}{n}
\DeclareMathDelimiter{\lfloor}{\mathopen}{xlargesymbols}{"E2}{xlargesymbols}{"08}
\DeclareMathDelimiter{\rfloor}{\mathclose}{xlargesymbols}{"E3}{xlargesymbols}{"09}
\begin{document}
I am getting $\lfloor x\rfloor$ properly.
\end{document}
也與\lbrace
and \rbrace
(但它們與其他字體並不真正匹配)。
\documentclass{article}
\usepackage{amsthm,amsmath,ragged2e,relsize,graphicx,bbm,mathtools}
\makeatletter
\DeclareFontEncoding{LS1}{}{}
\DeclareFontEncoding{LS2}{}{\noaccents@}
\makeatother
\DeclareFontSubstitution{LS1}{stix2}{m}{n}
\DeclareFontSubstitution{LS2}{stix2}{m}{n}
\DeclareSymbolFont{stixoperators}{LS1}{stix2}{m}{n}
%\DeclareSymbolFont{stixsymbols}{LS1}{stix2scr}{m}{n}
\DeclareSymbolFont{stixlargesymbols}{LS2}{stix2ex}{m}{n}
\DeclareMathDelimiter{\lfloor}{\mathopen}{stixlargesymbols}{"E2}{stixlargesymbols}{"08}
\DeclareMathDelimiter{\rfloor}{\mathclose}{stixlargesymbols}{"E3}{stixlargesymbols}{"09}
\DeclareMathDelimiter{\lbrace}{\mathopen} {stixoperators}{"5E}{stixlargesymbols}{"0C}
\DeclareMathDelimiter{\rbrace}{\mathclose}{stixoperators}{"60}{stixlargesymbols}{"0D}
\begin{document}
I am getting $\lfloor x\rfloor$ properly.
I am getting $\lbrace x\rbrace$ properly.
I am getting $\{x\}$ properly.
\bigskip
$
\biggl\{\biggl\lfloor \Bigl\{\Bigl\lfloor \bigl\{\bigl\lfloor \{\lfloor
%
\biggl\rfloor\biggl\} \Bigl\rfloor\Bigl\} \bigl\rfloor\bigl\} \rfloor\}
$
\end{document}
\Big
是的,從到有一個很大的跳躍\bigg
:我們必須稍微減少這個因子。留作練習。
答案2
您無需\lfloor
再次聲明\rfloor
。它們已經存在了。 Pdlatex 不是這裡的問題。
\documentclass[12pt]{article}
\usepackage{amsthm,amsmath,ragged2e,relsize,graphicx,bbm,mathtools}
\DeclareFontEncoding{LS1}{}{}
\DeclareFontEncoding{LS2}{}{\noaccents@}
\DeclareFontSubstitution{LS1}{stix2}{m}{n}
\DeclareFontSubstitution{LS2}{stix2}{m}{n}
\DeclareSymbolFont{xsymbols}{LS1}{stix2scr}{m}{n}
\DeclareSymbolFont{xlargesymbols}{LS2}{stix2ex}{m}{n}
% \DeclareMathDelimiter{\lfloor}{\mathopen}{symbols}{"E2}{xlargesymbols}{"08} <- Not necessary
% \DeclareMathDelimiter{\rfloor}{\mathclose}{symbols}{"E3}{xlargesymbols}{"09} <- Not necessary
\begin{document}
Why am i not getting $\lfloor x\rfloor$ properly?
\end{document}
順便說一句,你只需要:
\documentclass{article}
\begin{document}
You can get $\lfloor x \rfloor$ properly.
\end{document}
獲得