This module converts (La)TeX code to MathML code using the LaTeXML web service.
It is very simple in its initial version. The code from the example filter module has been used as template.
All information are available at
http://drupal.org/sandbox/physikerwelt/1912980
It's designed for Drupal 7 only.

CommentFileSizeAuthor
#6 tex.gif2.14 KBthelee

Comments

klausi’s picture

Status: Needs review » Needs work

Welcome,

please get a review bonus first. Then try to fix issues raised by automated review tools: http://ventral.org/pareview/httpgitdrupalorgsandboxphysikerwelt1912980git

physikerwelt’s picture

Status: Needs work » Needs review

hi, thanks for your comments.
Is a review bonus required. Some extensions in this review list do really advanced things.
Are the coding conventions required or recommended.
e.g. I used

      'preload=[dvipsnames]xcolor&'.
      'preload=url&'.
      'preload=hyperref&'.
      'preload=mws&'.
      'preload=ids&'.
      'preload=texvc'

instead of writing everything in a single line to make easier to read.

PawelR’s picture

Hi,

I think you should consider using hook_help instead hook_menu to display this information.

physikerwelt’s picture

I'm not exactly sure what you mean. This extension is somehow a minimal modification to the example filter prototype code. So I think this extension can be reviewed in 10 minutes.

PawelR’s picture

I meant that you should consider using hook_help for displaying this help sentence.
I think that filter example module demonstrates by the way how hook_menu works.
Probably it's not good idea to repeat everything what you can find there.

Please look at this project to see real life example:
http://drupal.org/project/markdown

thelee’s picture

Status: Needs work » Needs review
StatusFileSize
new2.14 KB

Manual review

So, I really like the idea of this module, BUT there are some important issues to work out.

  1. See PawelR's comment. You are using hook_menu when it really should be hook_help. Just go see the documentation for hook_help, it's a simple change, but it's an important one.
  2. Reiterating this: http://ventral.org/pareview/httpgitdrupalorgsandboxphysikerwelt1912980git. Obviously the string concat code issues should be ignored, but there are a lot of other code style issues which are seemingly minor but help make it easier for drupal developers to quickly parse through other people's code when there's consistency.
  3. Better documentation. I only know how to set this up because I looked through the code. The lay drupal user is not going to do that. Even a simple note to edit "text formats" and enable the "math filter" should be good enough.
  4. Better UX (this may also be related to better documentation). Because a bunch of XML is being injected AND a custom "math" tag is needed, ordering the math filter in certain contexts (like when using the Filtered HTML default text format) becomes very important. Adding a default weight or more informative help or filter label would go a long way for helping the lay drupal user being able to just plug-and-play this module.
  5. Lastly, I'm having some pretty bad encoding-related issues.

    This is the body of my node: <math>Final = \text{max}\Bigg(1, Adjusted\times\frac{100-\text{min}(DR,\ 90)}{100}\Bigg)</math>

    This is the xml I'm getting back (notice all the broken characters between each letter):

    <math xmlns="http://www.w3.org/1998/Math/MathML" id="p1.1.m1" class="ltx_Math" alttext="Final=\text{max}\Bigg(1,Adjusted\times\frac{100-\text{min}(DR,\ 90)}{100}\Bigg)" xml:id="p1.1.m1.1" display="inline" xref="p1.1.m1.1.cmml">
      <semantics xml:id="p1.1.m1.1a" xref="p1.1.m1.1.cmml">
        <mrow xml:id="p1.1.m1.1.22" xref="p1.1.m1.1.22.cmml">
          <mrow xml:id="p1.1.m1.1.22.1" xref="p1.1.m1.1.22.1.cmml">
            <mi xml:id="p1.1.m1.1.1" xref="p1.1.m1.1.1.cmml">F</mi>
            <mo xml:id="p1.1.m1.1.22.1.1" xref="p1.1.m1.1.22.1.1.cmml">⁢</mo>
            <mi xml:id="p1.1.m1.1.2" xref="p1.1.m1.1.2.cmml">i</mi>
            <mo xml:id="p1.1.m1.1.22.1.1a" xref="p1.1.m1.1.22.1.1.cmml">⁢</mo>
            <mi xml:id="p1.1.m1.1.3" xref="p1.1.m1.1.3.cmml">n</mi>
            <mo xml:id="p1.1.m1.1.22.1.1b" xref="p1.1.m1.1.22.1.1.cmml">⁢</mo>
            <mi xml:id="p1.1.m1.1.4" xref="p1.1.m1.1.4.cmml">a</mi>
            <mo xml:id="p1.1.m1.1.22.1.1c" xref="p1.1.m1.1.22.1.1.cmml">⁢</mo>
            <mi xml:id="p1.1.m1.1.5" xref="p1.1.m1.1.5.cmml">l</mi>
          </mrow>
     [snipping for brevity; needless to say every letter is followed by some weird character. Notably, the part of the XML that falls under the "annotation" node _doesn't_ have this weird character issue, only the stuff falling under the "semantic" node]
    

    I've also attached a screenshot to show what it looks like.

I'm really looking forward to seeing this cleaned up, I could really use this module!

thelee’s picture

Status: Needs review » Needs work
PA robot’s picture

Status: Needs review » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

I'm a robot and this is an automated message from Project Applications Scraper.

physikerwelt’s picture

Status: Closed (won't fix) » Active
physikerwelt’s picture

Figureing out the differences to drutex....

klausi’s picture

Status: Active » Needs review

You need to set the status to "needs review" if you want to get a review, see https://drupal.org/node/532400

kscheirer’s picture

Title: TeX » [D7] TeX
Priority: Minor » Normal
Status: Needs review » Reviewed & tested by the community

You don't need tex_menu() and _tex_information(), replace those with hook_help() to provide that information.

Did you mean to have 2 esses in _tex_settingss() ?

You should take care of the whitespace errors reported at ventral.org though: http://ventral.org/pareview/httpgitdrupalorgsandboxphysikerwelt1912980git.
In tex_filter_info() it seems like you're building a very large querystring - instead consider creating an array and then using http_build_query() to create the final string for you.

Use single quotes wherever possible in _tex_information().

We generally don't define anonymous functions in Drupal like you have in _tex2mml_process(), but I don't think we have a rule against it either. Ventral is reporting a few formatting errors in that function though. You might also want to log errors with watchdog() when something doesn't go right.

Thanks for including a test! You have an extra // at the top of tex.test.

Those all seem like minor issues though. The module looks fine and doesn't seem to have any security issues. I'm setting to RTBC but would really like to see the hook_help() and formatting issues resolved.

----
Top Shelf Modules - Enterprise modules from the community for the community.

kscheirer’s picture

Status: Reviewed & tested by the community » Needs work

Ventral has been updated and now checks for more issues. You should implement hook_help() as described above.

Major coding standards / best practice issues
An automated review of your project has found some issues with your code; As coding standards make sure projects are coded in a consistent style we please you to have a look at the report and try to fix them. Anyway, note that issues found are possibly false positives and fixing all issues is not a requirement for getting through the application process.

You can find the results of the automated report at http://ventral.org/pareview/httpgitdrupalorgsandboxphysikerwelt1912980git.

----
Top Shelf Modules - Crafted, Curated, Contributed.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

physikerwelt’s picture

Status: Closed (won't fix) » Active

... working on the mediawiki plugin first...
see https://gerrit.wikimedia.org/r/#/projects/mediawiki/extensions/Math,dash...
for details
after finishing that and after comparing to the work of Cjucovschi.. I'll continue working on that one.

physikerwelt’s picture

klausi’s picture

Status: Active » Postponed

OK, just set this back to "needs review" once you got time and your code is ready.

PA robot’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.