2

Let's consider the following sentence:

\documentclass[10pt,a4paper]{article}
\begin{document}
We often call these players \emph{spoiler} and \emph{duplicator}, \emph{\'Elo\"ise} and \emph{Ab\'elard} or $\exists$ and $\forall$.
\end{document}

What I'd want now is a slanted version of the \forall and the \exists symbols, is there a way to do this (some sort of \mathsl or something like that)?

Or would you say that this really is too ugly?

konewka
  • 377

2 Answers2

2

Ugly as hell. ;-)

\documentclass{article}

\usepackage{graphicx}

\DeclareRobustCommand{\slantflip}[1]{%
  \raisebox{\depth}{%
    \scalebox{1}[-1]{%
      \scalebox{-1}[1]{\slshape\sffamily#1}%
    }%
  }\negthinspace
}

\newcommand{\allsl}{\slantflip{A}}
\newcommand{\allex}{\slantflip{E}}

\begin{document}

\allsl{} and \allex{}

\end{document}

enter image description here

egreg
  • 1,121,712
2

The following example uses slanting via TikZ:

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

The slant angle is #1 and the slanted material is in #2. For some unknown reason, the bounding box is pretty wrong, the box is horizontally centered at the baseline with much shorter height. Therefore the definition \xslant sets the bounding box manually.

The slant angle can be given by the optional argument. The default is 76 (measured from the slanted upper case I of Computer Modern fonts).

The macro \xslantmath is an extended version, which puts the argument in math and respects the current math style.

\documentclass[10pt,a4paper]{article}
\usepackage{tikz}

\newcommand*{\xslant}[2][76]{%
  \begingroup
    \sbox0{#2}%
    \pgfmathsetlengthmacro\wdslant{\the\wd0 + cos(#1)*\the\wd0}%
    \leavevmode
    \hbox to \wdslant{\hss
      \tikz[
        baseline=(X.base),
        inner sep=0pt,
        transform canvas={xslant=cos(#1)},
      ] \node (X) {\usebox0};%
      \hss
      \vrule width 0pt height\ht0 depth\dp0 %
    }%
  \endgroup
}

\makeatletter
\newcommand*{\xslantmath}{}
\def\xslantmath#1#{%
  \@xslantmath{#1}%
}
\newcommand*{\@xslantmath}[2]{%
  % #1: optional argument for \xslant including brackets
  % #2: math symbol
  \ensuremath{%
    \mathpalette{\@@xslantmath{#1}}{#2}%
  }%
}
\newcommand*{\@@xslantmath}[3]{%
  % #1: optional argument for \xslant including brackets
  % #2: math style
  % #3: math symbol
  \xslant#1{$#2#3\m@th$}%
}
\makeatother

\begin{document}
\noindent
We often call these players \emph{spoiler} and \emph{duplicator} or
\xslantmath{\exists} and \xslantmath{\forall}$\!$.
\end{document}

Result

Heiko Oberdiek
  • 271,626