Difference between revisions of "Doublestroke"

From Wiki
Jump to navigation Jump to search
(Merged the examples)
Line 11: Line 11:
 
\starttypescript [math] [modern,computer-modern,latin-modern,ams] [size]
 
\starttypescript [math] [modern,computer-modern,latin-modern,ams] [size]
 
   \definebodyfont [17.3pt,14.4pt,12pt][mm]
 
   \definebodyfont [17.3pt,14.4pt,12pt][mm]
                   [mb=dsrom12 sa 1]
+
                   [mc=dsrom12 sa 1]
 
   \definebodyfont [11pt,10pt,9pt] [mm]
 
   \definebodyfont [11pt,10pt,9pt] [mm]
                   [mb=dsrom10 sa 1]
+
                   [mc=dsrom10 sa 1]
 
   \definebodyfont [8pt,7pt,6pt,5pt,4pt] [mm]
 
   \definebodyfont [8pt,7pt,6pt,5pt,4pt] [mm]
                   [mb=dsrom8 sa 1]
+
                   [mc=dsrom8 sa 1]
 
\stoptypescript
 
\stoptypescript
  
Line 23: Line 23:
  
  
\definefamilysynonym [default] [doublestroke]  [mb]
+
\definefamilysynonym [default] [doublestroke]  [mc]
  
 
\def\dstroke {\fam\purefamily  {doublestroke}}
 
\def\dstroke {\fam\purefamily  {doublestroke}}
Line 42: Line 42:
 
</context>
 
</context>
  
== Double Stroke font by keeping Mathrelations ==
+
contextgarden does not have dsrom fonts installed, so we cannot see the output here.
 
 
This definition is nearly as the above one but will keep math relations such as \subset, \subsetneq, \supsetneqq and so on defined in mb.
 
 
 
<context source="yes">
 
 
 
\usemodule[amsl]
 
\usemodule[newmat]
 
 
 
\loadmapfile[dstroke.map]
 
 
 
\starttypescript[math][modern,computer-modern,latin-modern,ams][size]
 
\definebodyfont[17.3pt,14.4pt,12pt][mm][mc=dsrom12 sa 1]
 
\definebodyfont[11pt,10pt,9pt][mm][mc=dsrom10 sa 1]
 
\definebodyfont[8pt,7pt,6pt,5pt,4pt][mm][mc=dsrom8 sa 1]
 
\stoptypescript
 
 
 
\definetypeface[modern][mm][math][modern][ams][endocing=\defaultencoding]
 
 
 
\setupbodyfont[reset,modern,10pt]
 
 
 
 
 
\definefamilysynonym[default][doublestroke][mc]
 
 
 
\def\dstroke {\fam\purefamily {doublestroke}}
 
 
 
\def\doublestroke#1{{\dstroke#1}}
 
 
 
\starttext
 
 
 
${\dstroke RN}$
 
 
 
$\subsetneqq\subsetneq\supsetneqq\supsetneq$
 
 
 
\stoptext
 
 
 
</context>
 
 
 
Don't know why it wouldn't compile here, but it works that way round...
 
  
 
[[Category:Math]]
 
[[Category:Math]]
 
[[Category:Fonts]]
 
[[Category:Fonts]]

Revision as of 23:38, 31 October 2009

< Main Page | Math with newmat | MathML | Multiline equations>

Using double stroke font

Computer Modern and Latin Modern use the msbm font family for blackboard bold. msbm look very dull and usually black board bold should be avoided in math. However, there are certain cases where one needs something fancier than math bold. The doublestroke fonts offer one such alternative. This is how these can be used with ConTeXt. Note that since we are using doublestroke fonts as the blackboard font, there is really no need to use the blackboard fonts separately. So, the mb math family is reused.


\loadmapfile[dstroke.map]

\starttypescript [math] [modern,computer-modern,latin-modern,ams] [size]
  \definebodyfont [17.3pt,14.4pt,12pt][mm]
                  [mc=dsrom12 sa 1]
  \definebodyfont [11pt,10pt,9pt] [mm]
                  [mc=dsrom10 sa 1]
  \definebodyfont [8pt,7pt,6pt,5pt,4pt] [mm]
                  [mc=dsrom8 sa 1]
\stoptypescript

\definetypeface [modern] [mm] [math] [modern] [ams] [encoding=texnansi]

\setupbodyfont[reset,modern,10pt]


\definefamilysynonym [default] [doublestroke]   [mc]

\def\dstroke {\fam\purefamily  {doublestroke}}

\def\doublestroke#1{{\dstroke#1}}

The expectation of a random variable $X$ is given by $\doublestroke{E}\{X\}$. 

The indicator function is given by
\startformula
   \doublestroke{1}(x=a) = \startcases
          \NC 1 \NC if $x=a$ \NR
          \NC 0 \NC if $x \ne a$ \NR
    \stopcases
\stopformula


contextgarden does not have dsrom fonts installed, so we cannot see the output here.