TransWikia.com

Align picture to text

TeX - LaTeX Asked on June 8, 2021

I need to put a university’s logo in a text and I’m not getting it aligned when I use the newtheorem command. I tried to use the hspace command but it is not working. For the text without Theorem, Propositions, … the figure is aligned.
My code:

documentclass[a4paper,12pt]{article}
usepackage[pctex32]{graphics}
usepackage{ amsmath,  amsfonts}
usepackage[brazil]{babel}
usepackage[utf8]{inputenc}
usepackage{amssymb, amsmath, amsthm}
usepackage{graphicx}
usepackage{float}
newtheorem{theorem}{Teorema}
begin{document}
 
begin{minipage}{0linewidth}
begin{figure}[H]
includegraphics[scale=0.25]{logoUTFPR}
end{figure}
end{minipage}
begin{minipage}{linewidth}
begin{center}
textbf{Roteiro de Atividades
        Professor Mateus Eduardo Salomão}
end{center}
end{minipage}
 
begin{theorem}[Teorema de]
Seja $f$
end{theorem}

end{document}

This code is generating the following:
enter image description here

I would like it to look like this:
enter image description here

One Answer

Edit: In the first try I misunderstood your problem. Now is corrected. All what you need is insert noindent before first minipage and useraggedright` for placement of figure inside it.

BTWE; you should never ever enclose floats figure (or table) inside minipage or similar box.

enter image description here

documentclass[a4paper,12pt]{article}
%usepackage[pctex32]{graphics}
%usepackage[utf8]{inputenc}
usepackage[brazil]{babel}
usepackage{amsmath, amssymb, amsthm}
usepackage{graphicx}
usepackage{float}
newtheorem{theorem}{Teorema}

begin{document}

noindentbegin{minipage}{0.3linewidth}
raggedright
includegraphics[width=0.8linewidth]{example-image-duck}%{logoUTFPR}
end{minipage}%
begin{minipage}{0.7linewidth}
centering
textbf{Roteiro de Atividades
        Professor Mateus Eduardo Salomão}
end{minipage}

begin{theorem}[Teorema de]
Seja $f$
end{theorem}

end{document}

Correct answer by Zarko on June 8, 2021

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