0

So I'm just trying to load an image into my document, and I know that the image has to be in the same path as my TeX file and it is, so I have no idea what's wrong with what I'm doing. I don't know if maybe it's my computer, my TeXstudio, or maybe some obvious error in my code, or something else. I'm aware that this question has been asked too many times, but no solution I found fixed my problem. This is the code that I have:

\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document} 
\begin{figure}
\centering
\includegraphics{figure3.png}
\caption*{Stopping voltage as a function of frequency}
\end{figure}
\end{document}

I'm new at LaTeX by the way, so I don't know if I included everything, but I think I covered everything.

I'm trying to load the figure3.png into the experiment4.tex file, and unless I'm losing it, they're in the same folder. Also, when I hover my cursor over the line

\includegraphics{figure3.png}

It shows the image that I want to put into the document, so I know that it knows that the image exists.

Another thing, I copied and pasted code that worked from another file("document") and used the other file "atom", but now that doesn't work anymore either, so something obviously changed.

Any help would be appreciated, I'm pretty desperate at this point.

Edit: Posting the whole log file

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7200 64-bit) (preloaded format=pdflatex 2019.9.17)  14 DEC 2019 01:52
entering extended mode
**./texstudio_tUGAhy.tex
(texstudio_tUGAhy.tex
LaTeX2e <2018-12-01>
("D:\Program Files\MiKTeX\tex/latex/base\article.cls"
Document Class: article 2019/08/27 v1.4j Standard LaTeX document class
("D:\Program Files\MiKTeX\tex/latex/base\size12.clo"
File: size12.clo 2019/08/27 v1.4j Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("D:\Program Files\MiKTeX\tex/latex/graphics\graphicx.sty"
Package: graphicx 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)

("D:\Program Files\MiKTeX\tex/latex/graphics\keyval.sty"
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
)
("D:\Program Files\MiKTeX\tex/latex/graphics\graphics.sty"
Package: graphics 2019/07/20 v1.3b Standard LaTeX Graphics (DPC,SPQR)

("D:\Program Files\MiKTeX\tex/latex/graphics\trig.sty"
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
("D:\Program Files\MiKTeX\tex/latex/graphics-cfg\graphics.cfg"
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: pdftex.def on input line 105.

("D:\Program Files\MiKTeX\tex/latex/graphics-def\pdftex.def"
File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
))
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
)
(texstudio_tUGAhy.aux)
\openout1 = `texstudio_tUGAhy.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.

("D:\Program Files\MiKTeX\tex/context/base/mkii\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count88
\scratchdimen=\dimen105
\scratchbox=\box27
\nofMPsegments=\count89
\nofMParguments=\count90
\everyMPshowfont=\toks15
\MPscratchCnt=\count91
\MPscratchDim=\dimen106
\MPnumerator=\count92
\makeMPintoPDFobject=\count93
\everyMPtoPDFconversion=\toks16
) ("D:\Program Files\MiKTeX\tex/latex/oberdiek\epstopdf-base.sty"
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf

("D:\Program Files\MiKTeX\tex/generic/oberdiek\infwarerr.sty"
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
)
("D:\Program Files\MiKTeX\tex/latex/oberdiek\grfext.sty"
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO)

("D:\Program Files\MiKTeX\tex/generic/oberdiek\kvdefinekeys.sty"
Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO)

("D:\Program Files\MiKTeX\tex/generic/oberdiek\ltxcmds.sty"
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
)))
("D:\Program Files\MiKTeX\tex/latex/oberdiek\kvoptions.sty"
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)

("D:\Program Files\MiKTeX\tex/generic/oberdiek\kvsetkeys.sty"
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)

("D:\Program Files\MiKTeX\tex/generic/oberdiek\etexcmds.sty"
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)

("D:\Program Files\MiKTeX\tex/generic/oberdiek\ifluatex.sty"
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
))))
("D:\Program Files\MiKTeX\tex/latex/pdftexcmds\pdftexcmds.sty"
Package: pdftexcmds 2019/11/24 v0.31 Utility functions of pdfTeX for LuaTeX (HO
)

("D:\Program Files\MiKTeX\tex/generic/iftex\iftex.sty"
Package: iftex 2019/11/07 v1.0c TeX engine tests
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
38.
Package grfext Info: Graphics extension search list:
(grfext)             [.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPE
G,.JBIG2,.JB2,.eps]
(grfext)             \AppendGraphicsExtensions on input line 456.
)
! Undefined control sequence.
\Ginclude@graphics ...\Ginput@path \set@curr@file 
                                                  {#1}\edef \uq@curr@file {\...
l.6         \includegraphics{figure3.png}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
\Ginclude@graphics ...e \expandafter {\@curr@file 
                                                  }}\expandafter \filename@p...
l.6         \includegraphics{figure3.png}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
<recently read> \unquote@name 

l.6         \includegraphics{figure3.png}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
<recently read> \quote@name 

l.6         \includegraphics{figure3.png}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
<recently read> \quote@name 

l.6         \includegraphics{figure3.png}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


! LaTeX Error: File `figure3.png' not found.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.6         \includegraphics{figure3.png}

I could not locate the file with any of these extensions:
.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2,.eps
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

[1{C:/Users/Amanda/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
(texstudio_tUGAhy.aux) ) 
Here is how much of TeX's memory you used:
 1478 strings out of 492895
 20716 string characters out of 3137684
 81633 words of memory out of 3000000
 5399 multiletter control sequences out of 15000+200000
 3938 words of font info for 15 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 41i,4n,25p,285b,155s stack positions out of 5000i,500n,10000p,200000b,50000s
<D:/Program Files/MiKTeX/fonts/type1/public/amsfonts/cm
/cmr12.pfb>
Output written on texstudio_tUGAhy.pdf (1 page, 13527 bytes).
PDF statistics:
 10 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)
Werner
  • 603,163
  • 3
    What you posted here is obviously not your document because it doesn't have \documentclass, etc. so there is no way that can work. You have to include the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See minimal working example (MWE). – Henri Menke Dec 14 '19 at 06:11
  • 1
    Thank you, I'll edit my post and put that in, like I said, I'm new, so I'll take any corrections :) – astrocat1701 Dec 14 '19 at 06:15
  • 1
    Welcome to TeX.SE... What command you execute to run the TeX file? If you are using PDF or JPG or PNG images, then you should run PDFLaTeX, or XELaTeX or LuaLaTeX, etc... – MadyYuvi Dec 14 '19 at 06:18
  • I think it's PDFLaTeX, but I'm not sure how to check – astrocat1701 Dec 14 '19 at 06:21
  • Do you have any invisible nonstandard characters in your document? You can check e.g. at https://pteo.paranoiaworks.mobi/diacriticsremover/. If this is not the case, could you perhaps show the log file? –  Dec 14 '19 at 06:28
  • I just checked, and it doesn't look like there any – astrocat1701 Dec 14 '19 at 06:33
  • 2
    Just wondering, why are the files you are working on under program files and not say your normal documents? Also please post the full log of wha you get when you compile this particular mwe (the contents of the generated log file not the "log" texstudio shows you) – daleif Dec 14 '19 at 06:37
  • I think I put them there because I assumed they had to be with the program in order to run, but I guess I can probably move them (if it won't mess anything up) and the errors that are produced are just this "line 6: Undefined control sequence. \includegraphics{figure3.png}" like 5 times and then "line 6: File `figure3.png' not found. \includegraphics{figure3.png}" – astrocat1701 Dec 14 '19 at 06:50
  • I'm not interested in the error lines, the whole log file, it may contain more relevant information about your issue, information that might have been filtered away by your editor, which is why I explicitly ask for the full file. You can open the log file in texstudio and then update your question with the contents of the log file (like you did with the mwe). Btw when you answer a specific person use @name, then they get notified about your answer – daleif Dec 14 '19 at 07:02
  • @daleif is the log file that really long output? – astrocat1701 Dec 14 '19 at 07:05
  • Under normal circumstances running latex on a file explicitly generates a separate log file. Interestingly I don't see one in your image. Also for that mwe it should not be more than perhaps 20 lines. For fun could you run pdflatex on that file using the dos prompt or what ever it is called these days just to see if that makes a difference, also copy the files away from program files, those folders may have special security settings in Windows (though yours are under the d drive so I'm not sure it applies. You could make a temp folder on c or d and put it there – daleif Dec 14 '19 at 07:10
  • @daleif I'm not familiar with using the dos prompt, how would I run that? – astrocat1701 Dec 14 '19 at 07:14
  • The log file is relevant. Please fully update you miktex in both miktex user mode and miktex admin mode. There are several things related to oberdiek that has changed and miktex is notoriously itchy about some of these changes especially if you do not update both miktex branches. Note that the real error is Undefined control sequence. \Ginclude@graphics ...e \expandafter {@curr@file }}\expandafter \filename@p... l.6 \includegraphics{figure3.png} (see why I wanted the real log not the fimtered which is wrong) – daleif Dec 14 '19 at 07:20
  • may the link https://tex.stackexchange.com/questions/511138/miktex-graphics-version-1-3b-bug-on-windows-10-setcurrfile-undefined helps you...but not sure... – MadyYuvi Dec 14 '19 at 07:23
  • @daleif so I just went in to update my miktex and that was the update that was there, and it fixed my issue, and the image is popping up in the document now, so thank you so so much for suggesting that – astrocat1701 Dec 14 '19 at 07:26
  • And you are one of many miktex users with a similar problem. With miktex always update in both modes. Personally I do not use miktex and thus does not get this issue. – daleif Dec 14 '19 at 07:28
  • @astrocat1701 From todays point of view, you did mostly everything correct. Congratulations. The only comment I have, that there is no need, to add the image file name extension. Writing \includegraphics{figure3} should be sufficient. As you can see in you logfile, LaTeX will automatically try .pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2,.eps. As long, as your file uses one of this extensions, you are fine. – Jan Dec 14 '19 at 08:03
  • And one other hint (not relevant to your example): when your image is not in the directory as your LaTeX file, you have to add a path, where to find it. On a Windows-System, this might be something like C:\Users\astrocat\images\figure4. Unfortunately, MS uses the same backslash, that TeX uses as introduction for a command. Hence you have to convert the backslashes into normal slashes: C:/\Users/astrocat/images/figure4! Be aware of spaces in the path- or filenames! LaTeX doesn't like them at all! – Jan Dec 14 '19 at 08:08

1 Answers1

1

Your miktex is not correctly updated.

Make sure to update your miktex in both miktex 6ser mode and in miktex admin mode (not related to Windows admin)

Several latex bundles are currently being reorganised and miktex often has issues with these reorganisations, so remember to always update miktex correctly.

daleif
  • 54,450