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 ?

Ingmar
  • 6,690
  • 5
  • 26
  • 47
  • 1
    With \DeclareUnicodeCharacter, are you perhaps looking for something like this? https://tex.stackexchange.com/a/29462 – gz839918 Jul 25 '23 at 02: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) – Luis Alexandher Jul 25 '23 at 03:04

1 Answers1

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.

gz839918
  • 1,938
  • this answer is excellent.

    it could be further improved by setting the default response in code to print sans serif

    – nilon Feb 03 '24 at 14:09