stipub / stixfonts

OpenType Unicode fonts for Scientific, Technical, and Mathematical texts
SIL Open Font License 1.1
715 stars 41 forks source link

Missing asterisk with package listings and stix2 #151

Closed Fubaxiusz closed 3 years ago

Fubaxiusz commented 4 years ago

When using package listings with stix2 asterisk * is missing, only blank space displayed. image

Here is code to reproduce the issue:

\documentclass[a4paper,11pt]{article}
\usepackage{stix2}
\usepackage{listings}

\begin{document}
\begin{lstlisting}[
caption={A simple C program with missing \*.},
language=C
]
// Entry point for the program
int main(const int argc, const char* argv[]) {

    // Print some output
    /* Print some output for */
    printf("Hello world!\n");

    return 0*10;
}
\end{lstlisting}
\end{document}
xsrvmy commented 4 years ago

Apparently listings package substitutes * for \textasteriskcentered. For workaround, \renewcommand{\textasteriskcentered}{*} Or as suggested here https://tex.stackexchange.com/questions/127710/problem-with-listings-package-using-stix-fonts \renewcommand{\textasteriskcentered}{\ensuremath{*}} Note that this may make the asterisk too low

robot6 commented 3 years ago

This is very interesting. I have a similar problem. I am writing a document using the eskdx package in Russian. In math mode, all the minuses become asterisks. And actually, when I put an asterisk in, it becomes something that looks quite like the \guilsinglleft symbol. Fortunately, I don't need the asterisks, but I do need minuses. If I comment out \usepackage{stix}, the minus signs are represented correctly.

To be precise, the packages I am using are: eskdtext style, with options russian, utf8, floatsection, equationsection, pointsection fontspec xecyr xunicode xltxtra amsmath stix polyglossia graphicx url

tiroj commented 3 years ago

@davidmjones Is this issue specific to some flavour(s) of TeX? Do we need to do anything in the fonts?

xsrvmy commented 3 years ago

Looks like the OP was using the Type1 version of stix2, in which \textasteriskcentered probably has no mapped character. The unicode version of the font works fine without the workaround.

The russian issue above is probably something with Type1 again, and it's for the old stix fonts.

tiroj commented 3 years ago

Thanks. Closing.