Opened 21 years ago

Closed 20 years ago

#1404 closed defect (fixed)

A misorder problem in the .tex output if an Arabic text is doublespaced

Reported by: munzirtaha@… Owned by: dekel
Priority: high Milestone:
Component: latex export Version: 1.3.4
Severity: normal Keywords:
Cc: lasgouttes@…, leeming@…

Description

If I type one paragraph in Arabic in LyX and then exported the to LaTeX the
file will look like this:


\begin{document}
\begin{doublespace}
\begin{arabtext}
????\end{doublespace}
\end{arabtext}

\end{document}


the above order of doublespace and arabtex should be the other way round. This
problem happens in case of one paragraph only. In case of more than one
paragraph, the exported .tex file will be OK. Can any one fix this small
annoying bug?

Attachments (3)

paragraph.diff (1.0 KB ) - added by leeming 20 years ago.
proposed fix for LyX 1.3.x
arabtex4.diff (3.2 KB ) - added by lasgouttes 20 years ago.
A better fix
bug1404.diff (5.1 KB ) - added by lasgouttes 20 years ago.
Another go at fixing it

Download all attachments as: .zip

Change History (30)

comment:1 by munzirtaha@…, 21 years ago

I hope some one will take care of this simple bug.

comment:2 by lasgouttes, 20 years ago

Go ahead (for 1.3.x too). I have had some correspondence with
Munzir on the subject but I have to admit that I have not been
very responsive recently (sorry!).

comment:3 by lasgouttes, 20 years ago

Also, Munzir, what issues remain wrt arabic once this patch
is applied?

comment:4 by munzirtaha@…, 20 years ago

Thanks for your care. These are the remaining issues which are really trivial
but make a relieve.

The Document Layout dialog should let me set the language and character
encoding for Arabic.

\screen_font_encoding iso10646-1
\language_package "\usepackage{arabtex,iso88596} \setcode{iso8859-6}"
\language_command_begin "\begin{arabtex}"
\language_command_end "\end{arabtex}"
These options should be done form the menus. Now, one need to enter them
manually in the preferences file.

Layout->Document->Language->Arabic
and
Edit->Preferences->Default Language->Arabic
should be usable, right?

comment:5 by munzirtaha@…, 20 years ago

Summary: doublespace is messed in a single Arabic paragraphdoublespace is messed in multiple Arabic paragraphs

comment:6 by munzirtaha@…, 20 years ago

It's ok now with one paragraph. For multiple paragraphs a patch was sumbitted
by JMarc, I think but not sure where has it gone!

The generated code for > 1 paragraph looks like this:

\begin{document}
\begin{doublespace}
\begin{arabtex}
1

\end{doublespace}
2\end{arabtex}

\end{document}

comment:7 by munzirtaha@…, 20 years ago

I am afraid sirs that what you are doing here is just dirty hacks where the
origin of the problem should be solved ;) (hehe, as if a programmer speaks)

For example if I choose the DocBook article (SGML) and just type an revision
history and an abstract, the exported docbook is:

<!DOCTYPE article PUBLIC "-OASISDTD DocBook V4.1EN">

<article lang="en">
<!-- DocBook file was created by LyX 1.3

See http://www.lyx.org/ for more information -->

<revhistory>


rev

<abstract>
<para>

abstract

</para>


</abstract>


</revhistory>





</article>

Should the revision history have the abstract inside or this is also an
ordering problem?

comment:8 by munzirtaha@…, 20 years ago

Summary: doublespace is messed in multiple Arabic paragraphsA misorder problem in the .tex output if an Arabic text is doublespaced

I think I have forgotten my own problem. You know when time passes, one
forgets his own name ;)

Now, I did a new resloution of the problem from the beginning and found that it's
not a problem in a doublespaced single paragraph but in a doublespaced first
paragraph.

If I have more than one para in Arabic with any para (except the first)
doublespaced, eveything is Ok and the exported .tex file looks like this:

\begin{document}
\begin{arabtex}
1

\begin{doublespace}
2\end{doublespace}
\end{arabtex}

\end{document}


But if I made the first para doublespace the .tex file will look like this:

\begin{document}
\begin{doublespace}
\begin{arabtex}
1

2\end{doublespace}
\end{arabtex}

\end{document}

Here.\begin{doublespace} should come after \begin{arabtex}

Now, what if I mix Arabic and English para's together?

  • If the first para is a doublespaced English para, I get:

\begin{document}
\begin{doublespace}
hi

\begin{arabtex}
1

2\end{doublespace}
\end{arabtex}

\end{document}

The English text in the above example should have its own tags of \begin and
\end and the Arabic text should also have its own tags, so we get good code,
right?

  • If the last para is also an English para:

\begin{document}
\begin{doublespace}
hi

\begin{arabtex}
1

2

\end{arabtex}
bye\end{doublespace}

\end{document}

  • If the last English para is the only doublespaced para, you also get a problem:

\begin{document}
\begin{arabtex}
1

2

\begin{doublespace}
\end{arabtex}
bye\end{doublespace}

\end{document}

-- I hope I have made things clearer now!

  • Note: all these examples before applying Mr. Angus patch. It's my fault not to

resolve the problem correctly from the first time. Sorry and looking forward for
your genuine solution soon...

--

/ / _/ _/ _/

_/ _\ _/ _\ _/

_/ \ / _\ unzir _/ aha PGP Key available
gpg --recv-keys --keyserver www.mandrakesecure.net F0671821

Telecommunications and Electronics Engineer
Linux Registered User #279362 at http://counter.li.org
Mandrake Club member
Maintainer of Mandrake Arabization Project Status (MAPS)
http://www.arabeyes.org/download/documents/distro/mdkarabicsupport.html
CIW Designer, ICDL, MOUS
New Horizons CLC
Riyadh, SA

comment:9 by leeming, 20 years ago

Cc: leeming@… added

comment:10 by leeming, 20 years ago

Munzir, did you ever try out my patch? Is the problem fixed?

comment:11 by munzirtaha@…, 20 years ago

Yes, I tried it. It doesn't fix the bug. My last comment though long says all about
it. Your patch make a fix in case of one paragraph only. Please, try to spare time
to read the last comment and notice I changed the subject of the bug a little.
Sorry, if I am not clear from the begining. Pleasssse, make another patch. You
can do it

comment:12 by lasgouttes, 20 years ago

blocked: 1225

by leeming, 20 years ago

Attachment: paragraph.diff added

proposed fix for LyX 1.3.x

comment:13 by lasgouttes, 20 years ago

attachments.isobsolete: 01

comment:14 by lasgouttes, 20 years ago

Component: BiDi Supportlatex export
op_sys: LinuxAll
Status: newassigned
Version: unspecified1.3.4

comment:15 by lasgouttes, 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:

fix arabtex-related problems (#1225 and #1404)

Bugs:
#1225
#1404

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:16 by lasgouttes, 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:

fix arabtex-related problems (#1225 and #1404)

Bugs:
#1225
#1404

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

comment:17 by lasgouttes, 20 years ago

Resolution: fixed
Status: assignedclosed

.

comment:18 by munzirtaha@…, 20 years ago

Resolution: fixed
Status: closedreopened

This bug is still valid even after the patch

comment:19 by lasgouttes, 20 years ago

Could you attach an example file? What did I miss?

comment:20 by munzirtaha@…, 20 years ago

JMarc,
Sorry, I have attached everything to
#1225
Please tell me if you need more info.

comment:21 by lasgouttes, 20 years ago

Status: reopenedassigned

OK, I was not in cc: of #1225. Sorry.

by lasgouttes, 20 years ago

Attachment: bug1404.diff added

Another go at fixing it

comment:22 by lasgouttes, 20 years ago

attachments.isobsolete: 01

comment:23 by lasgouttes, 20 years ago

Munzir, I'd appreciate if you could test this a little bit. If you prefer, I can
attach here a diff from 1.3.4.

This bug is IMO the only one that blocks the release of LyX 1.3.5.

comment:24 by munzirtaha@…, 20 years ago

Thanks a lot JMarc. It takes me near infinity to download from cvs because of
a very slow connection. Can you prepare/compress a 1.3.5cvs.tar.bz2 snapshot
for me (so I download it from work)? If not then attach a patch to 1.3.4
(already have the source) thought I prefer to test against the latest.

Really eager to test...

comment:25 by lasgouttes, 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/09/27 12:55:57

Modified files:

lyx-devel/: Tag: BRANCH_1_3_X status.13x
lyx-devel/src/: Tag: BRANCH_1_3_X ChangeLog paragraph.C

Log message:

fix #1404

Bugs:
#1404

Patches:
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/status.13x?r1=1.1.2.199&r2=1.1.2.200
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/ChangeLog?r1=1.1021.2.39&r2=1.1021.2.40
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/paragraph.C?r1=1.235.2.2&r2=1.235.2.3

Complete Diff:
/usr/bin/cvs -f diff -kk -u -r 1.1.2.199 -r 1.1.2.200 /status.13x
/usr/bin/cvs -f diff -kk -u -r 1.1021.2.39 -r 1.1021.2.40 src/ChangeLog
/usr/bin/cvs -f diff -kk -u -r 1.235.2.2 -r 1.235.2.3 src/paragraph.C

comment:26 by lasgouttes, 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/09/28 15:29:19

Modified files:

lyx-devel/src/: ChangeLog output_latex.C

Log message:

make sure language commands are the outermost ones when typesetting a paragraph (#1404)

Bugs:
#1404

Patches:
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/ChangeLog?r1=1.1983&r2=1.1984
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/output_latex.C?r1=1.13&r2=1.14

Complete Diff:
/usr/bin/cvs -f diff -kk -u -r 1.1983 -r 1.1984 src/ChangeLog
/usr/bin/cvs -f diff -kk -u -r 1.13 -r 1.14 src/output_latex.C

comment:27 by munzirtaha@…, 20 years ago

Now I managed to build and test. Congratulations! It works! I could not
mangaged to break it! Thanks!

comment:28 by lasgouttes, 20 years ago

Resolution: fixed
Status: assignedclosed

Thanks. Closing the bug, then.

Note: See TracTickets for help on using tickets.