\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
和\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
它们已经存在。Pdflatex 不是这里的问题。
\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}
获得