Code Monkey home page Code Monkey logo

Comments (10)

shah-xad avatar shah-xad commented on May 18, 2024

This time you can use
<img src="http://localhost:5353/assets/app_icon.png"> <br>
Just use port 5353 instead of 8080 but it's not a permanent fix, I'll handle this in the next update.

from flutter_tex.

nilsmechanix avatar nilsmechanix commented on May 18, 2024

from flutter_tex.

shah-xad avatar shah-xad commented on May 18, 2024

I have updated the package please take a look at 3.6.2. I have added a new widget TeXViewImage where you can load images either from assets or network. Be careful there are some API changes with some new features please do check Changelog and example before proceeding.

from flutter_tex.

nilsmechanix avatar nilsmechanix commented on May 18, 2024

The TeXViewImage works like a charme, however I really liked the solution to use
<img src="http://localhost:5353/assets/app_icon.png">
inside the teX string. With the new update that line of code doesn't work anymore.
The advantage for me to use it inside the teX code is that I can use html style functionality.
I want to be able to show code right next to the image.
In html this can be accomplished by something like this:

<div>
        <div style:"display: inline-block">
		<img src="drawings\fig1.4.1.svg" alt="figure 1.4.1">
	</div>
	<div style:"display: inline-block">
		$$\begin{aligned} 
                |\mathbf a| &= |\mathbf c|=2, \\[5px]
                |\mathbf d| &= |\mathbf f|=3, \\[5px]
                |\mathbf b| &= 4
                \end{aligned}$$
        </div>	
</div>

Whats an image src I could use to accomplish this?
Thanks for your help

from flutter_tex.

shah-xad avatar shah-xad commented on May 18, 2024

Put TeXViewImage in TeXViewContainer and apply style to your container using TeXViewStyle.fromCSS("your:style;" ), I hope you can achive exactly what you want.

Image src is a source either from a network or local assets.

from flutter_tex.

nilsmechanix avatar nilsmechanix commented on May 18, 2024

Yes this worked for me. Thanks for the tip.
If I have a page with lots of images and formula right next to that image I have to split the raw teX-String into lots of smaller pieces and then put them back each in a TexViewContainer file.
Since I have to use some containers inside of each other to achive the layout that I want it becomes very nested.
If I could just use the raw HTML and teX code with something like this:
<img src="http://localhost:5353/assets/app_icon.png"> <br>
it would become a lot easer for me.
However if this solution can't be available anymore I'll stick with the containers.

from flutter_tex.

shah-xad avatar shah-xad commented on May 18, 2024

Ok fine you can get port by using this window.location.port and just use that port. because this time port is dynamic for each instance, but it won't work properly.
Why don't you create a custom TeXViewWiget and reuse that again and again?

e.g. for you above code


  TeXViewWidget customTeXViewWidget(imgSrc, rawTeX) {
    return TeXViewColumn(children: [
      TeXViewContainer(child: TeXViewImage.asset(imgSrc),
          style: TeXViewStyle.fromCSS("display: inline-block")),
      TeXViewDocument(
          rawTeX, style: TeXViewStyle.fromCSS('display: inline-block'))
    ]);
  }

from flutter_tex.

shah-xad avatar shah-xad commented on May 18, 2024

Hey now again you can use <img src="http://localhost:5353/assets/app_icon.png"> <br> do get the latest version of flutter_tex.

from flutter_tex.

nilsmechanix avatar nilsmechanix commented on May 18, 2024

Thanks, this works!

from flutter_tex.

abdelrahman-abied avatar abdelrahman-abied commented on May 18, 2024

check this solution
#135 (comment)

from flutter_tex.

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.