Closed SushantGautam closed 2 years ago
graphics
package. As a workaround, you can use the \class
command to specify a CSS class that would have a transform
attribute. It would probably make sense to file a feature request for this and see if there is enough interest.tikz
package is probably out of scope, especially if you'd want to have an editor for those graphicslabel
property for a keycap. See the Virtual Keyboards guide (look for SVG to see an example).insert
can only be use to insert Latex. However, a keycap can also have a command
property which is more general and can respond in many ways. There is more detail and some examples provided in the Virtual Keyboards guide.Could you share what did you have in mind in terms of custom symbols and how you'd like to use them with the virtual keyboard?
I forgot to mention that (1) has been discussed in #112 .
Great! I managed to make it work with\class
and decides my styles in the root using MathLive.makeMathField.
However, after I migrated to MathfieldElement I couldn't make it work.
As mentioned in the doc: "To associate a CSS stylesheet with this layer, use the styles property of the layer." and looking at the code segment: if (layer.styles) { temporaryLayer +=
; }
I added CSS properties like:
But the shadow root shows these styles only:
and it didn't work.
The \class
property is rendered well in DOM. But since this is inside shadow root, the styles supplied at root arent obviously reflected here.
What is the correct way to supply styles?
Oopps... Yes, good point. The style
property above allows you to inject a custom stylesheet to be used by the virtual keyboard. But if you're going to use custom classes in a mathfield, you need something analogous to inject the stylesheet in the shadowed element.
Ok I Understood! That was just for the virtual keyboard style.
Hope there will be a way (maybe another attribute besides styles
for stylesheet in the shadowed element) soon.
OK, I've checked in a fix in master. You can now include a <style>
tag inside the <math-field>
.
<math-field>
<style>
.custom-class { box-shadow: 2px 2px 2px #000 };
</style>
\class{custom-class}{\frac{1}{x+1}}
</math-field>
I think It was working when I had placed styles outside math-field too before.
I am raising this problem when we use MathfieldElement through the script.
Since <math-field>
is created dynamically we cant use the method you mentioned isn't it?
Yes, that should work. You should be able to set the innerHTML of the MathfieldElement to “”
Cool!
We could then set it through mfe.innerHTML =
` .
I tried and the style was appended to the dom as expected, but it didn't work.
It would take time for this change to be reflected at https://unpkg.com/mathlive/dist/mathlive.min.js, right?
Yes, the change is in master, which is the branch in GitHub. You can find the status of a fix/feature by checking the changelog, which will either indicate the npm release it’s available in or “unreleased”
No activity in a while. Closing.
I have some general queries regarding the extendibility of MathLive.