Formatted and Dynamic text in SVG

9 views
Skip to first unread message

Dean Ang Gmail

unread,
Oct 13, 2023, 10:37:55 AM10/13/23
to Numbas Users
Hi, 

Is it possible to display formatted and dynamic text in SVG?

Thanks.

Christian Lawson-Perfect

unread,
Oct 13, 2023, 10:57:59 AM10/13/23
to numbas...@googlegroups.com
Formatting text in SVG is really tricky. I don't think that text substituted into an SVG with curly braces can be formatted. What are you trying to achieve?

--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/numbas-users/cc2b5199-3b26-4ed0-a0dc-0a9792170340n%40googlegroups.com.

Dean Ang Gmail

unread,
Oct 13, 2023, 11:00:49 AM10/13/23
to numbas...@googlegroups.com
Thanks for the prompt reply. Like a function or fraction in the svg ?

You received this message because you are subscribed to a topic in the Google Groups "Numbas Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/numbas-users/0-KZxFuGQ0s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to numbas-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/numbas-users/CAEMHSOhxbcVA2mjnWoDPy1TXW_wOP-KKxvF6jNC9k2NHZgf0Nw%40mail.gmail.com.

Christian Lawson-Perfect

unread,
Oct 20, 2023, 10:51:49 AM10/20/23
to numbas...@googlegroups.com
Sorry, I seem to have put off answering this all week!

If you're looking to put typeset mathematics in an SVG, I think it will be very hard. MathJax can't run inside SVG diagrams, and good layout even of a simple fraction is really hard to achieve in SVG.

Dean Ang Gmail

unread,
Oct 20, 2023, 9:51:17 PM10/20/23
to numbas...@googlegroups.com
Understand that. Thanks for the reply

Guillermo Bernardo Durán González

unread,
Oct 21, 2023, 6:37:54 PM10/21/23
to numbas...@googlegroups.com
Hi,

It is possible with SVG, to display dynamic values. Look at the link, the temperatures are updated in the table and on the image.


Regards


--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/numbas-users/cc2b5199-3b26-4ed0-a0dc-0a9792170340n%40googlegroups.com.


--
Guillermo Durán G.

Don Shearman

unread,
Oct 21, 2023, 7:56:49 PM10/21/23
to numbas...@googlegroups.com
Yes this is possible by including the variable name in curly braces in the SVG file. For example, if you have a variable max, putting {max} in the SVG will result in the value of max being displayed in the Numbas question. 

Regards
Don Shearman
Sent from my iPad

On 22 Oct 2023, at 09:37, Guillermo Bernardo Durán González <guillerm...@gmail.com> wrote:


Reply all
Reply to author
Forward
0 new messages