%  File:	eulertext.sty
%  Created:	10 Jul 2013
%  By:   	H.A.Trujillo
%  Last Change:     24 May 2014
%
%
%    Allows the use of the "euler" math font (eur) in text- and math-modes,
%    to provide for "handwritten" portions of example lab reports.  
%    Also defines the normal math font as New-Century Schoolbook (nsc), for
%    "non-handwritten" portions of lab manual chapters.
%
%    TO USE:
%	- include the following to switch to Euler-Math:
%		\mathversion{egCalcs}		\
%						 |  do these from 
%	     and, to return to NSC-math:         |  TEXT-mode, before
%		\mathmversion{normal}           /   the math starts
%
%	- Encase region that should be in Euler-Text within
%		{ \eufont ... }     or     \begin{eufont} ...
%
%
%    Note that this is somewhat glitchy, as the text and math encodings
%    differ.  Spaces must be quoted.  Also, a number of characters cause
%    problems:
%
%	to obtain...	use...
%		.	:
%		,	;
%		:	$:$
%		%	\text{\textdiscount} 
%		/	=   ,   opt-shft-1  (sl  more vertical) ,  $\not{}$
%		-	$-$  (n-dash length)
%		+	$+$
%		=	$=$
%		?	$?$  or  (less bold): \rotatebox[y=0.5ex]{180}{¿}
%		!	$!$
%		_	\_
%		|	$|$  or  $\models$
%
%		( )	$($    $)$
%		[ ]	$[$  $]$
%		{ }	\{   \}
%
%	    italic-L ℓ	`
%	    delta	@
%	    epsilon	"  (dbl-quote)
%	    omega	!
%	    varTheta ϑ	\#
%	    varPhi   φ	'  (sgl-quote)
%
%	    Most high-bit characters work fine.
%
%	    \sy{...} subsitutes the default math symbol-font (cmm) for euler
%
%
%	ADDITIONAL COMMANDS:
%
%		\SRhdr{...}			Courier heading (sample report)
%		\HWhdr{...}			Handwritten hdg (calculations)
%
%		\SRfn {fn#}{fn_text}{label}	sample-report footnote
%							     -> somewhat flaky
%
%	ToDo:
%	     Recode the glitch-characters


\ProvidesPackage{eulertext}%
   [2014/05/24  v1.0.1 Establishes euler as a handwritten (pseudo)text font, (H.A.Trujillo)]
%  [2013/07/10  v.1.0  Establishes euler as a handwritten (pseudo)text font, (H.A.Trujillo)]

\RequirePackage{eulervm}


\DeclareMathVersion{normal}
    % keep cmm italic letters
    %\SetSymbolFont{letters}{normal}{OT1}{pnc}{m}{n}
    \SetSymbolFont{operators}{normal}{OT1}{pnc}{m}{n}
    \SetSymbolFont{symbols}{normal}{U}{zeus}{m}{n}
    \SetSymbolFont{largesymbols}{normal}{OMX}{cmex}{m}{n}

\DeclareMathVersion{egCalcs}
    \SetSymbolFont{letters}{egCalcs}{U}{eur}{m}{n}
    \SetSymbolFont{operators}{egCalcs}{U}{eur}{m}{n}
    \SetSymbolFont{symbols}{egCalcs}{U}{zeus}{m}{n}
    \SetSymbolFont{largesymbols}{egCalcs}{U}{zeuex}{m}{n}


% use cmm for symbols that glitch with the "normal"
% encoding above    (eg, greek letters:  $\sy{ \alpha }$ )
%
\DeclareMathAlphabet{\sy}{OML}{cmm}{m}{n}	% math-mode
    \SetMathAlphabet{\sy}{normal}{OML}{cmm}{m}{n}

\newcommand{\eufont}{\usefont{U}{eur}{m}{n}} 	% text-mode


%  User Commands:

\newcommand{\SRhdr}	[1] {\noindent\textbf{#1}\par\nopagebreak} %  tt heading
\newcommand{\HWhdr}	[1] {\noindent\underline{#1}\nopagebreak}  % "handwritten" hdg
\newcommand{\SRfn}      [3] {\footnote[#1]{\texttt{#2}\label{#3}}}



% The other option for setting the fonts up -- quick and dirty:
% 
%    	- include the following in the master-document preamble:
%
%		\DeclareMathAlphabet{\nsc}{OT1}{pnc}{m}{n}	% math-mode
% 		\SetMathAlphabet{\nsc}{normal}{OT1}{pnc}{m}{n}
%		\newcommand{\eufont}{\usefont{U}{eur}{m}{n}} 	% text-mode
%
%	- place NewCent math (in main document) within $\nsc{...}$
%	
%			pro: simple setup,
%			     fewer glitchy characters
%
%			con: inconvenient in main document
%			     do numbers come out in main font (nsc)?
%

% vim: nowrite
