2

I am trying to write the new Twitter symbol to a file

enter image description here

but I don't understand how to use declareunicodecharacter in this case. Does anyone know if it can be generated 𝕩 ?

2
  • 1
    With \DeclareUnicodeCharacter, are you perhaps looking for something like this? tex.stackexchange.com/a/29462
    – gz839918
    Jul 25, 2023 at 2:48
  • I've tried but it doesn't work (I think I really don't know how to do it correctly, that's why I'm looking for guidance) Jul 25, 2023 at 3:04

1 Answer 1

8

Although you asked for a lowercase x, the new logo for Twitter is actually an uppercase blackboard X.

Here's a solution for pdfLaTeX. You can replace \mathbb and \mathbbm with \mathbbmss to get sans serif if you're trying to mimic the new Twitter logo.

%!TeX program = pdfLaTeX
\documentclass{article}
\usepackage[utf8]{inputenc}

% Use these two lines for uppercase X:
\usepackage{amssymb}
\DeclareUnicodeCharacter{1D54F}{$\mathbb{X}$}

% Use these two lines for lowercase X:
\usepackage{bbm}
\DeclareUnicodeCharacter{1D569}{$\mathbbm{x}$}

\begin{document}

Uppercase: 𝕏 \qquad Lowercase: 𝕩

\end{document}

Image shows blackboard bold letters uppercase X and lowercase x in a serif font.


With XeLaTeX or LuaLaTeX, and Latin Modern Math, you can skip \DeclareUnicodeCharacter and use Unicode directly in your input.

%!TeX program = XeLaTeX
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Latin Modern Math}
\begin{document}

Uppercase: 𝕏 \qquad Lowercase: 𝕩

\end{document}

Image shows blackboard bold letters uppercase X and lowercase x in a sans font.

1
  • this answer is excellent. it could be further improved by setting the default response in code to print sans serif
    – nilon
    Feb 3 at 14:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .