0

Problem description

I like how the slides document-class typesets most of the maths, which I crop and use in a WYSIWYG slide editor.

First, I'm not sure how to set the font to 10pt, so that the new formulas are akin those I've been generating with the article document-class (my formulas are upscaled to 360% in my slide software at import time, therefor I scale the slides one to 180% since they use 20pt size by default).

Second, it seems the document-class has some quirks. Namely the vertical dots, the semicolon, and the colon look off. Horizontal dots and comma look fine. enter image description here For comparison, using the article document-class I get the following. enter image description here

Finally, I'm not entirely sure I understand what font is used for what. Namingly, it appears to me as upright font is sans serif, some symbols are sans serif as well (like parenthesis, brackets, else?), italic Latin and Greek letters are serif.

Can someone shed some light on this document-class?
I'm also open to alternatives if this class is no longer mainstream.

Additional info

P.S. Should a bug report be filed to the class maintainer to fix the inconsistencies?

The code used for generating the examples above is the following:

\documentclass{slides}
\begin{document}
\[
\ldots\;\cdots\;\vdots\;,\;;\;:\;\sin(2x)
\]
\end{document}

ghostscript is then used to crop the maths out from the rendered PDF.

Live debugging

A slides document-class font answer has been given here by egreg. In this case, I'm not interested in using beamer. I'd like to understand what's going on.

The documentation, section 9.1, states that the font are set with:

\def\rmdefault{lcmss}
\def\sfdefault{lcmss}
\def\ttdefault{lcmtt}
\def\itdefault{sl}
\def\sldefault{sl}
\def\bfdefault{bx}
\def\updefault{n}

Although executing these commands in an article does change the main text font, the maths doesn't behave as when using the slides class.

Ah, okay, from section 9.5 we have that:

\SetSymbolFont{operators}{normal}{OT1}{lcmss}{m}{n}
\SetSymbolFont{letters}{normal}{OML}{lcmm}{m}{it}
\SetSymbolFont{symbols}{normal}{OMS}{lcmsy}{m}{n}
\SetSymbolFont{largesymbols}{normal}{OMX}{lcmex}{m}{n}

This gets the maths rendered in sans serif with the inconsistent punctuation, but at least the three vertical dots are not squashed together.

enter image description here

I guess it would be nice to consistently have now three little squares instead of circles for both \ldots and \dots… Maybe that's asking too much now.

Moreover, what's going on with the comma? Why does it not look squarish like the rest of the punctuation?

Finally, compiling the tex above with pdftex generates multiple warning about missing fonts and performed substitutions.

Early conclusions

  1. The three vertical dots are converted to little squares by \def\rmdefault{lcmss}, which changes the main text font (but leaves the maths unaltered if not for the three vertical dots). This smells like a bug to me.
  2. The semicolon, colon, sin, parenthesis, and the numbers are rendered with a sans serif font with the single command \SetSymbolFont{operators}{normal}{OT1}{lcmss}{m}{n}. I don't understand why the comma is unaffected.

Early self answer

Using the following template gives 10pt maths with a slides look.

\documentclass{article}
\SetSymbolFont{operators}{normal}{OT1}{lcmss}{m}{n}
\begin{document}
\[

\]
\end{document}
2
  • For the goal of importing math formulae prepared by latex into WYSIWYG slides, there are other tools. Many of them (such as klatexformula) allow you to configure the latex preamble used for generating the output. Commented Apr 11 at 7:18
  • Thanks, @WillieWong. My choice is IguanaTeX. This question asks about inconsistencies of the slides LaTeX class.
    – Atcold
    Commented Jun 10 at 20:15

1 Answer 1

2

By default \vdots (and \ddots are not characters from a font but constructed from positioned \hbox{.} this is, as you note, very noticable using cm sans serif which uses square dots, especially when paired with computer motern roman italic math, which is the default setup in slides.

this redefines \vdots to use a (round) math . and loads a bold unextended cm roman font to get (at least) :; to match the math fonts the medium weight roman ; looks too thin next to the slides sans serif, the chosen b weight is perhaps a bit heavy but probably workable.

enter image description here

having redefined \vdots to use a round . you could also tweak the positioning if desred (although I didn't do that here)

\RequirePackage{fix-cm}% cope with non standard sizes
\documentclass{slides}
\makeatletter
\DeclareSymbolFont{rmops}   {OT1}{cmr} {b}{n}% get back a roman font, for ; at least
\DeclareRobustCommand
  \vdots{\vbox{\baselineskip4\p@ \lineskiplimit\z@
      \kern6\p@\hbox{$.$}\hbox{$.$}\hbox{$.$}}} % no $ by default
  \DeclareMathSymbol{:}{\mathrel}{rmops}{"3A}% was operators
  \DeclareMathSymbol{;}{\mathpunct}{rmops}{"3B}% was operators
\makeatother
\begin{document}
\[
\ldots\;\cdots\;\vdots\;,\;;\;:\;\sin(2x)
\]
\[
\ldots\;\cdots\;\vdots\;,\;;\;:\;\sin(2\mathsf{x})
\]
\end{document}

7
  • Thanks, David, for your reply. A few follow up questions. 1. I couldn't find the \vdots definition in slides.cls. Where should I look? 2. The \vdots you provide look shorter than expected (if compared to the width of \cdots). 3. Can we have ; and : matching the font used for , (like when using the article class)? 4. Also, why is the comma rendered differently from the (semi)colon? 5. I'm not sure why you use \RequirePackage{fix-cm}. 6. Is there a way to use 10 pt size by default? 7. Once resolved, should I send a PR on GitHub to fix these? Thank you!
    – Atcold
    Commented Jun 10 at 21:01
  • 1
    @Atcold vdots is a standard latex command, it's not defined in the slides package. fix-cm allows cm fonts at any size see texdoc fix-cm add \showoutput you will see the math comma comes from lcmm but the math semicolon comes from lcmss you could change the mathcode of , Commented Jun 10 at 21:27
  • Wow, impressive! Where can I read up about rmops, "3A, and "3B? I did look at fix-cm, but I don't see where/how you use it in the snippet above. Removing it does not visibly change the output PDF. I found \vdots definition in plain.tex. Switching \baselineskip4 to 8 makes the dots vertical separation equal to the horizontal one. I believe slides define \baselineskip as half of what article does, for some reason. Thanks for mentioning \showoutput: very informative!
    – Atcold
    Commented 2 days ago
  • 1
    rmops is a local name just defined in the code above for "roman operators" so you won't find that name anywhere, it is defined as \DeclareSymbolFont{rmops} {OT1}{cmr} {b}{n}% get back a roman font, for ; at least which is a standard latex command built in to the latex format. @Atcold Commented 2 days ago
  • I tried changing the mathcode of ; to make it look like , for 40 minutes but unsuccessfully. \DeclareMathSymbol{;}{\mathpunct}{letters}{"3B} converts ; into a ,. I have no clue where to find the character tables so that I can assign the correct code to ;.
    – Atcold
    Commented 2 days ago

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .