![使其看起来更像手写](https://linux22.com/image/316222/%E4%BD%BF%E5%85%B6%E7%9C%8B%E8%B5%B7%E6%9D%A5%E6%9B%B4%E5%83%8F%E6%89%8B%E5%86%99.png)
我正在为有特殊需要的学生制作工作表,因此说明和示例必须是优步清除。
为了实现这一点,我已将示例字体切换为无衬线大字体,但想要安装适用于文本的友好、手写外观的字体包和数学模式。当然,它必须很容易与默认文本区分开来……这可能意味着没有衬线。因此,这些要么没有多大帮助……要么就是我对 LaTeX 了解不够,无法理解它们。线程 1,线程 2。
这是我目前得到的结果。您建议我如何让第二行看起来更像手写?
\documentclass[12pt,letterpaper]{article}
\usepackage{sansmath}
\usepackage{color}
\definecolor{examplecolor}{gray}{0.4}
\newenvironment
{exampletext}
{\noindent\large\sffamily\sansmath\color{examplecolor}}
{}
\begin{document}
This is what text normally looks like: 3, third, $\frac{2}{3}$.
\begin{exampletext}I want my example text to look like this, but more handwritten: 3, third, $\frac{17}{25}$. Notice that even in math mode, there are no serifs. \end{exampletext}
\end{document}
答案1
除了使用sansmath
包之外,您是否考虑过使用arev
?后者同时提供文本模式和数学模式无衬线字体,并且字形间距很大。如果您希望文本字体继续为 Computer Modern,只需\renewcommand\rmdefault{pcm}
在加载arev
包后发出指令即可。
的 x 高度arev
相当大,尤其是与 CM 相比时。如果您决定采用这种方式,则可能不需要\large
在环境设置中使用examplecolor
。
\documentclass[12pt,letterpaper]{article}
\usepackage[onehalfspacing]{setspace}
\usepackage{arev}
\renewcommand\rmdefault{pcm} % revert text font to CM
\usepackage{xcolor}
\definecolor{examplecolor}{gray}{0.4}
\newenvironment
{exampletext}{\noindent\large\sffamily
\color{examplecolor}}{\par}
\begin{document}
\noindent
This is what text normally looks like: 3, 17, 25, two thirds.
\bigskip
\begin{exampletext}I want my example text to look like this, but more handwritten: 3, two thirds, $\frac{17}{25}$, $x^{1/2}$. Notice that even in math mode, there are no serifs. \end{exampletext}
\end{document}
答案2
看看LaTeX 字体目录。
答案3
这回答了一个在评论中向我提出的问题。
您已完成所有需要做的事情。除了在序言中添加您提到的行之外,您无需执行任何特殊操作即可使用字体。
这是一个完整的例子:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lxfonts}
\usepackage{kantlipsum}
\begin{document}
\kant[1-20]
\end{document}
如果您只想在特殊环境中使用字体,则可以通过复制相关部分来仅在其范围内为文本激活它们lxfonts.sty
。请注意,这仍会全局更改数学字体。
\documentclass[12pt,letterpaper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsfonts,mathtools,nicefrac}
\usepackage{xcolor}
\definecolor{examplecolor}{gray}{0.4}
% font configuration adapted from lxfonts.sty
\input{ulmsa.fd}
\input{ulmsb.fd}
\newenvironment{exampletext}{%
\renewcommand\rmdefault{llcmss}%
\renewcommand\sfdefault{llcmss}%
\renewcommand\ttdefault{llcmtt}%
\noindent\large\color{examplecolor}%
}{}
\SetSymbolFont{operators}{normal}{OT1}{llcmss}{m}{n}
\SetSymbolFont{letters}{normal}{OML}{llcmm}{m}{it}
\SetSymbolFont{symbols}{normal}{OMS}{llcmsy}{m}{n}
\SetSymbolFont{largesymbols}{normal}{OMX}{llcmex}{m}{n}
\SetSymbolFont{operators}{bold}{OT1}{llcmss} {bx}{n}
\SetSymbolFont{letters} {bold}{OML}{llcmm} {bx}{it}
\SetSymbolFont{symbols} {bold}{OMS}{llcmsy}{bx}{n}
\SetSymbolFont{largesymbols}{bold}{OMX}{llcmex}{m}{n} % no bold!
\DeclareSymbolFontAlphabet{\mathrm} {operators}
\DeclareSymbolFontAlphabet{\mathnormal}{letters}
\DeclareSymbolFontAlphabet{\mathcal} {symbols}
\DeclareMathAlphabet {\mathbf}{OT1}{llcmss}{bx}{n}
\DeclareMathAlphabet {\mathsf}{OT1}{llcmss}{m}{n}
\DeclareMathAlphabet {\mathit}{OT1}{llcmss}{m}{sl}
\DeclareMathAlphabet {\mathtt}{OT1}{llcmtt}{m}{n}
\SetMathAlphabet\mathsf{bold}{OT1}{llcmss}{bx}{n}
\SetMathAlphabet\mathit{bold}{OT1}{llcmss}{bx}{sl}
\SetSymbolFont{AMSa}{normal}{U}{lmsa}{m}{n}
\SetSymbolFont{AMSb}{normal}{U}{lmsb}{m}{n}
\makeatletter
\xdef\Join{\mathrel{\mathchar"0\hexnumber@\symAMSb 6F%
\mkern-14.2mu\mathchar"0\hexnumber@\symAMSb 6E}}
\makeatother
\global\let\leadsto\rightsquigarrow
\begin{document}
This is what text normally looks like: 3, third, \nicefrac{2}{3}.
\begin{exampletext}
I want my example text to look like this, but more handwritten: 3, third, $\frac{17}{25}$. Notice that even in math mode, there are no serifs.
\[
\mathbf{B}(P)=\frac{\mu_0}{4\pi}\int\frac{\mathbf{I}\times\hat{r}'}{r'^2}dl = \frac{\mu_0}{4\pi}\,I\!\int\frac{d\boldsymbol{l}\times\hat{r}'}{r'^2}% from the LaTeX Font Catalogue example
\]
\end{exampletext}
\end{document}
我不建议只更改专业环境的数学字体设置,因为根据您是否在环境范围内,您最终会得到看起来不太一样的符号,它们代表着相同的东西。不过,无论如何我可能不会使用这些设置。
或者你可以适应Mico 的方法尽管这里有点复杂,因为lxfonts.sty
在序言末尾改变了字体,所以我们必须覆盖它:
\documentclass[12pt,letterpaper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsfonts,mathtools,nicefrac,lxfonts}
\usepackage{xcolor}
\definecolor{examplecolor}{gray}{0.4}
\newenvironment{exampletext}{%
\renewcommand{\rmdefault}{llcmss}%
\renewcommand{\ttdefault}{llcmtt}%
\renewcommand{\sfdefault}{llcmss}%
\noindent\large\color{examplecolor}%
}{%
\renewcommand{\rmdefault}{lmr}%
\renewcommand{\ttdefault}{lmtt}%
\renewcommand{\sfdefault}{lmss}%
}
\AtEndPreamble{%
\renewcommand{\rmdefault}{lmr}%
\renewcommand{\ttdefault}{lmtt}%
\renewcommand{\sfdefault}{lmss}%
\renewcommand{\familydefault}{\rmdefault}%
}
\begin{document}
This is what text normally looks like: 3, third, \nicefrac{2}{3}.
\textsf{hi} \texttt{bye}
\begin{exampletext}
I want my example text to look like this, but more handwritten: 3, third, $\frac{17}{25}$. Notice that even in math mode, there are no serifs.
\[
\mathbf{B}(P)=\frac{\mu_0}{4\pi}\int\frac{\mathbf{I}\times\hat{r}'}{r'^2}dl = \frac{\mu_0}{4\pi}\,I\!\int\frac{d\boldsymbol{l}\times\hat{r}'}{r'^2}
\]
\end{exampletext}
Here is some more standard text.
\end{document}