New MembersHi everybody

You would like to introduce yourself before starting to post? That's a nice idea and here is the forum for you...
Post Reply
Cipher
Posts: 2
Joined: Mon Jan 22, 2018 10:24 pm

Hi everybody

Post by Cipher »

I am a student and have a LaTex code problem. I always need text alongside images. Sometimes the text is on the left, other times it is on the right. Also ,I need to position where the \caption {figure} is located top, left, bottom, right. I can use the code below and get what I need by rearranging it. Unfortunately, it does not work. If you run it, you will see that the 'Figure Number' is not printed, only the word' figure'...most annoying.

If somebody can assist with a solution, by the lecturer (and myself) will be very happy...thank you, everybody.

Code: Select all

\begin{minipage}{0.4\textwidth}
Shows the progression of an industrial emerging technology. This process can be a few months to decades, depending upon the level of technology.
\end{minipage}
%
\begin{minipage}{0.7\textwidth}
\begin{center}
    \captionof{figure}{Industrial emergence phase}  
    \includegraphics[width=0.6\textwidth]{foo.png}
    \label{img:g}
\end{center}
\end{minipage}
Last edited by Stefan Kottwitz on Mon Jan 22, 2018 10:59 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Hi everybody

Post by Stefan Kottwitz »

Hi Cipher,

welcome to the forum!

If I run it, that problem does not happen. Perhaps it is a setting that you did not post here yet. Please try to post small compilable examples of issues, so it's easy to verify and to fix. Background link: Infominimal working example

Here is what I get when I make your code snippet compilable:

Code: Select all

\documentclass[12pt]{article}
\usepackage{caption}
\usepackage[demo]{graphicx}
\begin{document}
\begin{minipage}{0.4\textwidth}
Shows the progression of an industrial emerging technology. This process can be a few months to decades, depending upon the level of technology.
\end{minipage}
%
\begin{minipage}{0.7\textwidth}
\begin{center}
    \captionof{figure}{Industrial emergence phase}  
    \includegraphics[width=0.6\textwidth]{foo.png}
    \label{img:g}
\end{center}
\end{minipage}
\end{document}
Click on "Open in Overleaf" to see that it's without a problem.

It would be good to post a code sample based on the original code (using the same preamble and settings, unnecessary lines removed).

Stefan
LaTeX.org admin
Cipher
Posts: 2
Joined: Mon Jan 22, 2018 10:24 pm

Hi everybody

Post by Cipher »

Thank you Stephan, it works great. I was missing the \usepackage{caption}
\usepackage[demo]{graphicx} packages. This is a very well organized site, well done.
Post Reply