
Estou tendo problemas para incorporar perfeitamente uma imagem em uma linha de texto. O ideal é que a imagem seja dimensionada para o tamanho correto para que caiba na linha do texto. Isso é tudo que consegui. Embora esteja perto, a imagem fica muito alta. Alguma ideia? Obrigado!
\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}
Aqui está uma imagem do que eu consigo com isso:
Responder1
Assim?
\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}
Conforme está escrito, isso não se adaptará às alterações de tamanho da fonte no documento. Você pode, no entanto, definir um novo \inlinegraphics{}
comando que faça isso:
\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}
Responder2
Simplesmente abaixe de 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}