1

I am new to latex, and I have some problems when I try to run a latex code in TexStudio.
I wrote the following latex program in TexStudio:

\documentclass{article}
\begin{document}
    Hello world
\end{document}

and when I try to run it, TexStudio shows me the following error:

Could not start Build & View:PdfLatex:
pdflatex.exe -synctex=1 -interaction=nonstopmode
"<FileName>".tex

I am using TexLive in Windows.
I already added C:\texlive\2020\bin\win32 to the PATH,
and in TexStudio -> Options - > Configure TexStudio -> Commands -> PdfLatex, I wrote:

pdflatex.exe -synctex=1 -interaction=nonstopmode %.tex

When I run pdflatex test in the cmd I get:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.

kpathsea: Running mktexfmt pdflatex.fmt

The command name is C:\texlive\2020\bin\win32\mktexfmt Running the command C:\texlive\2020\bin\win32\fmtutil-user.exe C:\texlive\2020\bin\win32\runscript.tlu:935: C:\texlive\2020\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil I can't find the format file `pdflatex.fmt'!

Can someone please help me ?

Freud
  • 11
  • After document class add '\usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[italian]{babel}' see if it works. Anyway if you didn't do it I suggest you to read one of the many guides available online, because the time you spend on it is worth it and saves you a lot of other time that you would miss trying to solve the basic problems that everyone encounters in the start – Rob Tan Sep 29 '20 at 18:00
  • I think that what is in the code is irrelevant because when I write "pdflatex test" in the cmd it gives me errors. I don't need any guides on latex right now because I can't even run it on my computer. @Rob – Freud Sep 29 '20 at 18:11
  • Hi..Welcome to TeX. In TeXStudio, could you check the LaTeX installation. Go to Help -> Check LaTeX installation. – Tanvir Sep 29 '20 at 18:47
  • I checked the LaTex installation in TexStudio and it gave me a "System Report.txt" file which has a bunch of information that I don't understand. What should I be looking for exactly in this text file? @Tanvir – Freud Sep 29 '20 at 18:55
  • Did the entire process exited normally? If not, then probably TeXStudio is unable to locate the TeXLive installation. – Tanvir Sep 29 '20 at 19:01
  • It did exit normally. @Tanvir – Freud Sep 29 '20 at 19:36
  • Look at the answer to a similar question. Run the TexLive Manager and rebuild the formats. – Tanvir Sep 29 '20 at 19:38
  • I don't know what the TexLive Manager is. Is it an app I need to install or is it already been installed with TexLive ? @Tanvir – Freud Sep 29 '20 at 19:45
  • TexLive Manager (tlmgr) come installed with TeXLive. If you do not find such a file, then download update-tlmgr-latest.exe from here. – Tanvir Sep 29 '20 at 20:02
  • In the answer he doesn't show how to rebuild all formats in the console version. when I try to use the gui (with tlshell) I get an error "problem with installation: cannot determine release!" @Tanvir – Freud Sep 29 '20 at 20:14
  • It seems there is something wrong with TexLive installation. Better would be to reinstall the TexLive. – Tanvir Sep 29 '20 at 20:17
  • I rather find a solution that doesn't envolve reinstalling TexLive becaues the installation took me a few days. – Freud Sep 29 '20 at 20:19
  • silly question: Did you save the tex file under any name? Did you save before you tried running pdflatex? – Elad Den Sep 30 '20 at 07:14
  • Yes I did @EladDen – Freud Sep 30 '20 at 12:10
  • Normally it should not be necessary to manually add TL20 to the Windows PATH. Was the editor by any change running while TeXLive was being installed? – daleif Sep 30 '20 at 12:21
  • The editor was not running while TexLive was being installed. I didn't have to add TexLive to the PATH , I could have just put the full path of TexLive in TexStudio->Options->Configure TexStudio->Commands. @daleif – Freud Sep 30 '20 at 13:49
  • That should not be necessary either. Are you 100% sure that the TL installation went well? Did you get the end message about "Welcome to TeXLive". – daleif Sep 30 '20 at 13:51
  • I don't remember if I got the message "Welcome to TexLive".Anyway I am not using TexLive anymore, I switched to MikTex and now LaTex works fine. – Freud Sep 30 '20 at 13:54

1 Answers1

0

I tried using MikTex instead of TexLive and it works now.

Freud
  • 11