5
votes
2answers
62 views

Does the LaTeX kernel define font-shape macros that expand to `it', `sc', etc.?

I need to perform a test on the current font shape. More specifically, I need to detect whether the current font shape is italic or slanted. Joseph Wright already provided a solution in his answer to ...
5
votes
2answers
353 views

String test, with complicated arguments

I have a command \mycom{} which takes 1 argument. The command should perform a test on the argument and do something accordingly. For simple arguments, I can use \ifthenelse, but I need to consider ...
6
votes
1answer
148 views

Is testing f@shape considered best practice method for reliably detecting italic and slant modes?

Subject says it all. Is testing f@shape the cleanest, clearest, simplest, most reliable way to check for italic and slant modes? e.g.: \ifthenelse{\equal{\f@shape}{sl}}{italic}{not italic} ...
5
votes
2answers
176 views

Check if mathversion (font) is defined

One can define a new mathversion using \DeclareMathVersion{sans}. I wonder if I can test the existence of such a font definition, for example with \IfMathVersionDefined{sansmath} {math font is ...
14
votes
3answers
457 views

Detect which text “mode” (normal, italic, bold, etc.) is currently in use?

In my document, I'm often setting upper case words and abbreviations in small caps because it avoids breaking the flow (which upper case words does). Also, many words (like CUDA, for instance) are ...
4
votes
1answer
170 views

Defining a command that distinguishes between greek and roman letters?

I'm using pdftex and I want to define a command for the typesetting of quantum mechanical operators that produces upright letters with a \hat accent. The problem is that the obvious solution ...
14
votes
2answers
1k views

How can I test for the current font?

The situation is the following, I have one font a with one feature and another font b with another feature and I am writing a command that if the current font is a need to switch to font b but if the ...