Giter Club home page Giter Club logo

Comments (4)

mkraetke avatar mkraetke commented on June 9, 2024 2

Perhaps it's not necessary to fork the entire project. You can just create your own configuration and import the docx2tex configuration. Then you could just overwrite the things you don't like and use the command line parameter -c to pass the path to your custom configuration. Here is a sample configuration that would be sufficient:

<?xml version="1.0" encoding="UTF-8"?>
<set xmlns="http://transpect.io/xml2tex"  
     xmlns:tr="http://transpect.io"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <import href="docx2tex/conf/conf.xml"/>
  
  <!-- override lines 742 to 749 of docx2tex/conf/conf.xml
       applies to real Word equations which are treated by 
       our mml2tex module -->

  <template context="dbk:inlineequation[not(ancestor::dbk:superscript or ancestor::dbk:subscript )]
                    |dbk:equation[ancestor::dbk:table or ancestor::dbk:informaltable]">
    <rule>
      <text select="'\begin{math}'"/>
      <text/>
      <text select="'\end{math}'"/>
    </rule>
  </template>
  
  <!-- selectively override the character mappings. Please 
       note that this apply to text characters outside of equations. -->
  
  <charmap ignore-imported-charmaps="false">
    <!--DEGREE SIGN -->
    <char character="&#xb0;" string="\begin{math}\circ\end{math}"/>
  </charmap>
  
</set>

from docx2tex.

mkraetke avatar mkraetke commented on June 9, 2024 1

It's a possible but a bit more complicated since some mappings in our character map contain already Dollar characters. Unfortunately, I'm very busy at the moment, so I cannot give you a time frame for resolving this issue.

from docx2tex.

mjr avatar mjr commented on June 9, 2024 1

@mkraetke Thank you very much, it worked perfectly.

from docx2tex.

mjr avatar mjr commented on June 9, 2024

@mkraetke Would it be simpler if I made a fork and replaced the character map of $ with $$ or something similar?

I'm wanting to do this because I'm wanting to identify where there are inline formulas, but it gets more complicated because the dollar might not be a formula. (ex: $500, $400)

from docx2tex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.