14

I have produced a Je suis Charlie image, and I wanted initially to use the standalone class, but I did not obtain the intended result.

Here is the intended result:

Je suis Charlie

Here is the produced result:

Je suis Charlie, no line break

Here is the code:

% -*- coding: iso-latin-1; -*-

\documentclass[border=.5cm]{standalone}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[dvipsnames,usenames]{color}
\pagecolor{black}
\usepackage{dejavu}
\begin{document}
%\Huge

\textcolor{Gray}{JE SUIS}
\bfseries
\textcolor{red}{CHARLIE}

\mdseries
\textcolor{Gray}{JE SUIS}
\bfseries
\textcolor{red}{POLICIER}

\mdseries
\textcolor{Gray}{JE SUIS}
\bfseries
\textcolor{red}{JUIF}

\mdseries
\textcolor{Gray}{JE SUIS}
\bfseries
\textcolor{red}{MUSULMAN}

\mdseries
\textcolor{Gray}{JE SUIS}
\bfseries
\textcolor{red}{ATHÉE}

\mdseries
\textcolor{Gray}{JE SUIS}
\bfseries
\textcolor{red}{FRÉDÉRIC}

\mdseries
\textcolor{Gray}{JE SUIS}
\bfseries
\textcolor{red}{AHMED}

\mdseries
\textcolor{Gray}{JE SUIS}
\bfseries
\textcolor{red}{YOHAV}

\mdseries
\textcolor{Gray}{JE SUIS}
\bfseries
\textcolor{red}{FRANÇAIS}

\mdseries
\textcolor{Gray}{JE DEMEURE}
\bfseries
\textcolor{white}{LIBRE !}


\end{document}
  • 2
    You need to use the varwidth option. – Alan Munn Jan 11 '15 at 17:11
  • @AlanMunn indeed, this does it! didn't know about that. Thanks. – user4686 Jan 11 '15 at 17:43
  • @AlanMunn I did not ask you to promote your comment into an answer, because yours is also mentioned there in comments, and the tabular + package array approach of the already provided answer, which has attracted a number of upvotes, has its advantages, hence I accepted it. But in my use case (for adding a Je suis chrétien some people told me found was lacking), I used your varwidth option proposal. – user4686 Jan 12 '15 at 8:29
23

standalone does not really provide a paragraph mode, you better enclose everything in a tabular. You can, moreover, save yourself a lot of typing ;)

enter image description here

\documentclass[border=.5cm]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[dvipsnames,usenames]{color}
\pagecolor{black}
\usepackage{dejavu}
\usepackage{array}
\begin{document}
%\Huge
\begin{tabular}{>{\color{Gray}JE SUIS\ \color{red}\bfseries}l}
CHARLIE\\
POLICIER\\
JUIF\\
MUSULMAN\\
ATHÉE\\
FRÉDÉRIC\\
AHMED\\
YOHAV\\
FRANÇAIS\\
\multicolumn{1}{l}{\color{Gray}JE DEMEURE
\color{white}\bfseries LIBRE !}
\end{tabular}

\end{document}

(Text used in this answer doesn't necessarily express my opinion.)

| improve this answer | |
  • 2
    Or use the varwidth option, that allows \\ for the line breaks. But tabular is handier for avoiding formatting instructions. – egreg Jan 11 '15 at 17:17
  • @egreg Yeah, that works as well of course (and makes my first sentence partially invalid...). – yo' Jan 11 '15 at 17:18
  • @yo' I avoided the typing from copy-yanking in the Emacs buffer, but doing as you do is better, thanks. – user4686 Jan 11 '15 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy