gregcockroft / androidmath Goto Github PK
View Code? Open in Web Editor NEWRender beautiful LaTeX Math Equations in an Android View
License: MIT License
Render beautiful LaTeX Math Equations in an Android View
License: MIT License
There is an error when trying to render this command (cfrac
):
\cfrac{a}{1 + b}
There is no such issue for frac
.
Is it possible to get the bounding box of the actual rendered content, meaning the height and the width from the canvas?
I am using the component TextViewJustify class. to this class i am setting the text "A motorist traveling to thiruvananthapuram at 10m/s can bring his car to rest in a distance of 10 m."
I am using android:justificationMode="inter_word"
actual:
"A motorist traveling to thiruvananthapuram at 10m/
s can bring his car to rest in a distance of 10 m."
expectation is:
"A motorist traveling to thiruvananthapuram at 10m/s
can bring his car to rest in a distance of 10 m."
Caused by: android.view.InflateException: Binary XML file line #28 in .XMl : Error inflating class com.agog.mathdisplay.MTMathView
Caused by: java.lang.reflect.InvocationTargetException
When building this library in modern AndroidX environment, there are dependency resolution errors, as such:
Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
There is a way to fix it by enabling jettifier. It would be much better if these issues were fixed at the library level. @gregcockroft, please consider adapting your very helpful library to AndroidX.
mathview = findviewbyid.............
mathview.latex = "x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}"
"latex" showing red ... seems no latex attribute there. how to solv this?
Trying to use padding on the view make it invisible !
Thanks.
'\text{Slope of line }\mathrm{AB}=\frac{\Delta{C}}{\Delta{F}}
\\=\frac{100-0}{212-32}=\frac{100}{180}=\frac{5}{9}
'
if we added the extra space after the Delta{F}} its working fine. Please refer the below letax. our expectation should work with above formula.. Please refer below screenshot. which is highlighted because u can understand the whitespace.
'\text{Slope of line }\mathrm{AB}=\frac{\Delta{C}}{\Delta{F}}
\\=\frac{100-0}{212-32}=\frac{100}{180}=\frac{5}{9}
'
Is there a way to change the font?
I am developing a chatgptrobot,sometimes the robot will response to you with some latex string,i want to allow user to copy it or copy the substring with long click,how can i do?
I got some rendering issue on some devices. It is not rendering at all on some devices when I install a debug APK. (Image A) When I create a release APK, it renders overlapped. It's unreadable (Image B). But some devices same project working properly. (Image C)
I tried it on more than 10 devices (deferent OS, deferent model) manually and on half of them not working properly. Also I observed that same device (model) has working and not-working issue.
Any help ?
Thanks !
Hashan.
Image A - DEBUG MODE PREVIEW (not rendering) :
Image B - RELEASE MODE PREVIEW (overlapped) :
(Image A and B on same device (Samsung Galaxy A01) C on Samsung Galaxy A50)
This library is pretty good for now, just a little bit issue, and I'm happy to do some fixes and adaptation.
I tried to find the cdep
library from the original author and google's repo, but it seems like the project cdep
is terminated.
Specifically, this jar file can not be found.
Any help?
When i am trying to update TargetSDKversion to "30" In MXL File getting error inflating class please look into it below log files. it is not working only in android 11 version mobile.
android.view.InflateException: Binary XML file line #88 in com.iguru.school.leadindiabharat:layout/item_queastionlist: Binary XML file line #88 in com.iguru.school.leadindiabharat:layout/item_queastionlist: Error inflating class com.agog.mathdisplay.MTMathView
Caused by: android.view.InflateException: Binary XML file line #88 in com.iguru.school.leadindiabharat:layout/item_queastionlist: Error inflating class com.agog.mathdisplay.MTMathView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:852)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
at android.view.LayoutInflater.inflate(LayoutInflater.java:680)
at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
at com.iguru.school.leadindiabharat.elearning.QuestionsAdpter.onCreateViewHolder(QuestionsAdpter.java:116)
at com.iguru.school.leadindiabharat.elearning.QuestionsAdpter.onCreateViewHolder(QuestionsAdpter.java:44)
at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:7295)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6416)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6300)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6296)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2330)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1631)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1591)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:668)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4309)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:4012)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4578)
at android.view.View.layout(View.java:24475)
at android.view.ViewGroup.layout(ViewGroup.java:7383)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
at android.view.View.layout(View.java:24475)
at android.view.ViewGroup.layout(ViewGroup.java:7383)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
2021-10-27 10:45:17.705 19213-19213/com.iguru.school.leadindiabharat E/AndroidRuntime: at android.view.View.layout(View.java:24475)
at android.view.ViewGroup.layout(ViewGroup.java:7383)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:24475)
at android.view.ViewGroup.layout(ViewGroup.java:7383)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:24475)
at android.view.ViewGroup.layout(ViewGroup.java:7383)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
at android.view.View.layout(View.java:24475)
at android.view.ViewGroup.layout(ViewGroup.java:7383)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:24475)
at android.view.ViewGroup.layout(ViewGroup.java:7383)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
at android.view.View.layout(View.java:24475)
at android.view.ViewGroup.layout(ViewGroup.java:7383)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:1225)
at android.view.View.layout(View.java:24475)
at android.view.ViewGroup.layout(ViewGroup.java:7383)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:4260)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3695)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2618)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9971)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1010)
at android.view.Choreographer.doCallbacks(Choreographer.java:809)
at android.view.Choreographer.doFrame(Choreographer.java:744)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:995)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8595)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by: com.agog.mathdisplay.parse.MathDisplayException: Error initializing FreeType.
at com.agog.mathdisplay.render.MTFontMathTable.(MTFontMathTable.kt:94)
at com.agog.mathdisplay.render.MTFont.(MTFont.kt:19)
at com.agog.mathdisplay.render.MTFont.(MTFont.kt:9)
at com.agog.mathdisplay.MTFontManager$Companion.fontWithName(MTFontManager.kt:25)
at com.agog.mathdisplay.MTFontManager$Companion.latinModernFontWithSize(MTFontManager.kt:42)
at com.agog.mathdisplay.MTFontManager$Companion.defaultFont(MTFontManager.kt:54)
at com.agog.mathdisplay.MTMathView.(MTMathView.kt:126)
at com.agog.mathdisplay.MTMathView.(MTMathView.kt:32)
at com.agog.mathdisplay.MTMathView.(Unknown Source:6)
I cant use findviewById in java...
this library is just for kotlin?
help me plaese I am java develooper .
thanks.
Getting target exception in the XML mentioning library <com.agog.mathdisplay.MTMathView when compileSdkVersion and targetSdkVersion increasing to 30 and 31 may be in jcenter and maven { url "https://jitpack.io" } is deprecated in api level 30 and 31. Dependency is not working increasing api level please take it as a priority and fix the issue.
I was wondering if adding support for the various \big
, \Big
, \bigg
, and \Bigg
commands is on the roadmap?
ndk {
abiFilters "armeabi-v7a"
}
I try everything I can , but it still not working .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.