6

I'm building worksheets for special needs students and thus the instructions and examples must be uber clear.

To make this happen, I've switched the worked example font to sans-serif and large, but want to install friendly, handwritten-looking font package that works for both the text and math mode. And, of course, it must be easily distinguishable from the default text... which probably means no serif. Hence these either don't help much... or I just don't understand enough LaTeX to make sense of them. Thread 1, Thread 2.

This is what I've got so far. How would you suggest I make the second line look more handwritten?

\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}
  • 3
    On how to change the font for part of the document: tex.stackexchange.com/q/25249/42880. I recommend using XeLaTeX or LuaLaTeX (see the second answer), which would allow you to use fonts like Andika, which is designed for beginning readers, or Dyslexie, which is designed for people who have dyslexia. – Jason Zentz Aug 1 '15 at 1:00
  • Thank you for the Andika and Dyslexie font suggestions! I don't actually know what XeLaTeX or LuaLaTeX are, though. Are they totally necessary? – WeCanLearnAnything Aug 1 '15 at 1:14
  • Note that this is really culturally specific. In some cultures, children learn to read script before regular print. And what counts as standard script varies again. So what might be really good for beginning readers in say, Germany, might be dreadful in, say, Canada. (Picked countries more-or-less at random though I know practice differs in Germany compared with the UK both currently and, different again, a few decades ago.) We just think that everyone must do it the same because it makes most sense to us.... – cfr Aug 1 '15 at 1:28
  • 1
    This seems to be related to latex-community.org/forum/viewtopic.php?f=48&t=26526 – Johannes_B Aug 2 '15 at 15:35
5

Instead of using the sansmath package, have you considered arev? The latter provides both text-mode and math-mode sans-serif fonts, and the glyphs are generously spaced. If you want the text font to continue to be Computer Modern, just issue a \renewcommand\rmdefault{pcm} instruction after loading the arev package.

enter image description here

The x-height of arev is quite large, especially when compared to that of CM. If you decided to go this route, it may not be necessary to use \large in the setup of the examplecolor environment.

\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

Take a peek at the LaTeX font catalogue.

  • Just went through that catalog and I'm going to try LX Fonts... Never installed a font before, though... we'll see how it goes and I'll report back. :-) – WeCanLearnAnything Aug 1 '15 at 0:33
  • Yeah... so.... just been looking up how to install fonts in LaTeX. Can anybody recommend a newb-friendly guide to such things? – WeCanLearnAnything Aug 1 '15 at 0:44
  • 1
    @WeCanLearnAnything You shouldn't have to install them. They are included in both TeX Live and MikTeX. With TL, so long as you have a regular installation, you have the fonts. With MikTeX, you might need to use the package manager to install if you have not enabled on-the-fly installation. – cfr Aug 1 '15 at 1:24
  • @cfr I use TeXmaker. From LX's website, I copied \usepackage[T1]{fontenc} and \usepackage{lxfonts} into my preamble. What do I do after this when I actually want to use the lxfonts? – WeCanLearnAnything Aug 2 '15 at 8:31
  • @WeCanLearnAnything See answer - too much for a comment. – cfr Aug 2 '15 at 14:52
1

This answers a question addressed to me in comments.

You have done everything you need to do. You don't need to do anything special to use the fonts beyond adding the lines you mention to your preamble.

Here's a complete example:

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

LX fonts

If you want to only use the fonts within the special environment, then you can activate them for text just within its scope by copying relevant parts of lxfonts.sty. Note that this will still change the maths fonts globally.

\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}

example environment

I wouldn't recommend changing the maths font set up only for the specialist environment because you'll end up with symbols which don't look quite the same representing the same thing depending on whether you are within the environment's scope or not. But then, I probably wouldn't use these settings anyway.

Or you could adapt Mico's method although it is a bit more complex here as lxfonts.sty changes fonts at the end of the preamble so we have to override that:

\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}

alternative method

  • But I do want to change the math fonts in the special environment only. That's how students will distinguish the question text and the example text. I think I'll be copying your 2nd set of code but I won't bother trying to understand it... Also, is it me or is changing the font for a custom environment extremely complex for what seems to me to be a simple task? – WeCanLearnAnything Aug 3 '15 at 4:17
  • @WeCanLearnAnything It is partly like this for historical reasons: TeX was created when a font could have no more than 128 characters. Maths needs lots of symbols. Hence, it has to use a lot of fonts. But my second method also changes maths globally - not just for the custom environment. It is difficult to use 2 distinct font configurations for maths in the same document. But see tex.stackexchange.com/questions/19255/using-declaremathversion and tex.stackexchange.com/questions/258288/math-versions-and-bm. Note that you are limited to 16 maths alphabets. – cfr Aug 3 '15 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.