Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I "fake" slanted text in LaTeX?

Tags:

fonts

latex

A font I am using does not have the slanted/oblique variant to it in LaTeX (NB: not italics), and I would like to have slanted text in places.

Is there an easy way to slant text without having to generate entirely new font files and such?

One suggested solution was to do:

\renewcommand{\textsl}[1]{\tikz[baseline=(X.base)] \node[xslant=0.2231153] (X) {#1};}

This works well for one or two words, but tikz nodes don't break across lines, so it's not adequate, for, say, a theorem environment.

Obviously, a quick-and-dirty method will not give exceptional kerning or spacing, but I am not concerned about that. However, a 13 degree shear/slant would be desirable.

like image 255
Quadrescence Avatar asked Aug 17 '09 17:08

Quadrescence


People also ask

How do you slant your text?

To make text italic, select and highlight the text first. Then hold down Ctrl (the control key) on the keyboard and then press the I on the keyboard. To underline text, select and highlight the text first. Then hold down Ctrl (the control key) on the keyboard and then press the U on the keyboard.

How do you type slanting?

You can double-click the text box to type any text you'd like. To adjust the angle of your text box, click anywhere in the box. You'll see a semicircular “Rotate” arrow at the top of the box. Click and hold the arrow, and then drag to rotate your text box in whichever direction you'd like.

What is the slanted font called?

Taking their name from Italian designed calligraphic typefaces, italic fonts are traditionally slanted to stress the importance of certain words or phrases. And because italic fonts have such a long history, type designers have created a range of stunning options.

Which font style is used to make the text look slanted?

Italic is a style of font that slants the letters evenly to the right.


1 Answers

You can do this easily in XeLaTeX:

\usepackage{fontspec}
...
\fontspec[ItalicFont=*,ItalicFeatures=FakeSlant]{Minion Pro}

Highly undesirable, however, if there's any chance you can get a real italic.

Update: why undesirable? Because font outlines are not designed to be distorted! Any sort of transformation besides linear scaling in both directions will change the relationship between the inner/outer curves of the letters, effectively going against the wishes of the font designer.

If you want to highlight something in a different font than the roman and not use italic, try something completely different like a harmonising sans serif, for example.

like image 132
Will Robertson Avatar answered Sep 26 '22 20:09

Will Robertson