#1225 closed defect (fixed)
Environment \end tag causes problems
Reported by: | Juergen Spitzmueller | Owned by: | dekel |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | latex export | Version: | 1.3.4 |
Severity: | normal | Keywords: | |
Cc: | munzirtaha@… |
Description
the \end{environment} tag should be placed on a new line. As it is now, it leads to LaTeX
errors in some cases, e.g. arabtex:
Munzir Taha Obeid wrote:
The problem:
I open lyx and wrote some Arabic. View -> PDF (pdflatex) gives this error
LaTeX Error: \begin{arabtext} on input line 12 ended by \end{document}.
\end{document}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
[...]
Better Workaround:
Open the latex file in an editor and add a space before any closing LaTeX
code within the \begin{arabtext} and the \end{arabtext}. I mean a space
should be entered before \end{arabtext} and if you have any formatting say
you centered some text you should go to the latex file and add a space
before the \end{center} or you get errors like this:
! LaTeX Error: \begin{center} on input line 11 ended by \end{document}.
Attachments (4)
Change History (19)
by , 21 years ago
comment:1 by , 21 years ago
Cc: | added |
---|
comment:2 by , 21 years ago
attachments.isobsolete: | 0 → 1 |
---|
(From update of attachment 429)
wrong fix (see comment)
comment:3 by , 21 years ago
Correction: the \end tag is only misplaced (i.e. not in a new line) if the environment is at the
very end of the document, i.e. the end tag is the last thing before \end{document}. A blank line
is then placed *after" the \end tag istead.
Regarding the arabtex issue: Munzir Taha confirmed that adding a space solves the LaTeX
error. We should figure out why LyX does not add a linebreak at this position.
comment:4 by , 21 years ago
I want to emphasize it again. Bear with me, please.
There are two errors here:
Error #1: An error when we want to view a document that contains Arabic text through
view -> PDF.
LaTeX Error: \begin{arabtext} on input line 16 ended by \end{document}.
\end{document}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
The above error will occur only and only if the paragraph direction that contains Arabic is
right to left, and this happen when the first letter in the paragraph is Arabic. The
workaround is just to insert a space or any whitespace after the last Arabic letter.
Error #2: If we want to generate the PDF file through File -> Export -> LaTeX, then use
texi2pdf. In this case I get these errors:
LaTeX Warning: Unused global option(s):
[arabic,english].
(./basmala.aux) (/usr/share/texmf/tex/latex/arabtex/uxnsh.fd) . / . / ##
! LaTeX Error: \begin{arabtext} on input line 14 ended by \end{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.17 \end{document}
?
--
A space at the end of the file won't solve the problem if it contains some formatting. For
example if the tex file looks like this
\begin{document}
\begin{arabtext}
\begin{center}ÈÓå Çääç\end{center}
ÈÓå Çääç\end{arabtext}
\end{document}
I need to add a space before \end{center} AND \end{document}. In short a space before
any LaTeX code that follows an Arabic text. You can also see here the the line added
after \end{arabtext} which should be before it as Juergen Spitzmueller noticed already.
Note: to edit the LaTeX file I have to use katoob or vim since the other editors I am aware
of (like kwrite, kedit, ...) will corrupt any Arabic text encoded in iso 8859-6.
comment:5 by , 20 years ago
dependson: | → 1404 |
---|---|
Status: | new → assigned |
Version: | 1.3.2 → 1.3.4 |
The patch for 1404 should fix this one too
comment:6 by , 20 years ago
Subject: lyx-devel /: Tag: BRANCH_1_3_X status.13x src/: ...
CVSROOT: /usr/local/lyx/cvsroot
Module name: lyx-devel
Repository: lyx-devel/src/
Changes by: lasgouttes@… 04/04/22 15:58:28
Modified files:
lyx-devel/: Tag: BRANCH_1_3_X status.13x
lyx-devel/src/: Tag: BRANCH_1_3_X ChangeLog paragraph.C
Log message:
Patches:
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/status.13x?r1=1.1.2.178&r2=1.1.2.179
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/ChangeLog?r1=1.1021.2.33&r2=1.1021.2.34
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/paragraph.C?r1=1.235.2.1&r2=1.235.2.2
Complete Diff:
/usr/bin/cvs -f diff -kk -u -r 1.1.2.178 -r 1.1.2.179 /status.13x
/usr/bin/cvs -f diff -kk -u -r 1.1021.2.33 -r 1.1021.2.34 src/ChangeLog
/usr/bin/cvs -f diff -kk -u -r 1.235.2.1 -r 1.235.2.2 src/paragraph.C
comment:7 by , 20 years ago
Subject: lyx-devel src/: ChangeLog output_latex.C
CVSROOT: /usr/local/lyx/cvsroot
Module name: lyx-devel
Repository: lyx-devel/src/
Changes by: lasgouttes@… 04/04/22 15:59:39
Modified files:
lyx-devel/src/: ChangeLog output_latex.C
Log message:
Patches:
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/ChangeLog?r1=1.1902&r2=1.1903
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/output_latex.C?r1=1.11&r2=1.12
Complete Diff:
/usr/bin/cvs -f diff -kk -u -r 1.1902 -r 1.1903 src/ChangeLog
/usr/bin/cvs -f diff -kk -u -r 1.11 -r 1.12 src/output_latex.C
by , 20 years ago
Attachment: | BugTest.tex added |
---|
The exported TeX file from the sample test BugTest.lyx file
comment:9 by , 20 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I downloaded the patch and applied it to LyX 1.3.4. I have found that although
it fixed the problem of OneParagraph, it caused another problem in case of
more than one paragraph. The Attach LyX file used to work without the patch. I
also attached the exported .tex file. I hope you can figure out what's wrong
easily so we finish this long awaiting issue. Thanks a lot for your care.
comment:10 by , 20 years ago
You can see how the order is again messed in the attached TeX file
\begin{arabtex}
1
\begin{doublespace}
2
\end{arabtex}\end{doublespace}
comment:11 by , 20 years ago
Status: | reopened → assigned |
---|
Munzir,
Did you test the patch from #1404?
To test the patch that was actually applied (which should be the same),
you can use the last link of comment 6.
comment:12 by , 20 years ago
Oops! It turns out that I tested on a build that was not up to date.
So Munzir, ignore my last comments. I can indeed confirm that it is worse than
it used to be in this case...
comment:13 by , 20 years ago
attachments.isobsolete: | 0 → 1 |
---|
(From update of attachment 555)
[update: this is meaningless. I goofed.]
comment:14 by , 20 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This particular bug is fixed, as far as I am concerned. Let's continue
the discussion in #1404
comment:15 by , 20 years ago
no problem. When can we expect a fix to this (#1404) 1-year old bug? ;)
I am eager to remove it from my wiki.arabeyes.org/OpenBugs page
possible fix