I 'm new to LaTeX and still learning. So I have this issue with jpg images. The code is:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\includegraphics[width=\linewidth]{images.jpg}
\caption{A boat.}
\label{fig:boat1}
\end{figure}
Figure \ref{fig:boat1} shows a boat.
\end{document}
The result is a pdf file with the caption and the reference, but without the picture. Any solutions? Thanks.
You need to compile your document with pdflatex. The regular tex compiler doesn;t work with .jpg images.
Related
I'm trying to include a PDF in a document using \includepdf. The problem is that Latex is putting all sites of the pdf on one page of the document (over each other). I'm a bit lost on that one and didn't found any solutions.
\begin{figure}[H]
\includepdf[landscape,pages={1-6}]{Zeichnungen/Motor}
\label{Motor}
\end{figure}
If you want to use \includepdf, don't put it in a figure environment.
If you do want to use the figure environment, use the good old \inlcudegraphics
\documentclass{article}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{pgffor}
\begin{document}
with pdfpages:
\includepdf[pages={1-6}]{example-image-duck}
\clearpage
with good old graphicx
\foreach \x in {1,...,6}{
\begin{figure}[htbp]
\includegraphics[page=\x]{example-image-duck}
\label{Motor-\x}
\end{figure}
}
\end{document}
I'm a beginner to latex, I was writing an article. At the end when adding references. I did:
\begin{thebibliography}{100}
Some bibitems here
\end{thebibliography}
After compiling, the word "Reference" appears in pdf, and it is too big in size. I want its font size to be 12pt. How can I do that?
Using the titlesec package, you can temporarily change the size of section headings:
\documentclass[12pt]{article}
\usepackage{titlesec}
\begin{document}
test
\begingroup
\titleformat*{\section}{\fontsize{12pt}{14pt}\bfseries\selectfont}
\begin{thebibliography}{100}
Some bibitems here
\end{thebibliography}
\endgroup
\end{document}
I like to make a question on the hyperref package of Latex. I write reports with the company's logo and I would like to add an implicit link to the official company's website, so as that if someone click on this logo can open the official web page. The problem is that this generates a bad pale blue box that is particularly ugly, therefore I would like to remove it.
I was able to remove all the box on the external link by changing the color on the specification (and setting white, perhaps there is also a way to remove) but I am trying to change only on this specific link and not all the others present other parts of the document.
Below the portion of latex code:
\documentclass[11pt]{article}
\usepackage[italian]{babel}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{figure}[h!]
\vspace{-1 cm}
\flushleft\hspace{-1.5 cm}
\href{https://www.link.com/}{\includegraphics[height=1.5cm, keepaspectratio]{LOGO1.jpg}}
%\caption{Caption}\label{fig:logo}
\end{figure}
\end{document}
Do somebody knows a special tricks for doing this? Thank you in advance for any help.
You can change the hyperref setup locally:
\documentclass[11pt]{article}
\usepackage[italian]{babel}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\begin{document}
\begin{figure}[h!]
\vspace{-1 cm}
\flushleft\hspace{-1.5 cm}
{\hypersetup{hidelinks}\href{https://www.link.com/}{\includegraphics[height=1.5cm, keepaspectratio]{example-image-duck}}}
%\caption{Caption}\label{fig:logo}
\end{figure}
\end{document}
I have the problem that LaTeX doesn't show the List of figures and List of Listings. I don't know where the problem is.
I'm working with TeXstudio and the code was defined as follows:
\begin{document}
\begin{lstlisting}[caption={Testcode is here}\label{lst:Testcode is here},frame=single]
//here is the code
\end{lstlisting}
\begin{figure}[H]
\centering
\includegraphics[width=0.5\textwidth]{pic1.jpg}
\caption{That is a pic}
\label{fig: That is a pic}
\end{figure}
\listoffigures
\lstlistoflistings
\end{document}
Both lists remain empty. Can anyone tell me what the problem is??
I am able to generate the list of figures by doing these modifications on your file;
Adding these two lines to the very beginning of the file:
\documentclass{article}
\usepackage{listings}
and then, changing [H] into [h] (lower case).
#Winsoft There is nothing wrong with using [H] you just need to add the float-package (see https://tex.stackexchange.com/questions/132106/difference-between-h-and-h-in-float-position).
Adding the minimal set of needed packages compiled to the desired result. Please note that the list of figures and list of listings won't show up before compiling the document twice.
\documentclass{article}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{float}
\begin{document}
\begin{lstlisting}[caption={Testcode is here}\label{lst:Testcode is here},frame=single]
//here is the code
\end{lstlisting}
\begin{figure}[H]
\centering
\includegraphics[width=0.5\textwidth]{pic1.jpg}
\caption{That is a pic}
\label{fig: That is a pic}
\end{figure}
\listoffigures
\lstlistoflistings
\end{document}
So i'm trying to hide the label in my cover image.
>\begin{figure}
>\center
>\includegraphics[scale=0.5]{universidade}
>\caption* {Mycaption}
>\end {figure}
This way it's not labeling the figure but its not showing on the list of figures
Help please ;D
You can give the caption package the option labelformat=empty to suppress the Figure 1 etc. labelling:
\usepackage[labelformat=empty]{caption}
You can use square brackets to specify the description for the figure list, and curly brackets for the actual figure caption. So I think you should be able to do the following to supress the caption but still have an entry in the figure list:
\begin{figure}
\center
\includegraphics[scale=0.5]{universidade}
\caption[Mycaption]{}
\end {figure}
There are a couple of options, depending on what yo're after exactly:
\documentclass{article}
\usepackage{graphicx}
\setcounter{topnumber}{3}% Just for this example
\begin{document}
\listoffigures
\begin{figure}
\addcontentsline{lof}{figure}{Example image A}%
\centering
\includegraphics[height=4\baselineskip]{example-image-a}
Example image A
\end{figure}
\begin{figure}
\addcontentsline{lof}{figure}{\protect\numberline{}Example image B}%
\centering
\includegraphics[height=4\baselineskip]{example-image-b}
Example image B
\end{figure}
\begin{figure}
\centering
\includegraphics[height=4\baselineskip]{example-image-c}
\caption{Example image C}
\end{figure}
\end{document}
The figure caption is added using \addcontentsline{lof}{figure}{<caption>}, where <caption> can either contain a blank \numberline{}, or just the regular caption. The above example shows the usage of either.
It would also be possible to have no label shows in the image, but have a numbered entry in the LoF using caption. But it would seem strange to have a numbered entry in the LoF and an unnumbered figure.