7

How to slant some character in the text of roman font (I don't want to use italics coding)?

jak123
  • 4,252
  • 5
  • 26
  • 49
Mydeen
  • 71

2 Answers2

11

Slant font of plain TeX

The plain TeX format defines \tensl to hold the slanted (not italics) variant of the default CM roman font, from plain.tex:

\font\tensl=cmsl10 % slanted roman

It can be used via \tensl or the higher level command \sl:

Default font vs.~{\sl slanted font.}
\bye

For more details, see the answer of egreg.

Result slanted font

Slanting with TikZ

TikZ can be used with plain TeX, it allows arbitrary slant angles:

\input tikz

\def\slant#1#2{%
  \tikz[baseline=(X.base), xslant=tan(#1)]
    \node[inner sep=0pt, xslant=tan(#1)](X){#2};%
}

Normal, \slant{9.46}{slanted,} \slant{45}{larger slanting,}
\slant{-15}{slanted to the left.}

\bye

Result TikZ

Heiko Oberdiek
  • 271,626
7

The Plain TeX format provides \sl, so

This is {\sl slanted\/} type

will do.

If you need “boldface slanted”, you have to define the font:

\font\tenslbf=cmbxsl10
\def\slbf{\tenslbf}

(the definition is just to possibly support math mode, if needed).

Full example:

\font\tenslbf=cmbxsl10
\def\slbf{\tenslbf}

This is {\sl slanted\/} type.

This is {\slbf boldface slanted\/} type.

\bye

enter image description here

Here's the basic support for math:

\font\tenslbf=cmbxsl10
\newfam\slbffam
\textfont\slbffam=\tenslbf
\def\slbf{\tenslbf\fam\slbffam}

This is {\sl slanted\/} type.

This is {\slbf boldface slanted\/} type.

${\sl n}\neq{\slbf n}$

\bye

enter image description here

egreg
  • 1,121,712
  • Thanks bro. Actually I am using 3B2 softwareIn this it has option to def. as I coded. \def \bf {\tf="XXX"} means assign the font for \bf code. It has no option for create external cls file. The above coding is not supported in 3B2. Thanks for your swift reply and answers. – Mydeen Jun 24 '15 at 08:25
  • @Mydeen That I know of, 3B2 no longer uses TeX at all so that is perhaps not a surprise! – Joseph Wright Jun 24 '15 at 08:26
  • Is that any other way to get the output in 3B2. – Mydeen Jun 24 '15 at 08:29
  • @Mydeen 3B2 is commercial software and presumably has appropriate support. If there is a TeX back end in the version you have then it should be accessible somewhere. If it doesn't we can't really help. – Joseph Wright Jun 24 '15 at 10:58