How do I adjust or suppress interletter spaces in math mode

In other words, how do achieve the effect of wrapping an entire equation in \mathit, except without italicizing numbers?

More generally, how do I change the amount of whitespace that's added between consecutive letters in math mode?

I found many questions on the site about removing spacing around operators, but none about inter-letter spacing. Here's what I want:

• Please provide an MWE to clarify what you have in mind. – Mico Mar 11 '16 at 6:06
• @Mico Done! Sorry for omitting it. – Clément Mar 11 '16 at 6:18

Not sure how rich your TeX code is, anyway hope the following specimen code will help:

\documentclass{article}

\usepackage{amssymb}
\usepackage{txfonts}

\DeclareSymbolFont{mymathvariables}{OT1}{txr}{m}{it}

\DeclareMathSymbol{a}{\mathalpha}{mymathvariables}{a}
\DeclareMathSymbol{b}{\mathalpha}{mymathvariables}{b}
\DeclareMathSymbol{c}{\mathalpha}{mymathvariables}{c}
\DeclareMathSymbol{d}{\mathalpha}{mymathvariables}{d}
\DeclareMathSymbol{e}{\mathalpha}{mymathvariables}{e}
\DeclareMathSymbol{f}{\mathalpha}{mymathvariables}{f}
\DeclareMathSymbol{g}{\mathalpha}{mymathvariables}{g}
\DeclareMathSymbol{h}{\mathalpha}{mymathvariables}{h}
\DeclareMathSymbol{i}{\mathalpha}{mymathvariables}{i}
\DeclareMathSymbol{j}{\mathalpha}{mymathvariables}{j}
\DeclareMathSymbol{k}{\mathalpha}{mymathvariables}{k}
\DeclareMathSymbol{l}{\mathalpha}{mymathvariables}{l}
\DeclareMathSymbol{m}{\mathalpha}{mymathvariables}{m}
\DeclareMathSymbol{n}{\mathalpha}{mymathvariables}{n}
\DeclareMathSymbol{o}{\mathalpha}{mymathvariables}{o}
\DeclareMathSymbol{p}{\mathalpha}{mymathvariables}{p}
\DeclareMathSymbol{q}{\mathalpha}{mymathvariables}{q}
\DeclareMathSymbol{r}{\mathalpha}{mymathvariables}{r}
\DeclareMathSymbol{s}{\mathalpha}{mymathvariables}{s}
\DeclareMathSymbol{t}{\mathalpha}{mymathvariables}{t}
\DeclareMathSymbol{u}{\mathalpha}{mymathvariables}{u}
\DeclareMathSymbol{v}{\mathalpha}{mymathvariables}{v}
\DeclareMathSymbol{w}{\mathalpha}{mymathvariables}{w}
\DeclareMathSymbol{x}{\mathalpha}{mymathvariables}{x}
\DeclareMathSymbol{y}{\mathalpha}{mymathvariables}{y}
\DeclareMathSymbol{z}{\mathalpha}{mymathvariables}{z}

\DeclareMathSymbol{A}{\mathalpha}{mymathvariables}{A}
\DeclareMathSymbol{B}{\mathalpha}{mymathvariables}{B}
\DeclareMathSymbol{C}{\mathalpha}{mymathvariables}{C}
\DeclareMathSymbol{D}{\mathalpha}{mymathvariables}{D}
\DeclareMathSymbol{E}{\mathalpha}{mymathvariables}{E}
\DeclareMathSymbol{F}{\mathalpha}{mymathvariables}{F}
\DeclareMathSymbol{G}{\mathalpha}{mymathvariables}{G}
\DeclareMathSymbol{H}{\mathalpha}{mymathvariables}{H}
\DeclareMathSymbol{I}{\mathalpha}{mymathvariables}{I}
\DeclareMathSymbol{J}{\mathalpha}{mymathvariables}{J}
\DeclareMathSymbol{K}{\mathalpha}{mymathvariables}{K}
\DeclareMathSymbol{L}{\mathalpha}{mymathvariables}{L}
\DeclareMathSymbol{M}{\mathalpha}{mymathvariables}{M}
\DeclareMathSymbol{N}{\mathalpha}{mymathvariables}{N}
\DeclareMathSymbol{O}{\mathalpha}{mymathvariables}{O}
\DeclareMathSymbol{P}{\mathalpha}{mymathvariables}{P}
\DeclareMathSymbol{Q}{\mathalpha}{mymathvariables}{Q}
\DeclareMathSymbol{R}{\mathalpha}{mymathvariables}{R}
\DeclareMathSymbol{S}{\mathalpha}{mymathvariables}{S}
\DeclareMathSymbol{T}{\mathalpha}{mymathvariables}{T}
\DeclareMathSymbol{U}{\mathalpha}{mymathvariables}{U}
\DeclareMathSymbol{V}{\mathalpha}{mymathvariables}{V}
\DeclareMathSymbol{W}{\mathalpha}{mymathvariables}{W}
\DeclareMathSymbol{X}{\mathalpha}{mymathvariables}{X}
\DeclareMathSymbol{Y}{\mathalpha}{mymathvariables}{Y}
\DeclareMathSymbol{Z}{\mathalpha}{mymathvariables}{Z}

%\DeclareSymbolFont{mymathnumerals}{T1}{ybv}{m}{n}
%\SetSymbolFont{mymathnumerals}{normal}{T1}{ybv}{m}{n}
%\DeclareSymbolFontAlphabet{\mathnormal}{mymathnumerals}

\begin{document}

$qpdb_0+1$

$\mathit{qpdb_0+1} \lambda$

\end{document}


Note: Here I used txfont to show the change, you may replace the {<encoding>} and {<family>} in \DeclareSymbolFont accordingly in your code.

• Thanks, that promising! But this seems to break rendering of \lambda? It displays a dash instead. – Clément Mar 11 '16 at 7:40
• I have improved my answer as per the comment. Please check. – Sunilkumar KS Mar 11 '16 at 8:55

Since you seem to be using some Times-like font, here's an example:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{newtxtext,newtxmath}
\usepackage{microtype}

\begin{document}

$math$ $is$ $difficult$ $qpdb_0+1$

{\boldmath$math$ $is$ $difficult$}

\end{document}


This outputs

Now transform this into

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{newtxtext,newtxmath}
\usepackage{microtype}

\DisableLigatures{encoding=OT1,family=ntxtlf}

\DeclareSymbolFont{unspacedletters}{OT1}{ntxtlf}{m}{it}
\SetSymbolFont{unspacedletters}{bold}{OT1}{ntxtlf}{b}{it}
\DeclareMathSymbol{A}{\mathalpha}{unspacedletters}{A}
\DeclareMathSymbol{B}{\mathalpha}{unspacedletters}{B}
\DeclareMathSymbol{C}{\mathalpha}{unspacedletters}{C}
\DeclareMathSymbol{D}{\mathalpha}{unspacedletters}{D}
\DeclareMathSymbol{E}{\mathalpha}{unspacedletters}{E}
\DeclareMathSymbol{F}{\mathalpha}{unspacedletters}{F}
\DeclareMathSymbol{G}{\mathalpha}{unspacedletters}{G}
\DeclareMathSymbol{H}{\mathalpha}{unspacedletters}{H}
\DeclareMathSymbol{I}{\mathalpha}{unspacedletters}{I}
\DeclareMathSymbol{J}{\mathalpha}{unspacedletters}{J}
\DeclareMathSymbol{K}{\mathalpha}{unspacedletters}{K}
\DeclareMathSymbol{L}{\mathalpha}{unspacedletters}{L}
\DeclareMathSymbol{M}{\mathalpha}{unspacedletters}{M}
\DeclareMathSymbol{N}{\mathalpha}{unspacedletters}{N}
\DeclareMathSymbol{O}{\mathalpha}{unspacedletters}{O}
\DeclareMathSymbol{P}{\mathalpha}{unspacedletters}{P}
\DeclareMathSymbol{Q}{\mathalpha}{unspacedletters}{Q}
\DeclareMathSymbol{R}{\mathalpha}{unspacedletters}{R}
\DeclareMathSymbol{S}{\mathalpha}{unspacedletters}{S}
\DeclareMathSymbol{T}{\mathalpha}{unspacedletters}{T}
\DeclareMathSymbol{U}{\mathalpha}{unspacedletters}{U}
\DeclareMathSymbol{V}{\mathalpha}{unspacedletters}{V}
\DeclareMathSymbol{W}{\mathalpha}{unspacedletters}{W}
\DeclareMathSymbol{X}{\mathalpha}{unspacedletters}{X}
\DeclareMathSymbol{Y}{\mathalpha}{unspacedletters}{Y}
\DeclareMathSymbol{Z}{\mathalpha}{unspacedletters}{Z}
\DeclareMathSymbol{a}{\mathalpha}{unspacedletters}{a}
\DeclareMathSymbol{b}{\mathalpha}{unspacedletters}{b}
\DeclareMathSymbol{c}{\mathalpha}{unspacedletters}{c}
\DeclareMathSymbol{d}{\mathalpha}{unspacedletters}{d}
\DeclareMathSymbol{e}{\mathalpha}{unspacedletters}{e}
\DeclareMathSymbol{f}{\mathalpha}{unspacedletters}{f}
\DeclareMathSymbol{g}{\mathalpha}{unspacedletters}{g}
\DeclareMathSymbol{h}{\mathalpha}{unspacedletters}{h}
\DeclareMathSymbol{i}{\mathalpha}{unspacedletters}{i}
\DeclareMathSymbol{j}{\mathalpha}{unspacedletters}{j}
\DeclareMathSymbol{k}{\mathalpha}{unspacedletters}{k}
\DeclareMathSymbol{l}{\mathalpha}{unspacedletters}{l}
\DeclareMathSymbol{m}{\mathalpha}{unspacedletters}{m}
\DeclareMathSymbol{n}{\mathalpha}{unspacedletters}{n}
\DeclareMathSymbol{o}{\mathalpha}{unspacedletters}{o}
\DeclareMathSymbol{p}{\mathalpha}{unspacedletters}{p}
\DeclareMathSymbol{q}{\mathalpha}{unspacedletters}{q}
\DeclareMathSymbol{r}{\mathalpha}{unspacedletters}{r}
\DeclareMathSymbol{s}{\mathalpha}{unspacedletters}{s}
\DeclareMathSymbol{t}{\mathalpha}{unspacedletters}{t}
\DeclareMathSymbol{u}{\mathalpha}{unspacedletters}{u}
\DeclareMathSymbol{v}{\mathalpha}{unspacedletters}{v}
\DeclareMathSymbol{w}{\mathalpha}{unspacedletters}{w}
\DeclareMathSymbol{x}{\mathalpha}{unspacedletters}{x}
\DeclareMathSymbol{y}{\mathalpha}{unspacedletters}{y}
\DeclareMathSymbol{z}{\mathalpha}{unspacedletters}{z}

\begin{document}

$math$ $is$ $difficult$ $qpdb_0+1$

{\boldmath$math$ $is$ $difficult$}

\end{document}


and you get

Ligatures must be disabled; it's easier having T1 as normal font encoding and using OT1 for the math letters.

The two f's just seem to form a ligature.

• Thanks! Can you clarify the part about OT1? – Clément Mar 11 '16 at 15:26
• @Clément I want to use a different font which I disable the ligatures of. – egreg Mar 11 '16 at 15:36