2

Is it possible to disable and enable mathastext in the middle of the document for a line or paragraph?

2

Yes, if it was loaded with option subdued. Here is an example:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
% font packages
\usepackage{newcent}
\usepackage[subdued, defaultmathsizes]{mathastext}

% define a math version to use NewCentury font
\Mathastext[newcent]

% now define another one to have letter italic
% (but not digits or operator names)
\MTlettershape{it}
\Mathastext[newcentit]

\DeclareMathOperator\per{per}

\begin{document}
% At start mathastext is unactivated.

Text in NewCentury but math is as in default
\begin{multline}
\biggl(\sum_{\,i\in\mathbf{n}}a_{l_i}x_i\biggr)
\det\mathbf{K}(t=1,x_1,\dots,x_n;l |l )\\
=\biggl(\prod_{\,i\in\mathbf{n}}\hat x_i\biggr)
\sum_{I\subseteq\mathbf{n}-\{l \}}
(-1)^{|I|}\per\mathbf{A}^{(\lambda)}(I|I)
\det\mathbf{A}^{(\lambda)}
(\overline I\cup\{l \}|\overline I\cup\{l \}).
\end{multline}

Now with \verb|mathastext| active in math using upright letters.
\MTversion{newcent}
\begin{multline}
\biggl(\sum_{\,i\in\mathbf{n}}a_{l_i}x_i\biggr)
\det\mathbf{K}(t=1,x_1,\dots,x_n;l |l )\\
=\biggl(\prod_{\,i\in\mathbf{n}}\hat x_i\biggr)
\sum_{I\subseteq\mathbf{n}-\{l \}}
(-1)^{|I|}\per\mathbf{A}^{(\lambda)}(I|I)
\det\mathbf{A}^{(\lambda)}
(\overline I\cup\{l \}|\overline I\cup\{l \}).
\end{multline}

Now with italic letters again from New Century font.
\MTversion{newcentit}
\begin{multline}
\biggl(\sum_{\,i\in\mathbf{n}}a_{l_i}x_i\biggr)
\det\mathbf{K}(t=1,x_1,\dots,x_n;l |l )\\
=\biggl(\prod_{\,i\in\mathbf{n}}\hat x_i\biggr)
\sum_{I\subseteq\mathbf{n}-\{l \}}
(-1)^{|I|}\per\mathbf{A}^{(\lambda)}(I|I)
\det\mathbf{A}^{(\lambda)}
(\overline I\cup\{l \}|\overline I\cup\{l \}).
\end{multline}
\end{document}

enter image description here

In example above, \MTversion{normal} to again "deactivate" mathastext. But as explained in documentation this "deactivate" is only to 99%. Some of its actions are not reversible, because it was not initially designed for reversibility.

  • My compliments. +1 – Sebastiano Mar 25 '18 at 21:18

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.