0

This is my first time using r-markdown and running into problems rendering the symbol above. Everything else works great. It also works in r in ggplot2 but won't work in r-markdown. When I include "\usepackage[utf8x]{inputenc}" it renders but gives a document clash. I have seen solutions for using a different engine but I don't want to mess up my formatting. Anyone know a way to render the symbol without changing engines? Anyone know what packages are classing and how to rectify it? I have included all packages below.

Thanks.

  -\usepackage{geometry}
  - \usepackage[english]{babel}
  - \usepackage{natbib}
  - \usepackage{url}
  - \usepackage{amsmath}
  - \usepackage{graphicx}
  - \graphicspath{{S:/Analysis/ECAC/Mike_R/}}
  - \usepackage{parskip}
  - \usepackage{fancyhdr}
  - \usepackage{vmargin}
  - \usepackage{float}
  - \usepackage{caption,booktabs,array}
  - \usepackage[most]{tcolorbox}
  - \usepackage{lscape}
  - \usepackage{subcaption}
  - \newcommand{\rowgroup}[1]{\hspace{-1em}#1}
  - \setmarginsrb{3 cm}{2.5 cm}{3 cm}{2.5 cm}{1 cm}{1.5 cm}{1 cm}{1.5 cm}
  - \title{}
  - \author{}                               
  - \date{\today}                                   
  - \makeatletter
  - \let\thetitle\@title
  - \let\theauthor\@author
  - \let\thedate\@date
  - \makeatother
  - \pagestyle{fancy}
  - \fancyhf{}
  - \rhead{ECAC}
  - \lhead{\thetitle}
  - \cfoot{\thepage}
  - \captionsetup{font=Large}
  - \usepackage{hyperref}
  - \usepackage[utf8x]{inputenc}
4
  • Welcome to TSE. Please post a Minimal Working Example. Jul 28, 2022 at 15:26
  • avoid utf8x it does not work with current latex, You could use the standard utf8 option but that is the default so you can delete \usepackage[utf8x]{inputenc} Jul 28, 2022 at 16:01
  • U+1F693 is a Police Car 🚓 You would need to specify font that had that character (probably no font for pdflatex, you could use lualatex, or use an image) Jul 28, 2022 at 16:03
  • If you want to include random unicode characters you really should use luatex not pdftex. You can configure pdftex to recognise some ranges but doing emoji this way will lead to pain. If you use luatex and a big unicode font they may simply "just work" Jul 28, 2022 at 16:14

1 Answer 1

3

If you used lualatex you could use a font covering this range, but with pdftex I'd use an image.

enter image description here

\documentclass{article}
\usepackage{graphicx}
\DeclareUnicodeCharacter{1F693}{\includegraphics[height=1em]{police.png}}

\begin{document}

U+1F693 is POLICE CAR: 🚓

\end{document}

where police.png is

enter image description here

2
  • Does your licensing declaration apply also to hand drawn images? (I assume that's what police.png is.) :-) Jul 28, 2022 at 19:50
  • @WillieWong I am open to commissions if you are needing such high quality artwork Jul 28, 2022 at 19:55

You must log in to answer this question.

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