\documentclass{article}  \usepackage{amsmath, amssymb} \usepackage{graphicx}   Inside \begin{document} I have:  \begin{figure}     \centering     \includegraphics{supremum} \end{figure}   supremum.gif is a gif file inside the same file as this .tex file. I have looked into other solutions but none have worked for me so far.
24505
Related:          I have an image file -- a gif file, which is the graph of a function. How do I add it to a LaTeX file? Will it come out OK in the subsequent pdf file?
116657
I have a fairly large document, that I have picked apart into different sections etc, each in their own file. To include graphics that are not in one central directory I use \graphicspath which works quite nicely. Is there a similar command I could use to include tex files from multiple directories without me explicitly naming them?  The idea would be the following:  \graphicspath{{./Some/Directory/For/Figures1/},{./Some/Directory/For/Figures2/}} \texpath{{./Some/Directory/For/Tex/Files1/},{./Some/Directory/For/Tex/Files2/}}   The I would like to call within the document:  \includegraphics{fig_from_Figures1}% this works \includegraphics{fig_from_Figures2}  \input{doc_from_Files1}% this would be awesome \input{doc_from_Files2}
39827
In this example,  \documentclass{article} \usepackage{graphicx} \usepackage{subcaption} \begin{document} \begin{figure}   \centering   \begin{subfigure}[t]{0.33\textwidth}     \centering     \includegraphics[width=\textwidth]{example-image-a}     \caption{a}   \end{subfigure}   \begin{subfigure}[t]{0.33\textwidth}     \centering     \includegraphics[width=\textwidth]{example-image-b}     \caption{b}   \end{subfigure}   \begin{subfigure}[t]{0.33\textwidth}     \centering     \includegraphics[width=\textwidth]{example-image-c}     \caption{c}   \end{subfigure} \end{figure} \end{document}   I chose the subfigure width equally 1/3 with the rationale that the figure span \textwidth exactly. From the result,    one can deduce that there is some overhead.  How do I optimally chose subfigure width so that the figure span textwidth exactly for N = 2, 3, 4, ... subfigures?
2517
I'm trying to include graphics in my Latex-file, which I compiled with latex+dvipdf on OS X. Latex however returns this error: "Cannot determine size of graphic"  My graphic is exported from PowerPoint, so I have tried both .pdf and .png. I get the same errors for both.  Sample code that doesn't work:  \begin{figure}[htb] \begin{center} \leavevmode \includegraphics[width=0.8\textwidth]{graph.png} \end{center} \end{figure}   If I have to manually set some measurements of the image, please tell me how I can find out those measurements. I need the image to take up about 80% of text width and be centered. Thanks.
91546
Given the MWE below from  (compiled version on the link) :   \documentclass{article} \usepackage{float} \usepackage{tikz} \usetikzlibrary{positioning, fit, calc, shapes, arrows} \usepackage[underline=false]{pgf-umlsd} \begin{document}  \begin{figure}[H]     \centering     \begin{sequencediagram}         \newinst{c}{Client}         \newinst[6]{s}{Server}          \mess[1]{c}{Longer label}{s}         \mess[1]{s}{label}{c}         \mess[1]{c}{label}{s}         \mess[1]{s}{Longer label}{c}     \end{sequencediagram}     \caption{Client-Server messaging} \end{figure} \end{document}   I would like to add some "processing contents" on the left of the left dotted vertical bar and on the right of the right dotted  vertical bar. (If possible to add some \newline inside of these "processing contents" also)    Text example "linearised"* :           Client          Server       c^2 | ---------------&gt;| init           |                 | f=f(c^2)    g=g(f) | &lt;---------------| f         g | ---------------&gt;| check if h=g           | &lt;---------------| OK     *What I mean is that I still want to use the above tex form, which has a nice rendering.  The only thing I would like to add are information on both sides at every start and end of an arrow. I am looking for a simple solution if it is possible.  Thank you in advance for any help you may provide.
130
Why does the use of \begingroup, \endgroup negate the effect of centering in the MWE? The MWE below yields a left aligned figure (not desired), with subsequent text on the left (desired):  But if I remove the \begingroup, \endgroup, then things work as desired as far as the \centering goes, but then the subsequent text is also centered?  Question:  I thought the entire purpose of grouping was to localize the effect. So, what is the subtlety of grouping that results in this behavior? How do I keep the grouping, yet also have the centering?  I would like to ensure that any settings that are changed via the inserted figure are kept local to that figure.  Code: \documentclass{article} \usepackage{showframe} \usepackage{pgfplots}  %\usepackage{filecontents}% Commented to prevent overwriting myFig.tex \begin{filecontents*}{myFig.tex}     \def\YLabel{$f(x) = x^2 - x +4$}     \begin{tikzpicture}     \begin{axis}[ xlabel=$x$, ylabel=\YLabel]         \addplot {x^2 - x +4};      \end{axis}     \end{tikzpicture} \end{filecontents*}  \newcommand*{\InsertFigure}[1]{%     \IfFileExists{#1}{%         \begingroup%             \centering%             \input{#1}%         \endgroup%     }{}% }%  \begin{document}     \InsertFigure{myFig.tex}  \textbf{Text on left.} \end{document}
114516
This question led to a new package:      How can I display the full path of the tex file that I compile? It is a simple file, no include or input present.  Edit: I use MiKTeX 2.9 on a Windows 7 64-bit.  Less demanding: If not possible, then I will be satisfied with a partial path (at least one or two folders up + the filename).
43206
Firstly and fore-mostly I am a complete new comer to the world of LaTeX and so please do bear with me. I will try to be as accurate as I can but if you need any more info please let me know.  All I want is to figure out how to import a graphic into LaTeX (MacTeX).  I am using the following in my code:  \documentclass[10pt,a4paper,draft]{report} \usepackage{graphicx}   Then in my document section I'm using   \begin{figure} \includegraphics[width = 50mm]{Name.jpg} \caption{Label} \end{figure}   Once I compile the document, the area for the picture has been allocated but there is no image, I have tried .png and .pdf files also.  I know that this is a very simple question and I hope there is a simple solution but I cannot find anything on the net about this (which may mean I'm being dim).  Also I'm using Latexian but I have tried 4 different editors and it doesn't work in any.
102720
For the graphicx package, we can use \graphicspath{...} so that we can directly use filenames in the argument of \includegraphics{...}. Can a similar thing be done for directly using filenames in \input{...}. I know of the method mentioned  but if this was the way to do it, then why does \graphicspath{...} exist?
115596
This code:  \documentclass[11pt,openright]{book} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \usepackage[british]{babel}  \usepackage{tikz} \usetikzlibrary{external} \tikzexternalize[prefix={"C:/Users/MyName MySurname/Documents/LaTeX/Figures/"}]  %\tikzexternalize[prefix={Figures/}]   \begin{document} \begin{tikzpicture}     \draw (0,0) circle (1cm); \end{tikzpicture} \end{document}   gives me the error:     ! I can't write on file `"C:/Users/MyName   MySurname/Documents/LaTeX/Figures/MyMWE-figure0.md5"'.   I'm working with Windows 10, MiKTeX 2.9 distibution.  Following the advice Tarass gave me on a comment of this question:  and as indicated here:  I've registered a user-managed TEXMF directory but I still get the same error.  With \tikzexternalize[prefix={Figures/}] all works perfectly but, since I'm using LyX, the files are stored in a LyX temp dir, hence I loose them when I close the program (making externalization useless), so I need to use an absolute path.
36649
I'm trying to plot an image file in a pdfplots axis. This is a minimal example (the files fig2a.eps and fig2a.png both contain the image that should be plotted):   \documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot graphics[xmin=-0.15, xmax=0.15, ymin=0.0, ymax=0.2] {fig2a}; \end{axis} \end{tikzpicture} \end{document}   When compiling with pdflatex, I get exactly what I want. With latex (producing a dvi file), the tick labels are all on top of each other inside the image, so something goes wrong with the positioning.  I suppose version information is useful in this case -- from the output to the screen I have this when running both latex and pdflatex:  This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)   What am I doing wrong?
116699
Please consider the following MWE  \documentclass{article}  \usepackage[demo]{graphicx}  \begin{document}    \begin{figure}     \centering     \begin{minipage}[c]{0.45\textwidth}       \centering      \includegraphics[width=3cm,height=4cm]{mypicture.png}      \caption{Caption 1}     \end{minipage}     \begin{minipage}[c]{0.45\textwidth}       \centering      \includegraphics[width=3cm,height=2cm]{mypicture.png}      \caption{Caption 2}     \end{minipage} \end{figure}  \end{document}   which produces     How could I, without moving downward figure 2, align the two captions to obtain
103741
I have inserted an image in my LaTeX document and the image always displays with the file path of the image directly above it.  How can I prevent this file path from displaying?  I am inserting the image like this:  \begin{figure} \centering     \includegraphics{C:/Users/Name/Pictures/image1.png} \caption{a caption} \label{fig:reference} \end{figure}   Here is a working example of document that produces this behaviour:  \documentclass{article}  \usepackage{graphicx} \begin{document} \begin{figure} \includegraphics{C:/Users/Name/Pictures/image 1.png}  \end{figure}  \end{document}   The image was inserted using the TeXnicCenter Insert>Picture function.  When I generate the pdf document, directly above any image (I have inserted multiple images using this technique) the file path displays above the image, in the case above it would show: "file\path\of\image", how can I prevent this from displaying?
106439
The reference to my sub caption doesn't work  \documentclass{article}  \usepackage{mwe} \usepackage{subcaption} \usepackage{cleveref}  \begin{document}  \section{Section} \begin{center} \captionsetup{type=figure} \begin{subfigure}{0.4\textwidth} \includegraphics[width=\textwidth]{example-image-a.pdf} \caption*{Text 0} \end{subfigure} \begin{subfigure}{0.4\textwidth} \includegraphics[width=\textwidth]{example-image-b.pdf} \caption*{Text 1\label{here}} \end{subfigure} \captionof{figure}{Description} \end{center}  Look at \Cref{here}. \end{document}   Output:   Maybe also see     UPDATE:  It should produce Look at Text 1  Actually it's always the same text, so I would really like a solution where my counter is 0,1, ... at the and of the caption. Or (maybe to use with \caption{\empty} where my counter is Text 0, Text 1, ...
117414
I am facing a weird problem. I am trying to include an eps file into my thesis. The code I am using is as follows:    \documentclass[11pt,twoside]{ce}  \usepackage{graphicx}  \usepackage{wrapfig}  \usepackage{color}  \usepackage{caption}  \usepackage{amsmath}  \usepackage{amssymb}  \usepackage{float}  \usepackage{url}  \begin{document}   \newpage   \begin{figure}[H]      \includegraphics[angle=45,width=0.75\textwidth]{images/final.eps}       \caption{Final image}       \label{fig:final}   \end{figure} %working code, page does not rotate. just image rotates.    \end{document}   This code works. But when I rotate the image with 90 deg., the image rotates but the page also rotates. If I rotate it by an angle less than or equal to 45, then the page does not rotate and only the image rotates. When the rotation is greater than 45, the page and image both rotate.    \begin{figure}[H]      \includegraphics[angle=46,width=0.75\textwidth]{images/final.eps}       \caption{Final image}       \label{fig:final}   \end{figure} % non-working code, image as well as page rotates.   \begin{figure}[H]      \includegraphics[angle=90,width=0.75\textwidth]{images/final.eps}       \caption{Final image}       \label{fig:final}   \end{figure} % non-working code, image as well as page rotates.   I want to rotate the image by 90 deg but not the page. Since each page has a header, page rotation is annoying me. Due to rotation of the page, the header comes to the right side, instead of being on the top. Can somebody help?
41478
For example, when I use the command (in Overleaf/ShareLaTex):  \begin{figure}[H]     \centering     \includegraphics{some_graphic}     \caption{some_caption}     \label{fig:some_label} \end{figure}   the \includegraphics{} comes without the [] parameter to change the size of the image, and \begin{figure} without the [H] option by default.   Is it possible to renew the command to make it default? By that I mean that when I type the \begin{figure} command it adds the [H] and [h] as well as [width=\textwidth] in the \includegraphics command, rather than making a global change in the preamble e.g.
94562
\documentclass{beamer}  \usepackage{subfig}  \begin{document}  test  \end{document}   returns undefined control sequence \@@magyar@captionfix  (It was not so in January; I am on fully updated pretest)