GithubHelp home page GithubHelp logo

Comments (10)

B3zaleel avatar B3zaleel commented on August 24, 2024 2

I think I managed to create a control that can render the formula control with normal text, but a lot of the features are still under development. I Would push it when it is quite decent.

from xaml-math.

ForNeVeR avatar ForNeVeR commented on August 24, 2024 1

Yes, that's right. Today WPF-Math doesn't help much with formatting whole TeX documents within WPF forms or documents.

I believe that FlowDocument is the way to go, but I'd like someone (probably myself) to conduct more research on that, and maybe even implement some simple prototype. I still don't know what changes that'll require, and we need to ascertain that before doing anything.

from xaml-math.

alexreg avatar alexreg commented on August 24, 2024

I think this would be beyond the scope of the project. It would be great if someone implements this, but I think it's a big project, and probably best we stay clear of it for now.

from xaml-math.

illiteratePhD avatar illiteratePhD commented on August 24, 2024

I've looked at the FlowDocument tag a bit and it turns out adding WPF-Math is really not that hard, if you can accept not being able to use the standard $...$ pattern. By changing the <border> section of the example with the following:

<Border Margin="10,0,10,10" BorderBrush="LightGray" BorderThickness="1" Grid.Row="3" Grid.Column="0">
    <FlowDocumentScrollViewer>
        <FlowDocument>
            <Paragraph>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce faucibus odio arcu, luctus vestibulum tortor congue in. Lorem ipsum dolor sit amet, consectetur,
                <InlineUIContainer BaselineAlignment="TextBottom">
                    <controls:FormulaControl x:Name="formula1" Formula="\sum d\theta = \tan^{-1}\theta+C" Scale="12" SnapsToDevicePixels="True"/>
                </InlineUIContainer>
                adipiscing elit. Fusce nec lacinia neque. Donec malesuada, ligula non vestibulum cursus, urna purus pellentesque orci, 
                aliquet accumsan dui velit ac justo. 
            </Paragraph>
            <BlockUIContainer>
                <controls:FormulaControl x:Name="formula" Formula="L = \int_a^b \sqrt[4]{ \left| \sum_{i,j=1}^ng_{ij}\left(\gamma(t)\right) \left[\frac{d}{dt}x^i\circ\gamma(t) \right] \left{\frac{d}{dt}x^j\circ\gamma(t) \right} \right|}dt" Scale="12" SnapsToDevicePixels="True"/>
            </BlockUIContainer>
            <Paragraph>
                Nulla vitae suscipit tellus. Nunc sit amet tortor fermentum, sollicitudin enim cursus, sagittis lacus. Pellentesque tincidunt massa nisl, nec tempor nulla 
                consequat a. Proin pharetra neque vel dolor congue, at condimentum arcu varius. Sed vel luctus enim. Curabitur eleifend dui et arcu faucibus, sit amet 
                vulputate libero suscipit. 
            </Paragraph>
        </FlowDocument>
    </FlowDocumentScrollViewer>
</Border>

You actually get something that looks decent. The problem with the inline container is that the baseline, of course, is off. So essentially, what's needed, is a way to switch between the normal and in-line rendering of the formula.

Loving this project. Wish there was a way I could contribute in a meaningful way. Trying to get into the code, but it's a slow process :)

from xaml-math.

alexreg avatar alexreg commented on August 24, 2024

Okay, well maybe we could created a contrib repository and put your control there, if you get it working a bit more smoothly. :) It's been a long time since I did anything with flow documents, but that's good you've made some initial success.

from xaml-math.

illiteratePhD avatar illiteratePhD commented on August 24, 2024

On the topic of inline vs. display. How are these things handled by existing TeX parsers? Are there two character sets or is the existing character set adjusted to a different environment?

from xaml-math.

ForNeVeR avatar ForNeVeR commented on August 24, 2024

@alexreg I don't think we need to split our project into more fragments at the moment. If we can have a decent and non-intrusive solution to use WPF-Math in <FlowDocument> context, I'll vote to accept such contribution and include in into the main code base.

Side note: I'll be absent from March 23rd to 24th on a small scientific trip; I hope you'll be fine here guys 😄

from xaml-math.

alexreg avatar alexreg commented on August 24, 2024

Hmm, well it's your decision @ForNeVeR, but I think it should at the least be in a separate VSproj, if not a separate repository.

from xaml-math.

ForNeVeR avatar ForNeVeR commented on August 24, 2024

I would very much ask you to please create a separate branch for that.

from xaml-math.

B3zaleel avatar B3zaleel commented on August 24, 2024

I will

from xaml-math.

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.