10

Silly question: I want to use a heart (♥) character in my presentation.

I'm already using xelatex as engine so it doesn't complain for the character itself but it doesn't render it. Just a blank space where the character should be.

Here is the snippet of the offending code:

    (Celery + RabbitMQ) ♥  Django

Notice that I'm using markdown for the input format.

This is how I make the pdf

pandoc -t beamer --latex-engine=xelatex \
    in.md -oout.pdf --slide-level=2

I'm new to pandoc and latex in general.

♥ Thanks ♥

8
  • 2
    Maybe you need this : tex.stackexchange.com/a/9643/9467 Aug 22, 2012 at 16:20
  • Great! used $\heartsuit$ instead of ♥ and it worked great. If you put that as an answer i'll accept it.
    – tutuca
    Aug 22, 2012 at 16:49
  • 1
    Could newunicodechar help?
    – cgnieder
    Aug 22, 2012 at 21:38
  • 5
    There was nothing wrong with the edit, so why the bitter remark in the edit reasoning?
    – percusse
    Aug 22, 2012 at 22:30
  • 7
    Oh, we are kind of hiding in this obscure corner of SE. It's very easy to get rep here so people don't bother with 2 points. Besides, we have the amazing lockstep who is the edit/tag master (probably will visit this question too, check his edit stats :P). Just a reminder Not upvoting is preferred over Downvoting, hence less hassle and moar fun. If you see a question stuck at -1, it means that there is something seriously wrong about that question so we don't downvote more than -1. Other than that it's a pretty relaxed place.
    – percusse
    Aug 23, 2012 at 6:42

4 Answers 4

11

Maybe you need this answer.

enter image description here

\documentclass{standalone}
\usepackage{arev}
\begin{document}
$\heartsuit$
\end{document}
1
  • I just needed to use the latex sintax in the document. Time to learn some more latex. I'm loving pandoc.
    – tutuca
    Aug 22, 2012 at 22:25
9

If you want a tikzsolution this works

\documentclass{minimal}
\usepackage{tikz}
\newcommand{\heartz}{\begin{tikzpicture}[scale=0.01]
\draw[fill=black,thick,domain=0:2*pi,variable=\t,samples=100] %
plot ({16*sin(\t r)^3} , {13*cos(\t r) - 5*cos(2*\t r) - 2*cos(3*\t r) - cos(4*\t r) });
\end{tikzpicture}}
\begin{document}
\heartz 
\end{document}

This code was a result from a small discussion in chat, thanks to percusse.

Parametric equation for an heart.

1
  • For the current scale and samples values, there is a glitch at the bottom corner. Increasing either one can get rid of such a glitch. Aug 23, 2012 at 3:20
8

The following works for me:

\documentclass{article}

\usepackage{fontspec}
\setmainfont{XITS}

\begin{document}
♥ 
\end{document}
5

Just another fun stuff with PSTricks. Compile the given code with xelatex because the code use JPEG image with which latex-dvips-ps2pdf sequence cannot work.

User Defined Data

\def\Rows{5}
\def\Columns{5}
\def\Filename{tutuca.jpeg}%{example-grid-100x100pt}
\def\Scale{1.45}

Output

enter image description here

enter image description here

Complete Code

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{graphicx}
\usepackage{pst-func}

% user defined data
\def\Rows{5}
\def\Columns{5}
\def\Filename{tutuca.jpeg}%{example-grid-100x100pt}
\def\Scale{1.45}

% internal used data
\newsavebox\IBox
\savebox\IBox{\includegraphics[scale=\Scale]{\Filename}}

\def\func{%
    \psparametricplot{0}{2.5 .25 exp}{t^2  | 0.8*(sqrt(2.5-t^4)+t)}
    \psparametricplot{2.5 .25 exp}{0}{t^2  | 0.8*(-sqrt(2.5-t^4)+t)}
    \psparametricplot{0}{2.5 .25 exp}{-t^2 | 0.8*(-sqrt(2.5-t^4)+t)}
    \psparametricplot{2.5 .25 exp}{0}{-t^2 | 0.8*(sqrt(2.5-t^4)+t)}
}

\psset
{
    xunit=0.5\dimexpr\wd\IBox/\Columns\relax,
    yunit=0.5\dimexpr\ht\IBox/\Rows\relax,
    algebraic,
    plotpoints=500,
}

\begin{document}

\begin{pspicture}[showgrid=top](-\Columns,-\Rows)(\Columns,\Rows)
    \rput(0,0){\usebox\IBox}
    \pscustom[unit=2cm,origin={0,-0.3},linecolor=yellow]{\func}
\end{pspicture}

\begin{pspicture}[showgrid=false](-\Columns,-\Rows)(\Columns,\Rows)
    \psclip{\pscustom[linestyle=none,linewidth=0pt,unit=2cm,origin={0,-0.3}]{\func}}
        \rput(0,0){\usebox\IBox}
    \endpsclip
\end{pspicture}

\end{document}
2
  • 5
    I'm not sure if I should feel amused, flattered or disturbed :D
    – tutuca
    Aug 23, 2012 at 1:06
  • @tutuca: hopefully it is not the last one. :-) Aug 23, 2012 at 1:08

You must log in to answer this question.

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