I created in Xfig a .fig file and now I have to add it to my Latex document. Can someone help me with this problem because I'm new in Latex and tried this code bellow but it doesen't work. I searched for various solutions but still I become this error.
\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[!htb]
\center{\includegraphics[width=2]{myfigure.fig}}
\end{figure}
\end{document}
I just want to center a figure on the page but the error is:
Cannot determine size of graphic in myfigure.fig (no Bounding Box).
The .fig file/format is not supported for inclusion into (La)TeX as an image. You need to export the image to a supported format via the File > Export dialog. Supported formats include Postscript, EPS as PDF stand-alone vector formats, combined files (vector + LaTeX for text) and many of the raster formats (like BMP, PNG and JPEG).
Also, use \centering to centre an image within the figure environment.
Related
Description of the problem
I have used PyPlot to save some plots. And, I'm trying to use them in LaTeX. But, then I get an error: ERROR: LaTeX Error: File path-to-file/file.bb' not found.`
In normal files, I don't have to specify their Bounding Boxes to them to work. But, if I do specify for this one, it will appear (although floating) in my resulting pdf.
I would like convert, either with ffmpeg, magick, etc. the file so I assure there is an bounding box "shipped" into the image.
Current state of affairs:
MWE:
\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[!htb]
\centering
\caption{\label{fig:burguer-square} Decay equation with different numerical methods}\\
\includegraphics[width=0.5\textwidth, bb=0 0 900 900]{Burguer900.png} # specify Bounding Box
\end{figure}
\end{document}
Here is the file: https://drive.google.com/file/d/1FMxVVxgcsrK_Edtoidh_MzPV7KQLchXg/view?usp=sharing
Result:
As you can see, the image is floating, furthermore, I have to specify where it is.
MWE2 (without bb and logfile)
As required by #samcarter_is_at_topanswers.xyz,
\documentclass[12pt]{article}
\usepackage{graphicx}
\graphicspath{{Resources/Img}{Resources/img}{../../Resources/img}{../../Resources/Img}{~/PP/wlq/Resources/img}{~/PP/wlq/Resources/Img}
{../../Resources/img/General}
{../../Resources/img/General2}}
\begin{document}
\begin{figure}[!htb]
\centering
\caption{\label{fig:burguer-square} Decay equation with different numerical methods} \includegraphics[width=0.5\textwidth]{Burguer900.png}
\end{figure}
\end{document}
RESULT:
error log:
https://pastebin.com/TsN0nkRy
I am using Inkscape to convert images to Latex, so the text scales nicely. Using SaveAs pdf, with generate Latex ticked.
This creates a .pdf_tex file that contains something like this:
\begingroup%
\begin{picture}(1,1.18884212)%
\put(0,0){\includegraphics[width=\unitlength,page=1]{Scapula.pdf}}%
\put(0.6981335,0.82053681){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{Infraspinous fossa}}}%
\end{picture}%
\endgroup%
I would like to change the font size and possible also the font, so the text in all images is different from the body text. I think this is possible by e.g. redefining \smash within "picture", but I don't know how. Is this the correct approach? If so, any tips on how to do it?
With the etoolbox you could add the fontsize change to the picture environment:
\documentclass{article}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{etoolbox}
\AtBeginEnvironment{picture}{\huge}
\begin{document}
\begingroup%
\begin{picture}(1,1.18884212)%
\put(0,0){\includegraphics[width=\unitlength,page=1]{example-image.pdf}}%
\put(0.6981335,0.82053681){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{Infraspinous fossa}}}%
\end{picture}%
\endgroup%
\end{document}
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.
I want the captions of my figures and table to have the same size as \footnotesize. Is there something to put in the preambule of my document to do this?
Use the caption package to set the font key-value to footnotesize:
\documentclass{article}
\usepackage{caption}
\captionsetup{font=footnotesize}
\begin{document}
Some regular text set in \verb|\normalsize|.
\begin{table}[t]
\caption{A table using \texttt{\string\footnotesize}.}
\end{table}
\begin{figure}[t]
\caption{A figure using \texttt{\string\footnotesize}.}
\end{figure}
\end{document}
It is also possible to adjust the label and text formats individually for figures and tables separately. However, consistency is a better option here.
I want to generate a PDF from sphinx that is only black and white. The standard sphinx.sty uses \RequirePackage{color} and \RequirePackage{fancyvrb}.
If I just remove color, I get a whole list of errors. I could not find any reference in fancyvrb's documentation.
How can I achieve that (without rewriting the whole sphinx.sty)?
You can edit the conf.py and add addtions to the preamble before the build with custom LaTeX, so that sphinx will render colors as black. For example.
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
'preamble': r'''
\usepackage{titlesec}
\titleformat{\section}
{\color{black}\normalfont\Large\bfseries}
{\color{black}\thesection}{1em}{}
\titleformat{\subsection}
{\color{black}\normalfont\Large\bfseries}
{\color{black}\thesubsection}{1em}{}
\usepackage{hyperref}
\hypersetup{colorlinks=true,
linkcolor=black,
citecolor=black,
filecolor=black,
menucolor=black,
urlcolor=black,
bookmarksnumbered=true
}
'''
# Latex figure (float) alignment
#'figure_align': 'htbp',
}
This will change all sections and subsections to black and change all your hyperlinks to black as well.