Text FormattingCreating symbol

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Creating symbol

Post by svend_tveskaeg »

Hi all.

I watched an episode of QI the other day and the character interrobang was mentioned. Natually, this had to be examined closer so I had a look at the Comprehensive LaTeX Symbol List and there it was, in Table 40. This is all good and well but how is this symbol designed in LaTeX?

Can it be made independent of the font so that the exclamation mark is vertically horizontically centered relative to the question mark? (I have not tried anything myself since I have no idea where to begin.)

Thank you in advance!
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Creating symbol

Post by kaiserkarl13 »

It says in the table that the symbol is "faked" only if there are two present; since there aren't I would assume \textinterrobang is part of a font. You could try to make your own using something like !$\!$? or !$\mkern{-0.01em}$?, but the right widths would depend on the particular typeface you've chosen and are not universal.

If we hit that bullseye, the rest of the dominoes will fall like a house of cards---checkmate!
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Creating symbol

Post by svend_tveskaeg »

I had \mkern in mind myself but I find it rather inelegant*). Is this really the way to go?

Is it not possible to measume half the width of a question mark and then tell LaTeX to insert a exclamation point there? That would be universal.

*) I cannot explain why so I know that is it a lousy argument...
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Creating symbol

Post by cgnieder »

One wouldn't need \mkern, there's also the text mode equivalent \kern. Another possibility for superimposiung two characters could be \ooalign. However, to get it right in this case is a tedious task and in any case font dependent (*) so I would go with the real font character if possible:

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{textcomp}

\newcommand*\fakeinterrobang{?\kern-.845ex!}
\newcommand*\Fakeinterrobang{{\ooalign{?\cr\kern.2ex!\cr}}}

\begin{document}

\textinterrobang \fakeinterrobang \Fakeinterrobang

\Large \textinterrobang \fakeinterrobang \Fakeinterrobang

\huge \textinterrobang \fakeinterrobang \Fakeinterrobang

\normalsize\ttfamily
\textinterrobang \fakeinterrobang \Fakeinterrobang

\end{document}
Regards

(*) There is no fixed width for a interrogation mark or an exclamation mark and it isn't even a fixed fact that the dot below is in the middle of the width...
site moderator & package author
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Re: Creating symbol

Post by svend_tveskaeg »

@Clemens:
Spot on. Thank you.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
Post Reply