8

Memes are trivial to generate online. I was wondering however if there is a simple, elegant template for doing it with Latex. I haven't found anything on this.

I'm thinking on two ways. One is just a standalone image/figure, e.g. with tikz. Another is to program a function where you enter the inputs (image, text, etc). Just to give an example, for a particular image:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}


\begin{tikzpicture}[anchor=center]
    \node  {\includegraphics{photo.jpg}};
    \draw (3.1,-3.5) node[rotate=7] {\huge \textbf{Quake $>$ Counter-Strike}};
\end{tikzpicture}

\end{document}

where "photo.jpp" is the empty one taken from here. This results in:

enter image description here

So, the questions. Is there a meme generator around based on Latex? If not, which is an efficient template to produce one? Maybe you can share one? I made one attempt, but I'm not an expert at all in Latex, let alone Tikz (or alternatives). Naturally, memes vary in size, shape and form, so ideally a general tool would be great, but of course, this is likely to be difficult.

3

2 Answers 2

8

It depends a bit on how you define meme but possibly you are looking for the tikzlings package. ;-)

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikzlings}
\begin{document}
\begin{tikzpicture}[pics/dent/.style={code={
\draw (0,2.7) to[out=0,in=180] (1.8,3.1) to[out=0,in=70] (2.9,1)
to[out=-110,in=90] (2.5,-1) to[out=-90,in=0] (1.5,-3.1)
to[out=180,in=0] (0,-0.8) to[out=180,in=0] (-1.5,-3.1) 
to[out=180,in=-90] (-2.5,-1) to[out=90,in=-70] (-2.9,1) to[out=110,in=180] (-1.8,3.1)
to[out=0,in=180] cycle;}}]
\pic[thick,scale=0.2]{dent};
\node[scale=7] at (-2,1) {$=\rho$};
\mouse[shift={(-6,0)},scale=1]
\end{tikzpicture}
\end{document}

enter image description here

1
  • 1
    +1, very interesting use of tikzlings!
    – CarLaTeX
    Jun 5, 2019 at 5:41
3

I just had to do some memes, understand a photo with some message on it typeset with white font and black font border. The code has to be compiled with lualatex if you want to use the Impact font (available at least on my Win10).

The firsttime.jpg image used in the example was obtained here.

% arara: lualatex
\documentclass[tikz]{standalone}
% Package for handling graphics
\usepackage{graphicx}
% Package for loafding system fonts
\usepackage{fontspec}
% Load system impact font, qui common for memes apparently
\setmainfont{Impact}
% Package for font frame coloring
\usepackage{contour}
% Style to ease relative positionning of node w.r.t the image
\tikzset{
    use bounding box relative coordinates/.style={
        shift={(current bounding box.south west)},
        x={(current bounding box.south east)},
        y={(current bounding box.north west)}
    },
}

\begin{document}
% Settings for font contours
% Contour thickness
\contourlength{2pt}
% Resolution of the contour (number of copies of the contour shape)
\contournumber{100}
\begin{tikzpicture}[inner sep=0pt,outer sep=0pt]
    \node[use as bounding box] {
        \includegraphics[
            % Diemnsions to be set if you want to print the meme as a standard photo 10*15 format
            width=15cm,
            height=10cm,
            keepaspectratio
            ]{firsttime.jpg}};
    \begin{scope}[use bounding box relative coordinates]
              \node[anchor=south] at (0.5,0.03) {\contour{black}{\fontsize{35}{0} \selectfont \textcolor{white}{First time ?}}};
    \end{scope}
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

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