I hope a quick and easy solution is possible
- Error Code
LaTeX Font Warning: Font shape
TS1/Arial(0)/m/n' undefined (Font) using
TS1/cmr/m/n' instead on input line 75.
Main Problem
The error showcases that I can't manage to change the math font to a choice of mine while using mathspec package
Explanation
I searched through old topics on the forum, with examples such as usage of "fontspec", usage of "renewcommands" and more. But they all can't seem to fix my error or allow me to use basically Arial as a main font(bold, italic etc.) and FOR EXAMPLE Cambria Math for Math fonts. The substitution named "cmr" looks kinda odd if combined with Arial.
If Cambria Math is a stupid idea to use with Arial, feel free to provide a better solution!
Here is the minimum example so you can also observe that error message(and see how unfitting Arial + cmr is):
Minimum Working Example with complete Preamble
\documentclass[hidelinks,11pt,egregdoesnotlikesansseriftitles]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{apacite}
\usepackage[showframe=true]{geometry}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{mathspec}
\setmainfont{Arial}
\setmathfont{Cambria Math}%an example, feel free to suggest something that works
\usepackage{natbib}
\usepackage[table,xcdraw]{xcolor}
\usepackage{array}
\usepackage[english]{babel}
\usepackage{geometry}
\usepackage{setspace}
\usepackage{eurosym}
\usepackage{multirow}
\usepackage{siunitx}
\makeatletter
\newcommand{\MSonehalfspacing}{%
\setstretch{1.44}% default
\ifcase \@ptsize \relax % 10pt
\setstretch {1.448}%
\or % 11pt
\setstretch {1.399}%
\or % 12pt
\setstretch {1.433}%
\fi
}
\makeatother
\MSonehalfspacing
\usepackage[headsepline,automark,singlespacing=true]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{\rightmark}
\ohead{\pagemark}
\addtokomafont{pageheadfoot}{\upshape\bfseries}
\KOMAoptions{onpsinit=\setstretch{1}}
\usepackage{textcomp}
\usepackage{gensymb}
\makeatletter
\let\Hy@linktoc\Hy@linktoc@none
\makeatother
\let\oldtabular\tabular
\renewcommand{\tabular}{\small\oldtabular}
\setkomafont{caption}{\small}
\geometry{a4paper, top=25mm, left=25mm, right=25mm, bottom=25mm,includehead}
\setlength{\parindent}{0pt}
\usepackage{apacdoc}
\addto\captionsenglish{% Replace "english" with the language you use
\renewcommand{\contentsname}%
{Table of Contents}%
}
\usepackage{hyperref}
\def\UrlBreaks{\do\/\do-}
\makeatletter
\newcommand{\tocfill}{\cleaders\hbox{$\m@th \mkern\@dotsep mu . \mkern\@dotsep mu$}\hfill}
\makeatother
\newcommand{\abbrlabel}[1]{\makebox[4cm][l]{\textbf{#1}\ \tocfill}}
\newenvironment{abbreviations}{\begin{list}{}{\renewcommand{\makelabel}{\abbrlabel}%
\setlength{\itemsep}{0pt}}}{\end{list}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
Test
\textbf{Many Test much hurt}
\textit{Tester Rester}
$ \frac{22}{33}$ How can I change the font of the numbers to be similar to Arial? It doesn't have to be Arial, just a similar font type. Heck there might be a more elegant solution?
\end{document}
\usepackage[T1]{fontenc}
with xetexm it forces the use of font encoding with 256 characters so breaks Unicode support, and xetex does not load any hyphenation tables for that encoding so hyphenation will be wrong.;-)
textcomp
, at all, since those symbols are now part of the LaTeX kernel. If you useunicode-math
, it can replace (just about) all other symbol and font packages. You would only micunixode-math
with other font packages if you’re doing something very unusual.