Разместите текст рядом с изображением

Разместите текст рядом с изображением

Я следовал зарешение дано здесьчтобы попытаться получить этот эффект: введите описание изображения здесь

но это решение не удалось. Вот что выводит код, приведенный ниже:

введите описание изображения здесь

Можете ли вы помочь мне сделать так, чтобы текст отображался рядом с рисунками, как на первом изображении выше?

Вот код, который у меня есть на данный момент:

\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}

решение1

Что-то вроде этого?

шрифты

\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}

Я исправил ширину обоих столбцов, чтобы воспроизвести что-то похожее на то, что у вас есть, ссылка на решениездесь. Они позволяют вручную разрывать строки с помощью \newline, что я и использовал для разрыва строк FONTSи т. д.

решение2

введите описание изображения здесь

с использованием miniageтолько в первом пункте:

\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}

Дополнение: чтобы иметь большее изображение, вам нужно

  • определить больше labelwidth(чтобы изображение имело место в метке)
  • размер изображения соответствует ширине этикетки

Например, размер изображения должен быть равен 4\baselineskipтому, что вы можете изменить выше MWE следующим образом:

\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}

введите описание изображения здесь

Связанный контент