如何使 \includegraphics 与文本居中?

如何使 \includegraphics 与文本居中?

所以我有以下文档,它呈现如下图形和文本: 感觉如何

但我想实现这个: 我需要的是

如何将文本置于图形的中间?

我搜索了\includegraphics所有选项但找不到任何相关的内容。

\documentclass[letterpaper,11pt]{article}

\usepackage{latexsym}
\usepackage[empty]{fullpage}

\usepackage[usenames,dvipsnames]{color}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage{fancyhdr}
\usepackage{graphicx}

\graphicspath{{./images/}}

\setlist{leftmargin=2.5mm}

\pagestyle{fancy}
\fancyhf{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\usepackage[margin=0.1in]{geometry}

\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}

\newcommand{\resumeItem}[2]{
  \item\small{
    \textbf{#1}{: #2 \vspace{-2pt}}
  }
}

\newcommand{\resumeSubheadingSecond}[6]{
  \vspace{-1pt}\item
    \begin{tabular*}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r}
      \textbf{#1} & #2 \\
      \textit{\small#3} & \textit{\small #4} \\
      \textit{\small#5} & \textit{\small #6} \\
    \end{tabular*}\vspace{-5pt}
}

\newcommand{\resumeSubItem}[2]{\resumeItem{#1}{#2}\vspace{-4pt}}

\renewcommand{\labelitemii}{$\circ$}

\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeSubHeadingListEnd}{\end{itemize}}
\newcommand{\resumeItemListStart}{\begin{itemize}}
\newcommand{\resumeItemListEnd}{\end{itemize}\vspace{-5pt}}

\begin{document}

\section{Experience}
{\small
  \resumeSubHeadingListStart
      \resumeSubheadingSecond
      {\includegraphics[width=1cm, height=1cm]{google} Google}{Blah blah}
      {Blah blah}{Blah Blah}
      {Blah blah}{}
        \begin{itemize}
        \item Blah blah blah
        \end{itemize}
  \resumeSubHeadingListEnd
}
\end{document}

我搜索了\includegraphics所有选项但找不到任何相关的内容。

答案1

您正在寻找的valign=c包裹adjustbox

\documentclass[letterpaper,11pt]{article}

\usepackage{latexsym}
\usepackage[empty]{fullpage}

\usepackage[usenames,dvipsnames]{color}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage{fancyhdr}
\usepackage{graphicx}

\graphicspath{{./images/}}

\setlist{leftmargin=2.5mm}

\pagestyle{fancy}
\fancyhf{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\usepackage[margin=0.1in]{geometry}

\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}

\newcommand{\resumeItem}[2]{
  \item\small{
    \textbf{#1}{: #2 \vspace{-2pt}}
  }
}

\newcommand{\resumeSubheadingSecond}[6]{
  \vspace{-1pt}\item
    \begin{tabular*}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r}
      \textbf{#1} & #2 \\
      \textit{\small#3} & \textit{\small #4} \\
      \textit{\small#5} & \textit{\small #6} \\
    \end{tabular*}\vspace{-5pt}
}

\newcommand{\resumeSubItem}[2]{\resumeItem{#1}{#2}\vspace{-4pt}}

\renewcommand{\labelitemii}{$\circ$}

\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeSubHeadingListEnd}{\end{itemize}}
\newcommand{\resumeItemListStart}{\begin{itemize}}
\newcommand{\resumeItemListEnd}{\end{itemize}\vspace{-5pt}}

\usepackage[export]{adjustbox}

\begin{document}

\section{Experience}
{\small
  \resumeSubHeadingListStart
      \resumeSubheadingSecond
      {\includegraphics[width=1cm, height=1cm,valign=c]{example-image-duck} Google}{Blah blah}
      {Blah blah}{Blah Blah}
      {Blah blah}{}
        \begin{itemize}
        \item Blah blah blah
        \end{itemize}
  \resumeSubHeadingListEnd
}
\end{document}

相关内容