6

I was following the solution given here to try get this effect: enter image description here

but this solution was unsuccessful. This is what outputs from the code given below:

enter image description here

Can you help me get the text to show up next to the figures as in the first image above?

Here is the code that I have so far:

\documentclass{article}
\usepackage{graphicx}

\newcommand*{\authorimg}[1]{%
  \raisebox{-.3\baselineskip}{%
    \includegraphics[
      height=\baselineskip,
      width=\baselineskip,
      keepaspectratio,
    ]{#1}%
  }%
}

\begin{document}
\begin{itemize}
\item[\authorimg{example-image-a}] FONTS\\The range of fonts on your\\
computer is often highly distinctive\\(unless you only have the fonts\\the machine came with)
\item[\authorimg{example-image-b}] SCREEN SIZE\\Though easily switched, this\\setting can be a useful aspect of\\your devices's fingerprint
\end{itemize}
\end{document}
2
  • 1
    Why not consider using a tabular environment instead of an itemize env? Should the image really only have a height and width of \baselineskip? I would guess you want an image of the same height as the words on the right?
    – Troy
    Commented Apr 25, 2017 at 1:23
  • @Troy, thanks for your input. I would ideally like the images the same height as the words to the right. How can I make this happen? Thanks!
    – Joe
    Commented Apr 25, 2017 at 1:27

2 Answers 2

5

Something like this?

fonts

\documentclass[]{article}
\usepackage{graphicx,array}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{document}
    \begin{tabular}{C{2.8cm}  L{5.5cm}}
        \includegraphics[width=\linewidth]{example-image-a} & FONTS \newline 
        The range of fonts on your computer is often highly distinctive (unless you only have the fonts the machine came with) \\
        \includegraphics[width=\linewidth]{example-image-a} & SCREEN SIZE \newline 
        Though easily switched, this setting can be a useful aspect of your device's fingerprint \\
        \includegraphics[width=\linewidth]{example-image-a} & SOFTWARE \newline 
        Do you have an art director's toolkit or are you an unrepentant gamer? Or both?
    \end{tabular}
\end{document}

I fixed the widths of both columns in order to reproduce something similar to what you have, solution referenced here. These allow for manual line breaking via \newline, which is what I used to line break from FONTS etc.

2

enter image description here

with use of miniage in the first item only:

\documentclass{article}
\usepackage{graphicx}

\newcommand*{\authorimg}[1]{%
  \raisebox{-.3\baselineskip}{%
    \includegraphics[
      height=\baselineskip,
      width=\baselineskip,
      keepaspectratio,
    ]{#1}%
  }%
}

\begin{document}
\begin{itemize}
\item[\authorimg{example-image-a}] \begin{minipage}{\dimexpr\linewidth-2\baselineskip\relax}
                                    FONTS\\The range of fonts on your\\
                                    computer is often highly distinctive\\
                                    (unless you only have the fonts\\
                                    the machine came with)
                                    \end{minipage}
\item[\authorimg{example-image-b}] SCREEN SIZE\\Though easily switched, this\\setting can be a useful aspect of\\your devices's fingerprint
\end{itemize}
\end{document}

Addendum: to have bigger image you need

  • to define bigger labelwidth (that image has space in label)
  • image size accommodate to label width

For example, that image size should be equal to 4\baselineskip than yo can change above MWE as follows:

\documentclass{article}
\usepackage{graphicx}
\usepackage{enumitem}

\newcommand*{\authorimg}[1]%
    { \raisebox{-1\baselineskip}{\includegraphics[width=\imagesize]{#1}}}
\newlength\imagesize    % new lwngth for determining image size and label width

\begin{document}
\begin{itemize}[leftmargin=1.2\imagesize,labelwidth=\imagesize]% left margin is 20% bigger than label width
    \setlength\imagesize{4\baselineskip}
\item[\authorimg{example-image-a}] \begin{minipage}{\dimexpr\textwidth-1.2\imagesize\relax}
                                    FONTS\\
                                    The range of fonts on your\\
                                    computer is often highly distinctive\\
                                    (unless you only have the fonts\\
                                    the machine came with)
                                    \end{minipage}
\end{itemize}
\end{document}

enter image description here

2
  • 1
    Thanks for your solution! How do I change the size of the image though?
    – Joe
    Commented Apr 25, 2017 at 1:33
  • 1
    @Joe, see addendum to my answer.
    – Zarko
    Commented Apr 25, 2017 at 1:53

You must log in to answer this question.

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