LaTeX forum ⇒ 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...
Cipher
Posts: 2
Joined: Mon Jan 22, 2018 10:24 pm

Hi everybody

Postby Cipher » Mon Jan 22, 2018 10:34 pm

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.

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

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8733
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Jan 22, 2018 11:05 pm

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:

  1. \documentclass[12pt]{article}
  2. \usepackage{caption}
  3. \usepackage[demo]{graphicx}
  4. \begin{document}
  5. \begin{minipage}{0.4\textwidth}
  6. Shows the progression of an industrial emerging technology. This process can be a few months to decades, depending upon the level of technology.
  7. \end{minipage}
  8. %
  9. \begin{minipage}{0.7\textwidth}
  10. \begin{center}
  11. \captionof{figure}{Industrial emergence phase}
  12. \includegraphics[width=0.6\textwidth]{foo.png}
  13. \label{img:g}
  14. \end{center}
  15. \end{minipage}
  16. \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
Site admin

Cipher
Posts: 2
Joined: Mon Jan 22, 2018 10:24 pm

Postby Cipher » Tue Jan 23, 2018 10:49 am

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.


Return to “New Members”

Who is online

Users browsing this forum: No registered users and 1 guest