Bug 108450 - Display of incorrect LaTeX formulas is broken in KopeTeX
Summary: Display of incorrect LaTeX formulas is broken in KopeTeX
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Unclassified
Component: Latex Plugin (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-02 18:51 UTC by Dominic Battre
Modified: 2013-01-18 20:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Renders LaTeX formulas as verbatim text if they contain errors (1.62 KB, patch)
2005-07-02 18:52 UTC, Dominic Battre
Details
Renders LaTeX formulas as verbatim text if they contain errors (1.40 KB, patch)
2005-07-02 19:01 UTC, Dominic Battre
Details
Renders LaTeX formulas as verbatim text if they contain errors with quotation marks (1.40 KB, patch)
2005-07-02 20:19 UTC, Dominic Battre
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dominic Battre 2005-07-02 18:51:17 UTC
Version:            (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages

If you send incorrect formulas with Kopete while KopeTeX is activated, these formulas are not displayed.  Instead a huge white space is shown.

Example: Try sending $$\fra 1 2$$ (instead of \fract).

Proposed behavior: If the formula has an error, just show the formula as text.

I see two ways to fix that.

1) in kopete_latexconvert.sh add after the line

latex -interaction=batchmode out.tex > /dev/null

something along the lines of

returncode = $?
if [ $returncode -ne 0 ]; then
    cd -
    rm -rf $tmpdir
    exit $returncode
fi

and check this in kopete.  If kopete_latexconvert.sh exits with 0 display the formula, otherwise the text.


2) this is easier for me, because I do not have to modify the C++ sources:

add a switch to kopete_latexconvert.sh which renders the text as verbatim text (as opposed to a LaTeX formula).  If the latex call from above fails, kopete_latexconvert.sh calls itself recursively, this time rendering the formula as verbatim text.


I will attach a patch for fix 2).
Comment 1 Dominic Battre 2005-07-02 18:52:36 UTC
Created attachment 11657 [details]
Renders LaTeX formulas as verbatim text if they contain errors
Comment 2 Dominic Battre 2005-07-02 19:01:40 UTC
Created attachment 11658 [details]
Renders LaTeX formulas as verbatim text if they contain errors

This patch is a little bit more elegant than the previous
Comment 3 Richard Smith 2005-07-02 19:09:26 UTC
Comment on the patch: best put $tmpdir/out.tex, $homedir, $tmpdir and $0 in 
double quotes, lest they contain spaces or other nasties.

I think either solution is OK.
Comment 4 Dominic Battre 2005-07-02 20:19:41 UTC
Created attachment 11660 [details]
Renders LaTeX formulas as verbatim text if they contain errors with quotation marks

Thanks Richard.

The attached patch adds quotation marks to my code.  I have not touched the old
code.  I suppose that it needs quite a lot of quotation marks as well, but my
attempts to fix it, broke the script, so I let this to the experts.
Comment 5 Olivier Goffart 2005-07-10 20:05:47 UTC
I think it is better to don't render nothing at all.  (and show the text as normal)
And i think this is already the case in SVN. (and maybe even backported, i don't remember)
Comment 6 Olivier Goffart 2005-07-16 13:26:38 UTC
I have not commited your patch because the svn versions (trunk and 3.4 branch) doesn't display the picture when the picture is not generated (because wrong latex)

Thanks anyway.
Comment 7 Jekyll Wu 2013-01-18 20:30:00 UTC
Git commit 95a7be8b7cf37ddb462bb008ca415aa8091f87aa by Jekyll Wu.
Committed on 18/01/2013 at 21:11.
Pushed by jekyllwu into branch 'master'.

DrKonqi now makes use of the new "drkonqi" keyword on bugs.kde.org

That makes it easier to identify and search for reports created by
DrKonqi. That should be helpful for developers to collect statistics and
examples.

REVIEW: 280145

FIXED-IN: 4.11.0

M  +1    -0    drkonqi/bugzillalib.cpp
M  +7    -0    drkonqi/bugzillalib.h
M  +1    -0    drkonqi/reportinterface.cpp

http://commits.kde.org/kde-runtime/95a7be8b7cf37ddb462bb008ca415aa8091f87aa
Comment 8 Jekyll Wu 2013-01-18 20:33:15 UTC
(In reply to comment #7)
> Git commit 95a7be8b7cf37ddb462bb008ca415aa8091f87aa by Jekyll Wu.
> Committed on 18/01/2013 at 21:11.
> Pushed by jekyllwu into branch 'master'.

Sorry, wrong number used in the commit HOOK.  Please just ignore comment #7.