LyXLyx-1.6 — 'LaTeX Error: Missing \begin{document}'

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
neGODnick
Posts: 35
Joined: Mon Jun 16, 2008 9:31 pm

Lyx-1.6 — 'LaTeX Error: Missing \begin{document}'

Post by neGODnick »

I have long preambula. All works fine. Just I add some command & get an error. For
example:
It was:

Code: Select all

\renewcommand{\figureautorefname}%ссылка на рисунок только цифра (можно рис.)
\renewcommand{\sectionautorefname}%
I add '\renewcommand{\subsectionautorefname}', it become:

Code: Select all

renewcommand{\figureautorefname}%ссылка на рисунок только цифра (можно рис.)
\renewcommand{\sectionautorefname}%
\renewcommand{\subsectionautorefname}
Now I get:

Code: Select all

LaTeX Error: Missing \begin{document}.
______________________________________
\renewcommand{\subsectionautorefname
                                       }
You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.
Ok, I delete '\renewcommand{\subsectionautorefname}' but now I get:

Code: Select all

LaTeX Error: Missing \begin{document}.
______________________________________
\renewcommand{\sectionautorefname
                                       }%
You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.
I 'do undo', but get the same kind error reports. Why?
Why, if I really reverse changes to condition that works fine before?
Do not move your cursor near double underlined links — they are POPUP-ADs!!!
Избегайте попадания курсора на «ссылки» с двойным подчёркиванием — это ВСПЛЫВАЮЩАЯ РЕКЛАМА!!!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Lyx-1.6 — 'LaTeX Error: Missing \begin{document}'

Post by Stefan Kottwitz »

Hi,

the definitions of the commands are missing, the syntax is like:

Code: Select all

\renewcommand{\sectionautorefname}{name}
Stefan
LaTeX.org admin
neGODnick
Posts: 35
Joined: Mon Jun 16, 2008 9:31 pm

Lyx-1.6 — 'LaTeX Error: Missing \begin{document}'

Post by neGODnick »

Stefan_K wrote:the definitions of the commands are missing, the syntax is like:
Yes, I do know, but it works fine before my changes.
Besides this, with true code I get the error message too:
Image

I can show more code if you need. May be it is buf of Lyx-1.6?
Do not move your cursor near double underlined links — they are POPUP-ADs!!!
Избегайте попадания курсора на «ссылки» с двойным подчёркиванием — это ВСПЛЫВАЮЩАЯ РЕКЛАМА!!!
neGODnick
Posts: 35
Joined: Mon Jun 16, 2008 9:31 pm

Lyx-1.6 — 'LaTeX Error: Missing \begin{document}'

Post by neGODnick »

This was double post, sorry — how to delete it?
Do not move your cursor near double underlined links — they are POPUP-ADs!!!
Избегайте попадания курсора на «ссылки» с двойным подчёркиванием — это ВСПЛЫВАЮЩАЯ РЕКЛАМА!!!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Lyx-1.6 — 'LaTeX Error: Missing \begin{document}'

Post by Stefan Kottwitz »

The screenshot shows a difference, there you have {}:

Code: Select all

\renewcommand{\sectionautorefname}{}
But the screenshot still shows the \figureautorefname definition is missing, there's not even {} like in the two lines below.

Stefan
LaTeX.org admin
neGODnick
Posts: 35
Joined: Mon Jun 16, 2008 9:31 pm

Lyx-1.6 — 'LaTeX Error: Missing \begin{document}'

Post by neGODnick »

Stefan_K wrote:The screenshot shows a difference, there you have {}:

Code: Select all

\renewcommand{\sectionautorefname}{}
What is the difference do you mean? Now it shows {} additionally to previous message?
Stefan_K wrote:the screenshot still shows the \figureautorefname definition is missing, there's not even {} like in the two lines below.
Rrrrrrrr!!!!! It works fine just today at morning, and 100 times earlier!

Ok, I write true code everywhere and now it works. Thank you very much!
But I still have this question: Why it was 100% working earlier with wrong code?
Do not move your cursor near double underlined links — they are POPUP-ADs!!!
Избегайте попадания курсора на «ссылки» с двойным подчёркиванием — это ВСПЛЫВАЮЩАЯ РЕКЛАМА!!!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Re: Lyx-1.6 — 'LaTeX Error: Missing \begin{document}'

Post by Stefan Kottwitz »

Perhaps it was just a coincidence that it could be compiled with wrong code. The syntax might still have been compilable. Maybe I could explain if I could see a complete example of the wrong but compilable code. Without compilable example code it's just guessing. But good to hear that it's working now.

Stefan
LaTeX.org admin
neGODnick
Posts: 35
Joined: Mon Jun 16, 2008 9:31 pm

Lyx-1.6 — 'LaTeX Error: Missing \begin{document}'

Post by neGODnick »

Just now I erase {} from '\renewcommand{\subsectionautorefname}{}' — it's compilable again!

Here's complete example of the wrong but compilable code (see attach).

Oh, I don't know, will it be compilable without it's image files...
Attachments
wrong_code_working.rar
(150.03 KiB) Downloaded 393 times
Do not move your cursor near double underlined links — they are POPUP-ADs!!!
Избегайте попадания курсора на «ссылки» с двойным подчёркиванием — это ВСПЛЫВАЮЩАЯ РЕКЛАМА!!!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Lyx-1.6 — 'LaTeX Error: Missing \begin{document}'

Post by Stefan Kottwitz »

Hi,

yes, that can be compilable. There's some tolerance regarding the braces. The effect is, that \subsectionautorefname is defined as \par because \par is following, caused by the empty line.
If you remove that empty line you will notice that the compiler will generate the same error message Missing \begin{document}.

Stefan
LaTeX.org admin
neGODnick
Posts: 35
Joined: Mon Jun 16, 2008 9:31 pm

Lyx-1.6 — 'LaTeX Error: Missing \begin{document}'

Post by neGODnick »

I understand. Well, never use dubious code hacks!

Thank you very much, Stefan!

P.S. I am beginner at TeX/LaTeX and this is my very first document. I tried to use these commands removing {} to resolve some aspects, but without thorough knowledges. It was my fatal flaw. But LyX assists me to make this mistake, deceives me that I may do it further too, by compiling my wrong code for a long time. Additionally, I was disorientated getting error messages from the same code which was working just now. In my opinion, a programm must not permit user to make mistakes (especially as serious as mine) and, especially, mislead user. If you have relations to LyX developers, resolve this please.
Do not move your cursor near double underlined links — they are POPUP-ADs!!!
Избегайте попадания курсора на «ссылки» с двойным подчёркиванием — это ВСПЛЫВАЮЩАЯ РЕКЛАМА!!!
Post Reply