# How can I construct a math alphabet with lowercase and uppercase from different predefined sets?

I'm currently using the rsfs letters for caligriphic symbols. However, there is no corresponding lowercase alphabet, so I have begun to experiment with others. Is there a way that I can make it so that I may write $\mathscr{Ker}$, as opposed to $\mathscr{K}\mathcal{er}$, as I have been doing?

-
Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). – Claudio Fiandrino Aug 26 '12 at 7:10
use XeTeX or LuaTeX and then load XITS math, it has all characters – Herbert Aug 26 '12 at 20:47
@Herbert: you can also load the XITS math alphabets with standard LaTeX by using the boondox package, loading it with \usepackage{BOONDOX-cal}. – Philippe Goutet Aug 27 '12 at 5:29
@PhilippeGoutet: it is much more easier to replace a math alphabet with xetex or luatex – Herbert Aug 27 '12 at 5:47

## 2 Answers

Here's a way of doing it based on what txfonts.sty does for its \varmathbb alphabet. As you didn't give any detail, I've supposed the lowercase alphabet comes from the Chancery font (codename pzc). Of course, the two don't go at all well together as the bad spacing in Ker shows, so you'll have to adapt the code to your needs:

\documentclass{article}

\DeclareSymbolFont{mathscrUC}{U}{rsfs}{m}{n}  % Formal Script for uppercase
\DeclareSymbolFont{mathscrLC}{OT1}{pzc}{m}{n} % Chancery for lowercase

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
%%%%%%%%%%%%%%%%%% code from txfonts.sty (for \varmathbb) %%%%%%%%%%%%%%%%%
\DeclareRobustCommand*{\mathscr}[1]{\gdef\F@ntPrefix{mathscr@char@}%
\@EachCharacter #1\@EndEachCharacter}
\long\def\DoLongFutureLet #1#2#3#4{%
\def\@FutureLetDecide{#1#2\@FutureLetToken
\def\@FutureLetNext{#3}\else
\def\@FutureLetNext{#4}\fi\@FutureLetNext}
\futurelet\@FutureLetToken\@FutureLetDecide}
\def\DoFutureLet #1#2#3#4{\DoLongFutureLet{#1}{#2}{#3}{#4}}
\def\@EachCharacter{\DoFutureLet{\ifx}{\@EndEachCharacter}%
{\@EachCharacterDone}{\@PickUpTheCharacter}}
\def\m@keCharacter#1{\csname\F@ntPrefix#1\endcsname}
\def\@PickUpTheCharacter#1{\m@keCharacter{#1}\@EachCharacter}
\def\@EachCharacterDone \@EndEachCharacter{}

%%%%%%%%%%%%%%%%%% defining each individual symbols %%%%%%%%%%%%%%%%%%%%%%%
\DeclareMathSymbol{\mathscr@char@A}{\mathord}{mathscrUC}{A}
\DeclareMathSymbol{\mathscr@char@B}{\mathord}{mathscrUC}{B}
\DeclareMathSymbol{\mathscr@char@C}{\mathord}{mathscrUC}{C}
\DeclareMathSymbol{\mathscr@char@D}{\mathord}{mathscrUC}{D}
\DeclareMathSymbol{\mathscr@char@E}{\mathord}{mathscrUC}{E}
\DeclareMathSymbol{\mathscr@char@F}{\mathord}{mathscrUC}{F}
\DeclareMathSymbol{\mathscr@char@G}{\mathord}{mathscrUC}{G}
\DeclareMathSymbol{\mathscr@char@H}{\mathord}{mathscrUC}{H}
\DeclareMathSymbol{\mathscr@char@I}{\mathord}{mathscrUC}{I}
\DeclareMathSymbol{\mathscr@char@J}{\mathord}{mathscrUC}{J}
\DeclareMathSymbol{\mathscr@char@K}{\mathord}{mathscrUC}{K}
\DeclareMathSymbol{\mathscr@char@L}{\mathord}{mathscrUC}{L}
\DeclareMathSymbol{\mathscr@char@M}{\mathord}{mathscrUC}{M}
\DeclareMathSymbol{\mathscr@char@N}{\mathord}{mathscrUC}{N}
\DeclareMathSymbol{\mathscr@char@O}{\mathord}{mathscrUC}{O}
\DeclareMathSymbol{\mathscr@char@P}{\mathord}{mathscrUC}{P}
\DeclareMathSymbol{\mathscr@char@Q}{\mathord}{mathscrUC}{Q}
\DeclareMathSymbol{\mathscr@char@R}{\mathord}{mathscrUC}{R}
\DeclareMathSymbol{\mathscr@char@S}{\mathord}{mathscrUC}{S}
\DeclareMathSymbol{\mathscr@char@T}{\mathord}{mathscrUC}{T}
\DeclareMathSymbol{\mathscr@char@U}{\mathord}{mathscrUC}{U}
\DeclareMathSymbol{\mathscr@char@V}{\mathord}{mathscrUC}{V}
\DeclareMathSymbol{\mathscr@char@W}{\mathord}{mathscrUC}{W}
\DeclareMathSymbol{\mathscr@char@X}{\mathord}{mathscrUC}{X}
\DeclareMathSymbol{\mathscr@char@Y}{\mathord}{mathscrUC}{Y}
\DeclareMathSymbol{\mathscr@char@Z}{\mathord}{mathscrUC}{Z}
\DeclareMathSymbol{\mathscr@char@a}{\mathord}{mathscrLC}{a}
\DeclareMathSymbol{\mathscr@char@b}{\mathord}{mathscrLC}{b}
\DeclareMathSymbol{\mathscr@char@c}{\mathord}{mathscrLC}{c}
\DeclareMathSymbol{\mathscr@char@d}{\mathord}{mathscrLC}{d}
\DeclareMathSymbol{\mathscr@char@e}{\mathord}{mathscrLC}{e}
\DeclareMathSymbol{\mathscr@char@f}{\mathord}{mathscrLC}{f}
\DeclareMathSymbol{\mathscr@char@g}{\mathord}{mathscrLC}{g}
\DeclareMathSymbol{\mathscr@char@h}{\mathord}{mathscrLC}{h}
\DeclareMathSymbol{\mathscr@char@i}{\mathord}{mathscrLC}{i}
\DeclareMathSymbol{\mathscr@char@j}{\mathord}{mathscrLC}{j}
\DeclareMathSymbol{\mathscr@char@k}{\mathord}{mathscrLC}{k}
\DeclareMathSymbol{\mathscr@char@l}{\mathord}{mathscrLC}{l}
\DeclareMathSymbol{\mathscr@char@m}{\mathord}{mathscrLC}{m}
\DeclareMathSymbol{\mathscr@char@n}{\mathord}{mathscrLC}{n}
\DeclareMathSymbol{\mathscr@char@o}{\mathord}{mathscrLC}{o}
\DeclareMathSymbol{\mathscr@char@p}{\mathord}{mathscrLC}{p}
\DeclareMathSymbol{\mathscr@char@q}{\mathord}{mathscrLC}{q}
\DeclareMathSymbol{\mathscr@char@r}{\mathord}{mathscrLC}{r}
\DeclareMathSymbol{\mathscr@char@s}{\mathord}{mathscrLC}{s}
\DeclareMathSymbol{\mathscr@char@t}{\mathord}{mathscrLC}{t}
\DeclareMathSymbol{\mathscr@char@u}{\mathord}{mathscrLC}{u}
\DeclareMathSymbol{\mathscr@char@v}{\mathord}{mathscrLC}{v}
\DeclareMathSymbol{\mathscr@char@w}{\mathord}{mathscrLC}{w}
\DeclareMathSymbol{\mathscr@char@x}{\mathord}{mathscrLC}{x}
\DeclareMathSymbol{\mathscr@char@y}{\mathord}{mathscrLC}{y}
\DeclareMathSymbol{\mathscr@char@z}{\mathord}{mathscrLC}{z}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

$\mathscr{AaBbCcDdEeFfGgHhIiJjKkLlMm}$

$\mathscr{NnOoPpQqRrSsTtUuVvWwXxYyZz}$

$\mathscr{Ker}$

\end{document}

-

Another approach to the problem: Create a virtual font out of the given fonts and use it afterwards as a math alphabet. Here is a starter on virtual fonts: How to create a virtual font?

-