Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context not honored in xml2tex-conf//charmap/char #1

Closed
peppobon opened this issue Apr 15, 2016 · 4 comments
Closed

context not honored in xml2tex-conf//charmap/char #1

peppobon opened this issue Apr 15, 2016 · 4 comments

Comments

@peppobon
Copy link

Whit this example conf
<char character="¯" string="${\thickspace\cup\thickspace}$" context="dbk:phrase[@css:font-familyzzzzzzzzzzzzzzz = 'MathematicalPi_4']"/>

I get in the latex output the ${\thickspace\cup\thickspace}$ string and it should not, as the css:font-familyzzzzzzzzzzzzzzz attribute clearly does not exist in my source xml

regards
__peppo

@gimsieke
Copy link
Contributor

Hi Peppo,

I investigated and I found out that the schema in fact permits an optional context attribute for char. I investigated further and I found out that this attribute is currently not being evaluated. The replacement works globally and may not be constrained. I’ll investigate whether we can honour this constraint with the current approach. If it turns out to be too difficult or too inefficient, we’ll rather disallow the context attribute for the time being.

gimsieke added a commit to transpect/docx2tex that referenced this issue Apr 17, 2016
@gimsieke
Copy link
Contributor

Please note that everything in the charmap (example: docx2tex charmap) applies to text mode. MathML to LaTeX translation happens before this charmap is applied.
So the general problem of handling character translations differently in math and text mode should be solved anyway.
Nevertheless, I fixed this issue by honouring the @context attribute on char entries. There is some documentation in the schema.

@gimsieke
Copy link
Contributor

Ah, I see. Your equations aren’t always MathML. Then this fix should help.

@gimsieke
Copy link
Contributor

In the test case that you sent, you can use

<charmap>
    <char character="&#x3bc;" string="${\mu}$"/>
    <char character="&#x3bc;" string="\mu " context="dbk:mathphrase"/>
  </charmap>

I tried it, it works.

Now we should update our sample configuration with dbk:mathphrase exceptions…

gimsieke added a commit that referenced this issue Apr 17, 2016
gimsieke added a commit to transpect/docx2tex that referenced this issue Apr 17, 2016
…tions for some symbols (needs to be completed yet)
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants