why is latex making my caption bold? - latex

I don't know why latex is making my captions bold.
\section*{附录}
\begin{figure}[htbp]
\centering
{
\label{fig:ILOVEYOU}
\includegraphics[scale=2.7]{ILOVEYOU.jpg}
}
\caption{ILOVEYOU蠕虫邮件}
\end{figure}
I added a figure with a caption earlier and it wasn't bolded.
Thank you!

I've found a way to get around it. All I did was add some text after the section and before the first figure. If there isn't text, everything is bold. I realized this later when I noticed that not only the caption was bold but so was the footer.
I don't know why it's like this or how to fix it, but adding a few explanatory sentences before my figures works for me.

Related

How to align text in restructured text so that will be aligned in latexpdf?

I've tried to write own rst-classes and apply it to H1, H2 (headers like ====== or ~~~~~~~) and it works good when I make html. But in PDF it looks like headers, it is unexpected.
Please help me to solve this problem. I need to provide my report with good title page for my university but I don't know how to do it in ReST.
P.s. Sorry for my english, I'm russian =)
In the PDF here https://docdro.id/NRaWdDf each part is on its own page, like this
and the Contents.rst is at https://github.com/greenstm137/RWOfStudents/blob/4c8153969ed4d7e8de937d0ae33ccbaa7af03cdd/source/contents.rst
You might want to add raw latex code to center it. Try this:
|lstartcenter| My Text is Centered! Cool! |lendcenter|
.. |lstartcenter| raw:: latex
\begin{center}
.. |lendcenter| raw:: latex
\end{center}
This code sets a start and an end tag with "raw:: latex" which inserts raw latex code if you compile it to latex.
"|lstartcenter|" starts making it centered, while "|lendcenter|" ends centering it.

How to align a picture correctly in Overleaf

I want to insert an image on my text but the image always aligns on top of the text and not below as I wanted to. Does anyone know how to accomplish this?
This is the image I want to display on the bottom
\subsection{Distribución Normal}
all that text in spanish
\begin{figure}
\centering
\centerline{\includegraphics[width=8cm,height=8cm]{fdd.eps}}
\end{figure}
If you want to specify where the figure has to be, you have to use some options of the figure environment: for example
all that text in spanish
\begin{figure}[h]
\centering
\includegraphics[width=8cm,height=8cm]{fdd.eps}
\end{figure}
means that LaTeX will try to put the figure where you inserted the figure environment ([h]ere). Other options include
t: top
b: bottom
p: on a special page only for floating environments
You can use several options, for example
all that text in spanish
\begin{figure}[htb]
\centering
\includegraphics[width=8cm,height=8cm]{fdd.eps}
\end{figure}
LaTeX will try to put the figure following the order of the options provided: first it will try to put it [h]ere, then on the [t]op and finally, if the other two possibilities are not available, it will put the figure on the [b]ottom of the page. This strategy lets LaTeX decide the best position for the figure.
For references, see this Overleaf document.

How to add caption and fix the position of table in latex?

I'm tying to read a cvx file and make table in latex.
I'm using \csvautotabular{Figures/Mytable.csv}
$. What is missing is that:
I don't know how to fix the position of the table in may chapter. Second, how to add caption for it.
Can someone help me with this?
Putting the \csvautotabular in a table environment and adding a \caption should work.
Similar to what is done in this stackexchange answer.
Like char's answer, you can do:
\begin{table}[]
\centering
\csvautotabular{tables/my-table.csv}
\caption{Caption}
\label{tab:my_label}
\end{table}

How to make a hyperlink navigate to the top of the figure in LaTeX when using hyperref?

I have a LaTeX document with a figure and references to it:
\begin{figure}
...
\caption{...}
\label{fig:1}
\end{figure}
\ref{fig:1}
I use the hyperref package to get hyperlinks in the resulting PDF.
However the link to the figure navigates to the caption leaving the figure itself out of the view. How can I make it navigate to the start of the figure instead without moving the caption to the top?
Add this in your preamble
\usepackage{hyperref}
\usepackage[all]{hypcap} %for going to the top of an image when a figure reference is clicked
Make sure that the \usepackage[all]{hypcap} is written after the hyperref package is imported.
To previous comment:
\usepackage{hyperref}
\usepackage{caption}
is slightly better than \usepackage[all]{hypcap} because when you use e.g. figure without captions there won't be a compilation problem. The caption package by default sets option
hypcap=true
anchoring hyperlinks to the beginning of an environment.
\usepackage{hyperref}
\usepackage{caption}
Using this is a better idea than \usepackage[all]{hypcap}.

Adding caption in LaTex without floats (tables)?

I have a few tables which are not long enough to warrant the use of \longtable, but they always start on the next page which breaks the whole flow and trying to force it with a [!h] in the table did not help. So I stopped using \tables and just have \tabular tag now which seems to have fixed the layout as there are no floats.
But the problem now is I can't get automatic captions for the Tables - any ideas how I can do this and also get auto numbering so when I use \addcontentsline it can show up in the TOC?
To use a caption outside a float environment, one needs to use \captionof which is part of package caption.
Example
\documentclass{article}
\usepackage{caption}
\begin{document}
\begin{center}
\begin{tabular}{rl}
right & left \\
right & left \\
\end{tabular}
\captionof{table}{Your caption here}
\end{center}
\end{document}
There is also a capt-of package if you are just interested in using the command \captionof.
Short answer; you need a \table for the caption. Only using \tabular + captioning is not gonna work.
bit longer
There may be a nasty work-around as people tend to create work-arounds for everything, but my base rule for most of those work-arounds is: "if latex does not provide it by itself, do not try to do it". Most of time those "fixes" will give even more text-flow problems anyway.
Now if you really want it right below the text just do a \clearpage before the table and place the table. Than the rest of the text. This will probably solve it, although it will give an empty space on the rest of your 'previous' page of course.

Resources