0

I am really fond of mathdesign package, I use it with the font Adobe Utopia Std. Recently, I have found myself in need of a calligraphic alphabet (with lower and uppercases) in math mode. I've thought of start to compile with XeLaTeX and use unicode-math to set such an alphabet, but it would be painful to abandon mathdesign and Utopia. Is there a way to install a script otf or ttf and define a new alphabet in order to use it with PDFLaTeX? Or instead to use the glyphs from mathdesign with unicode-math.

[EDIT] I have obtained the result by editing mdpus.sty and mathspec.sty. In mdpus.sty, I commented the line 186 (\renewcommand{\rmdefault}{mdpus}\rmfamily) so that the following warning (which appears when the file is compiled with XeLaTeX)would be gone:

/usr/share/texmf-dist/tex/latex/mathdesign/mdpus/mdpus.sty:186: LaTeX Font Warning: Font shape 'TU/mdpus/m/n' undefined(Font)
using 'TU/lmr/m/n' instead on input line 186.

Then I searched the mathspec.sty file for the definition of the command \setmathcal, which I had found in the documentation.

\ernewcommand\setmathcal[2][]{
  \zf@fontspec{#1}{#2}
  \let\eu@mathcal\zf@family
  \DeclareMathAlphabet{\mathcal}{\eu@enc}{\eu@mathcal}{m}{n}}
\ernewcommand\setmathcursiva[2][]{
  \zf@fontspec{#1}{#2}
  \let\eu@mathcursiva\zf@family
  \DeclareMathAlphabet{\mathcursiva}{\eu@enc}{\eu@mathcursiva}{m}{n}}

I duplicated the definition and replaced "cal" by "cursiva" (which means cursive in portuguese). With the command \setmathcursiva[Scale=MatchLowercase]{<font name>}, I achieved the desired result. Between brackets, one can put the same arguments of \fontspec from the fontspec package.

For the alterations I made, this is a working example:

\documentclass{article}
\usepackage{fontspec}
\usepackage[adobe-utopiastd]{mathdesign}
\setmainfont{Utopia Std}% without this line, the the fi ligature is not handled well
%\let\mathcal\undefined %uncomment this if you'd like to change the font of \mathcal
\usepackage{mathspec}
\setmathcursiva[Scale=MatchLowercase]{<font name>}

\begin{document}
\[\mathcuriva{abc}\]
\end{document}
Tera
  • 97
  • 1
    Q1: Yes ... but you probably don't really want to. That is, how badly do you want to? How much effort and time? Q2: No. Not unless there's a font with those glyphs with a MATH TABLE. It's not enough to have an OTF. It needs to be configured for maths in order for unicode-math to apply. – cfr Jun 21 '18 at 23:44
  • 1
    Can you not use one of the options from the standard catalogue? http://www.tug.dk/FontCatalogue/calligraphicalfonts.html lists most of the options. These aren't intended as maths alphabets, but the fonts you're considering presumably aren't either. – cfr Jun 21 '18 at 23:46
  • I checked the standard catalogue but came to the conclusion that none of them would be well suited. Moreover, I did not know how to use one of them as a math alphabet. – Tera Jun 22 '18 at 00:16
  • I can say that I want it badly enough to consider constructing the math table for the glyphs from the mathdesign . I am currently using the libertinus math font, which pleases me reasonably, with unicode-math wich allows me to use a otf \mathscr font of my choice. I've started searching how to make the mapping of the glyphs from mathdesign to unicode-math, but I haven't made much progress and do not really know how cumbersome it is. – Tera Jun 22 '18 at 00:24
  • 1
    Creating an open type math font from a bunch of type1-fonts is certainly not a project for an afternoon. If you want to use unicode-math, use as math font one of the existing open type math fonts. If you want to use mathdesign, find some suitable script font. – Ulrike Fischer Jun 22 '18 at 07:34
  • 1
    Option 2 I would consider basically undoable. If you are going to do that, you are more-or-less designing an entire maths font from scratch, except you have a few clippings to paste in a couple of holes. If you want to do it that badly, focus on option 1. That's not a project for an afternoon unless you are already familiar with TeX fonts, but it is a better bet than creating a MATH table. At least, that would be my opinion. @UlrikeFischer might say differently and she knows more about it than I do. – cfr Jun 23 '18 at 00:25
  • Could you (@UlrikeFischer, @cfr) recommend some material for me to read in order to understand the installation of TeX fonts? – Tera Jun 23 '18 at 12:45
  • 1
    If the question isn't a dupe, please edit to show why and then post a self-answer once reopened. On the other hand, if the question is a dupe, an 'answer' should not be in the question. – Joseph Wright Jun 23 '18 at 19:45
  • @JosephWright You suggest that I remove the content of the edit and simply write why it should not be considered a dupplicate? I don't know very well if it should be considered as a duplicate, although I think it's more specific than the other question and the answers for that one didn't help me much. – Tera Jun 23 '18 at 19:55
  • You really ought not to modify the files without renaming them! There are good reasons why the licences don't typically permit you to do this (and these reasons apply even if these particular files are licensed differently). – cfr Jun 24 '18 at 02:04
  • @JosephWright The linked duplicate appears to have two answers in its question, so including an answer in this question probably seems the appropriate thing to do. I don't think the question in this question is a duplicate, for the record. However, the answer in this question seems to be an answer to a duplicate of the linked question. – cfr Jun 24 '18 at 02:11
  • @JosephWright Indeed, in the end, the solution to which I have come isn't the answer to any of the two questions I posed in the end of my post. I had assumed that mathdesign wouldn't work properly with XeLaTex so I did not think about this other approach. – Tera Jun 24 '18 at 13:45
  • I believe, however, that the solution is appropriate for the title. – Tera Jun 24 '18 at 13:46
  • @cfr What would be the right way of doing it? Simply renaming the file and making a different package? I am not very familiarised with the reasons. Shouldn't I bother with it only when redistributing the file? – Tera Jun 24 '18 at 13:53
  • It is best practice to do it even for your own use. There are various reasons for this. One is that it is very easy to forget you have a doctored version and later wonder why some document doesn't give you the output everyone else gets. Another is that it is easy to inadvertently redistribute it for the same reason. Another is that it makes for mysterious questions which people struggle to resolve because they don't know you have a different file. Hence, if you are somebody who can be 100% confident you will remember doing this, you can not if you don't redistribute. The rest of us souldn't. – cfr Jun 24 '18 at 16:55
  • To do it, you copy the file to another file name e.g. <original name>-sena.sty, change the name of the package or class in the file and update the date and description. Since this is incredibly easy and very quick to do, I can't see the point in not doing it. The only time I wouldn't bother would be if it was essential to a bugfix not to or if I was fiddling in a temporary test directory and not in a directory I'd draw files from in production processing. – cfr Jun 24 '18 at 16:59
  • You're right, that is indeed very easy and it is good practice. I'll start doing so. – Tera Jun 24 '18 at 18:39

0 Answers0