Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
dvd1975
Posts: 4 Joined: Tue Oct 21, 2014 6:39 pm
Post
by dvd1975 » Tue Oct 21, 2014 6:42 pm
I want an image and down i want a sentence.
I write this
Code: Select all
\documentclass[a4paper,12pt]{article}
\usepackage[activeacute,spanish]{babel}
\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{wrapfig}
\begin{document}
\begin{figure}
\centering
\includegraphics{image.jpg}
\end{figure}
\begin{flushleft}
\rmfamily \tiny hello hello
\end{flushleft}
\end{document}
But this doesnt work, when I built and see the output, there are two pages, one with the text, and another one with the image.
What's the mistake?
Thank you for your help.
NEW: TikZ book now 40% off at Amazon.com for a short time.
Johannes_B
Site Moderator
Posts: 4182 Joined: Thu Nov 01, 2012 4:08 pm
Post
by Johannes_B » Tue Oct 21, 2014 6:52 pm
Do you want to give a caption to the figure like »Figure 1: Hello World«?
You can control the output of captions using a package with the same name: caption
Code: Select all
\documentclass[a4paper,12pt]{article}
\usepackage[activeacute,spanish]{babel}
\usepackage[latin1]{inputenc}
\usepackage[demo]{graphicx}
\usepackage{caption}
\captionsetup{font=scriptsize}
%\usepackage{wrapfig}%JB Please don't use this
\begin{document}
\begin{figure}
\centering
\includegraphics{image.jpg}
\caption{Hello World}
\end{figure}
\begin{flushleft}
\rmfamily \tiny hello hello
\end{flushleft}
\end{document}
Hint, if you markup code using [code] LaTeX code[/code] you can click above the code-block on »Open in Writelatex«.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
dvd1975
Posts: 4 Joined: Tue Oct 21, 2014 6:39 pm
Post
by dvd1975 » Tue Oct 21, 2014 7:04 pm
Thank you for your answer.
But it doesnt work.
When i built and see the outpout there's a black image(not my image) in the center of page. And the image is very big.
Johannes_B
Site Moderator
Posts: 4182 Joined: Thu Nov 01, 2012 4:08 pm
Post
by Johannes_B » Tue Oct 21, 2014 7:13 pm
I don't have your image, so i used package option demo. Some black rectangle is used as a replacement.
Delete it and you should be fine.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
dvd1975
Posts: 4 Joined: Tue Oct 21, 2014 6:39 pm
Post
by dvd1975 » Tue Oct 21, 2014 7:31 pm
Sorry it doesnt work.
I wrote your code.
And the program TexnicCenter created two pages, one with the text and another one with the image.
I want only a page, with the image first, and below the text
Like this
0000
0000
0000
Text
Thank you for your help
Johannes_B
Site Moderator
Posts: 4182 Joined: Thu Nov 01, 2012 4:08 pm
Post
by Johannes_B » Tue Oct 21, 2014 7:40 pm
The simplest things are sometimes not as obvious as they should be.
Code: Select all
\documentclass[a4paper,12pt]{article}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}
\centering
\includegraphics{image.jpg}
\begin{flushleft}
\rmfamily \tiny hello hello
\end{flushleft}
\end{figure}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
dvd1975
Posts: 4 Joined: Tue Oct 21, 2014 6:39 pm
Post
by dvd1975 » Tue Oct 21, 2014 8:04 pm
Sorry i wrote before i posted in the forum your last code but it doesnt work too.
The text is written at the end of the document, not below the image.
it appears
0000
0000
0000
text
thank you for your help
Stefan Kottwitz
Site Admin
Posts: 10347 Joined: Mon Mar 10, 2008 9:44 pm
Post
by Stefan Kottwitz » Tue Oct 21, 2014 11:39 pm
Possibly there's a problem with your image. Such as too much whitespace around it. You could post it here, as attachment.
Stefan
LaTeX.org admin
Johannes_B
Site Moderator
Posts: 4182 Joined: Thu Nov 01, 2012 4:08 pm
Post
by Johannes_B » Wed Oct 22, 2014 9:00 am
Another quick way to test for any white space is to place an
fbox
around the image.
Code: Select all
\documentclass[a4paper,12pt]{article}
\usepackage[activeacute,spanish]{babel}
\usepackage{mwe}
%\usepackage{wrapfig}%JB Please don't use this
\begin{document}
\begin{figure}
\centering
\fbox{%Adding a frame around the picture
\includegraphics{example-image}
}
\begin{flushleft}
\rmfamily \tiny hello hello
\end{flushleft}
\end{figure}
\end{document}
If the cause should be another one, please try to build a
minimal working example so we can reproduce your document.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.