3

Having trouble here with creating a list, answering a problem set. For example, the answer to item B) is a graph that I created on Stata. I would like it to start inline with the "B)".

I'm using this code:

\documentclass[10pt]{article}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\linespread{1.3}
\usepackage{graphicx}
\renewcommand{\familydefault}{\sfdefault}
\setlength{\parskip}{\baselineskip}
\usepackage{caption}
\usepackage{enumerate}
\usepackage{mathtools}

\begin{document}
 % Skipping the whole body until the main problem...%

\section*{Questão2}
\begin{enumerate}[A)]
\item Para que possamos usar \textit{componentes} como instrumento de 
  \textit{educacao}, eles devem ser correlacionados e
  \textit{componentes} não deve afetar o salário/hora

\item \includegraphics[scale=0.3]{componentes}

\end{enumerate}
\end{document}
1

The image can be shifted via \raisebox. In the following example, the image is lowered until the top of the image is at the same height as the top of "B)". Option demo is only added because of the missing image file.

\documentclass[10pt]{article}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\linespread{1.3}
\usepackage[demo]{graphicx}
\renewcommand{\familydefault}{\sfdefault}
\setlength{\parskip}{\baselineskip}
\usepackage{caption}
\usepackage{enumerate}
\usepackage{mathtools}
\usepackage{calc}

\begin{document}

\section*{Questão2}
\begin{enumerate}[A)]
\item Para que possamos usar \textit{componentes} como instrumento de
  \textit{educacao}, eles devem ser correlacionados e
  \textit{componentes} não deve afetar o salário/hora

\item
  \raisebox{\heightof{B)}-\height}{\includegraphics[scale=0.3]{componentes}}

\end{enumerate}

\end{document}

Test

1

Another way to do this is to use the adjustbox package. This provides a simpler and more memorable interface to the adjustment.

\documentclass[10pt]{article}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\linespread{1.3}
\usepackage[demo]{graphicx}
\renewcommand{\familydefault}{\sfdefault}
\setlength{\parskip}{\baselineskip}
\usepackage{caption}
\usepackage{enumerate}
\usepackage{mathtools}
\usepackage{adjustbox}

\begin{document}

\section*{Questão2}
\begin{enumerate}[A)]
\item Para que possamos usar \textit{componentes} como instrumento de
  \textit{educacao}, eles devem ser correlacionados e
  \textit{componentes} não deve afetar o salário/hora

\item
  \adjustbox{valign=t}{\includegraphics[scale=0.3]{componentes}}

\end{enumerate}

\end{document}

output of code

  • Or \usepackage[export]{adjustbox} and then \includegraphics[...,valign=t]{..}. – Werner Jun 25 '15 at 2:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.