텍스트 줄 안에 작은 이미지 삽입

텍스트 줄 안에 작은 이미지 삽입

텍스트 줄에 이미지를 완벽하게 삽입하는 데 문제가 있습니다. 이상적으로는 이미지가 텍스트 줄에 맞도록 올바른 크기로 조정되어야 합니다. 이것이 내가 얻은 한입니다. 가까이 있으면 이미지가 너무 커집니다. 어떤 아이디어가 있나요? 감사해요!

\documentclass[preprint2]{aastex}

\usepackage{graphicx}

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

\begin{document}

\begin{enumerate}
\item When ready, click `record \img{Record.png}'.  There will be a three second period before the actual data collection begins.
\end{enumerate}

\end{document}

내가 얻은 이미지는 다음과 같습니다.

샘플 이미지

답변1

이와 같이?

호랑이 통합

\documentclass{article}
\usepackage{graphicx,calc}
\newlength\myheight
\newlength\mydepth
\settototalheight\myheight{Xygp}
\settodepth\mydepth{Xygp}
\setlength\fboxsep{0pt}
\begin{document}
  This is some arbitrary \raisebox{-\mydepth}{\fbox{\includegraphics[height=\myheight]{tiger}}} line of uninteresting text.
\end{document}

작성된 대로 이는 문서 내의 글꼴 크기 변경에 적용되지 않습니다. 그러나 \inlinegraphics{}이를 수행하는 새 명령을 정의할 수 있습니다 .

\documentclass{article}
\usepackage{graphicx,calc}
\newlength\myheight
\newlength\mydepth
\settototalheight\myheight{Xygp}
\settodepth\mydepth{Xygp}
\setlength\fboxsep{0pt}
\newcommand*\inlinegraphics[1]{%
  \settototalheight\myheight{Xygp}%
  \settodepth\mydepth{Xygp}%
  \raisebox{-\mydepth}{\includegraphics[height=\myheight]{#1}}%
}
\begin{document}
  This is some arbitrary \raisebox{-\mydepth}{\fbox{\includegraphics[height=\myheight]{tiger}}} line of uninteresting text.

  This should adapt \inlinegraphics{example-image-a}.

  \Huge Will this adapt \inlinegraphics{example-image-b} nicely?

  \tiny That is yet to be \inlinegraphics{example-image-a} seen.
\end{document}

적응 호랑이

답변2

간단히 다음에서 낮추십시오 0.3\baselineskip:

\documentclass{article}%[preprint2]{aastex}

\usepackage{graphicx}

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

\begin{document}

\begin{enumerate}
\item When ready, click `record \img{Vinyl.png}'. There will be a three second period before the actual data collection begins.
\end{enumerate}

\end{document} 

여기에 이미지 설명을 입력하세요

관련 정보