abenori / TeX2img

Converte TeX source to images.
Other
59 stars 5 forks source link

English language installation difficulties #10

Closed gapster closed 6 years ago

gapster commented 6 years ago

I'm installing TeX2img 2.10 on Windows 10 / TeX Live. I followed the instructions in this Stack Exchange answer (in the comments) but I get this error:

C:\Users\gpajer\AppData\Local\Temp>"C:\texlive\2017\bin\win32\pdflatex.exe" -interaction=nonstopmode upjia0e3.tex This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./upjia0e3.tex LaTeX2e <2017-04-15> Babel <3.18> and hyphenation patterns for 46 language(s) loaded.

[...]

(c:/texlive/2017/texmf-dist/tex/latex/graphics-def/pdftex.def)) No file upjia0e3.aux. (c:/texlive/2017/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] )

! LaTeX Error: Can be used only in preamble.

Here is my preamble:

%latex: pdflatex \documentclass[fleqn]{article} \usepackage{amsmath,amssymb} \usepackage{xcolor} \pagestyle{empty}

I hope that's enough information for you. If not, let me know. Gary

doraTeX commented 6 years ago

Your preamble and the running compiler are consistent and look appropriate. I suppose you are using in the document body some commands which are allowed only in preamble such as \usepackage. Please try replacing the document body with simpler contents such as $x$ in order to isolate the issue.

gapster commented 6 years ago

Thanks, but that's not it. Below are my document body, and below that the entire log.. It looks like a font issue perhaps? My Tex Live is not set up correctly? I'm upgrading TeXLive. Maybe that will fix any installation issues.

Where does the log file 2lan4rg2.log get written? I can't find it.

\begin{document} Hello, world. \end{document}

C:\Users\gpajer\AppData\Local\Temp>"C:\texlive\2017\bin\win32\pdflatex.exe" -interaction=nonstopmode 2lan4rg2.tex This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./2lan4rg2.tex LaTeX2e <2017-04-15> Babel <3.18> and hyphenation patterns for 46 language(s) loaded. (c:/texlive/2017/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (c:/texlive/2017/texmf-dist/tex/latex/base/fleqn.clo) (c:/texlive/2017/texmf-dist/tex/latex/base/size10.clo)) (c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (c:/texlive/2017/texmf-dist/tex/latex/amsmath/amstext.sty (c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsgen.sty)) (c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsbsy.sty) (c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsopn.sty)) (c:/texlive/2017/texmf-dist/tex/latex/amsfonts/amssymb.sty (c:/texlive/2017/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (c:/texlive/2017/texmf-dist/tex/latex/xcolor/xcolor.sty (c:/texlive/2017/texmf-dist/tex/latex/graphics-cfg/color.cfg) (c:/texlive/2017/texmf-dist/tex/latex/graphics-def/pdftex.def)) No file 2lan4rg2.aux. (c:/texlive/2017/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] )

! LaTeX Error: Can be used only in preamble.

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

l.8 \begin{document}

[1{c:/texlive/2017/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./2lan4rg2.aux) ) (\end occurred inside a group at level 1)

semi simple group (level 1) entered at line 8 (\begingroup)

bottom level

(see the transcript file for additional information)<c:/texlive/2017/texmf-dist /fonts/type1/public/amsfonts/cm/cmr10.pfb> Output written on 2lan4rg2.pdf (1 page, 11832 bytes). Transcript written on 2lan4rg2.log.

abenori commented 6 years ago

You must not write \begin{document} and \end{document} in the main body of input, so you should write only Hello World. TeX2img automatically inserts \begin{document} and \end{document}.

gapster commented 6 years ago

That does it. Thank you.