讓這看起來更像手寫

讓這看起來更像手寫

我正在為有特殊需求的學生建立工作表,因此說明和範例必須是優步清除。

為了實現這一點,我已將工作範例字體切換為無襯線字體和大字體,但想要安裝適用於文字的友好的手寫字體包和數學模式。當然,它必須很容易與預設文字區分開來……這可能意味著沒有襯線。因此,這些要么沒有多大幫助……要么我只是不了解足夠的 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

答案3

這回答了一個評論中向我提出的問題

你已經做了你需要做的一切。除了在序言中添加您提到的行之外,您不需要執行任何特殊操作即可使用這些字體。

這是一個完整的範例:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lxfonts}
\usepackage{kantlipsum}
\begin{document}
  \kant[1-20]
\end{document}

LX字體

如果您只想在特殊環境中使用字體,那麼您可以透過複製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}

範例環境

我不建議更改僅為專業環境設定的數學字體,因為根據您是否在環境範圍內,您最終會得到看起來不太一樣但代表相同事物的符號。但無論如何,我可能不會使用這些設定。

或者你可以適應米科的方法儘管這裡有點複雜,因為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}

替代方法

相關內容