TransWikia.com

A question about itemize and figures

TeX - LaTeX Asked by Athanasios Margaris on August 20, 2020

When i use a figure alone (and nothing more) in an itemize environment as in the sample code

item[11.7]

begin{center}
includegraphics [width=9cm]{code-page629.eps}
end{center}

the numbering (11.7 in this case) is printed in the bottom left corner. Is it possible to print the numbering in the top left corner? (see the attached figure). I do not provide a MWE since there is no need to run something, it is actually a "theoretical" question .. thanks a lot !enter image description here

3 Answers

A quick fix that simply corrects this is to place an invisible character strut after the item:

screenshot

documentclass[12pt,a4paper]{article}
usepackage{graphicx}

begin{document}
   begin{enumerate}
   item Premier
   item Second
   item[11.7]strut
      begin{center}
      includegraphics [width=9cm]{example-image}
      end{center}
   end{enumerate}
end{document}

Correct answer by AndréC on August 20, 2020

I have no idea, why you would want to do this and there are definitely better ways to do this, but what you need to know is that the referencepoint of an image in Tex is always the lower left corner. So what you need to do is wrap your picture in a box to get the reference into the upper left corner.

usepackage{adjustbox} should be the way to go. look up the vertical alignment.

here ist an example, which also centers it:

documentclass{article}
usepackage{adjustbox}
begin{document}

begin{itemize}
item[11.7] adjustbox{width=9cm,center,valign=t}{includegraphics{code-page629.eps}}
end{itemize}

end{document}

Answered by Cube on August 20, 2020

Without adjustbox:

documentclass[a5paper,twocolumn]{article}
usepackage{graphicx}
defitemimg#1#2{item[#1]leavevmodevskip-baselineskipincludegraphics[width=linewidth]{#2}}
begin{document}
begin{itemize}
itemimg{11.7}{example-image-a}
itemimg{11.8}{example-image-b}
end{itemize}
end{document}

BTW, If all the images are like simple tables, consider type the tables directly, that is:

begin{tabular}{lllll}
    11.7 & YY & EQU & ... & ...  
         & SAVEX & EQU & ... & ...   
end{tabular}

Answered by Fran on August 20, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP