I am trying to write the new Twitter symbol to a file
but I don't understand how to use declareunicodecharacter in this case. Does anyone know if it can be generated ?
I am trying to write the new Twitter symbol to a file
but I don't understand how to use declareunicodecharacter in this case. Does anyone know if it can be generated ?
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}
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}
it could be further improved by setting the default response in code to print sans serif
– nilon Feb 03 '24 at 14:09
\DeclareUnicodeCharacter, are you perhaps looking for something like this? https://tex.stackexchange.com/a/29462 – gz839918 Jul 25 '23 at 02:48