💾 Archived View for gemi.dev › gemini-mailing-list › 000445.gmi captured on 2024-06-16 at 13:16:48. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-12-28)

-=-=-=-=-=-=-

examples with Sympy

1. fluxion (fluxion (a) monocles.de)

I thought it could be nice to show some examples rendered
with Sympy.
With unicode:

pprint(Integral(sqrt((1+x)/(x**2+3)),x)+Sum(1/j**2,(j,1,n)))

                       n     
                      ____   
?                     ?      
?      ________        ?   1 
?     ? x + 1           ?  ??
?    ?  ??????  dx +    ?   2
?   ?    2             ?   j 
? ??    x  + 3        ?      
?                     ????   
                     j = 1 


With ascii:

pprint(Integral(sqrt((1+x)/(x**2+3)),x)+Sum(1/j**2,(j,1,n)), use_unicode=False)

                        n     
  /                   ____    
 |                    \   `   
 |      ________       \    1 
 |     / x + 1          \   --
 |    /  ------  dx +   /    2
 |   /    2            /    j 
 | \/    x  + 3       /___,   
 |                    j = 1   
/

By comparison, the LaTeX text could be
\int{\sqrt{\frac{x+1}{x^2+3}}dx+\sum_{j=1}^n\frac{1}{j^2}
which I don't have a problem reading it, but... for non-LaTeX users...

Finally, an example of a graphic:

plot(sin(x),(x,-2*pi,2*pi))

0.99830 |       ...                        ...                   
        |      /   \                      /   \                  
        |     /     .                    /     .                 
        |    .                          .                        
        |            .                          .                
        |   .                          .                         
        |             .                          .               
        |  .                          .                          
0.05872 | -------------.--------------------------.--------------
        | .             .            .             .            /
        |                           .                          . 
        |                .                          .            
        |                          .                          .  
        |                 .                          .           
        |                         .                          .   
        |                  .     /                    .     /    
        |                   \   /                      \   /     
-0.9983 |                    ...                        ...      
          -6.28319                   0                          6.28319

In this case we seem to get the same result with ascii and unicode,
or maybe Sympy does not distinguish for plotting, although both
pprint(plot(sin(x),(x,-2*pi,2*pi)),use_unicode=False)
and 
pprint(plot(sin(x),(x,-2*pi,2*pi)))
seem to be accepted by Sympy.

Is this enough for math & data? What do you think?

Link to individual message.

2. Leo (list (a) gkbrk.com)

Wow! These look amazing on the terminal. I am not quote-replying as I
don't want to mess with the beautiful monospace rendering.

I would love to read a maths/science/CS related blog that uses this
kind of rendering. This is so pleasant to look at on both a terminal and
a GUI client.

I hope someone will take the time to write either a latex-to-gemtext
compiler that can generate this, or a server that does it dynamically.

--
Leo

Link to individual message.

3. Gary Johnson (lambdatronic (a) disroot.org)

Leo <list at gkbrk.com> writes:

> Wow! These look amazing on the terminal. I am not quote-replying as I
> don't want to mess with the beautiful monospace rendering.
>
> I would love to read a maths/science/CS related blog that uses this
> kind of rendering. This is so pleasant to look at on both a terminal and
> a GUI client.
>
> I hope someone will take the time to write either a latex-to-gemtext
> compiler that can generate this, or a server that does it dynamically.

I agree. To fluxion, I would remind you that the text/gemini format is
meant to be served as Unicode by default, so if you were to simply stick
those result graphics in a preformatted (```) block, they should look
great in any gemini client.

Thanks for the examples with Sympy. Very inspiring indeed!

Happy hacking,
  Gary

-- 
GPG Key ID: 7BC158ED
Use `gpg --search-keys lambdatronic' to find me
Protect yourself from surveillance: https://emailselfdefense.fsf.org
=======================================================================
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

Link to individual message.

4. raingloom (raingloom (a) riseup.net)

On Sat, 7 Nov 2020 19:08:39 +0100
fluxion <fluxion at monocles.de> wrote:

> I thought it could be nice to show some examples rendered
> with Sympy.

I have only one question: how will screen readers handle this?

Link to individual message.

5. Jason McBrayer (jmcbray (a) carcosa.net)

raingloom <raingloom at riseup.net> writes:

> I have only one question: how will screen readers handle this?

Probably very badly. Which is why I'm somewhat critical of using fixed
format blocks for ASCII art.

-- 
Jason McBrayer      | ?Strange is the night where black stars rise,
jmcbray at carcosa.net | and strange moons circle through the skies,
                    | but stranger still is lost Carcosa.?
                    | ? Robert W. Chambers,The King in Yellow

Link to individual message.

6. Zach DeCook (zachdecook (a) librem.one)

On November 9, 2020 6:05:41 PM EST, Jason McBrayer <jmcbray at carcosa.net> wrote:
>raingloom <raingloom at riseup.net> writes:
>
>> I have only one question: how will screen readers handle this?
>
>Probably very badly. Which is why I'm somewhat critical of using fixed
>format blocks for ASCII art.

>Anything which comes after the ``` characters of a line which toggles 
preformatted line *on* (i.e. the first, third, fifth, etc. toggling lines 
in a document) may be treated as "alt text" for the preformatted content.

gemini://gemini.circumlunar.space/docs/gemtext.gmi

Like

 ```ascii art READERS are LEADERS, which my parents used to tell me 
whenever I wasn't reading a book.
  _   _   .    _   _  _  _
 |_) |_  /_\  | \ |_ |_) \
 | \ |_ /   \ |_/ |_ | \ _\

            ARE
      _   .    _   _  _  _
 |   |_  /_\  | \ |_ |_) \
 |__ |_ /   \ |_/ |_ | \ _\
 ```

Link to individual message.

7. Nathan Galt (mailinglists (a) ngalt.com)



> On Nov 9, 2020, at 1:44 PM, raingloom <raingloom at riseup.net> wrote:
> 
> On Sat, 7 Nov 2020 19:08:39 +0100
> fluxion <fluxion at monocles.de> wrote:
> 
>> I thought it could be nice to show some examples rendered
>> with Sympy.
> 
> I have only one question: how will screen readers handle this?

Here?s how I would do it:

 ```An equation of two terms. They?re added together. The first term is an 
integral with respect to dx. It?s of the square root of a single fraction. 
The numerator of the fraction is x plus 1. The denominator of the fraction 
is x squared plus 3. The second term is a summation. It starts at j equals 
1 and goes to n. It sums up 1 divided by j squared.
                      n     
                     ____   
?                     ?      
?      ________        ?   1 
?     ? x + 1           ?  ??
?    ?  ??????  dx +    ?   2
?   ?    2             ?   j 
? ??    x  + 3        ?      
?                     ????   
                    j = 1 
 ```

It?s been a long time since I?ve heard anyone talk college-level math 
aloud and you _definitely_ shouldn?t trust how I read the first term 
aloud, but this is roughly how I?d put it on my capsule.

Link to individual message.

8. Gary Johnson (lambdatronic (a) disroot.org)

> Here?s how I would do it:
>
> ```An equation of two terms. They?re added together. The first term is 
an integral with respect to dx. It?s of the square root of a single 
fraction. The numerator of the fraction is x plus 1. The denominator of 
the fraction is x squared plus 3. The second term is a summation. It 
starts at j equals 1 and goes to n. It sums up 1 divided by j squared.
>                       n     
>                      ____   
> ?                     ?      
> ?      ________        ?   1 
> ?     ? x + 1           ?  ??
> ?    ?  ??????  dx +    ?   2
> ?   ?    2             ?   j 
> ? ??    x  + 3        ?      
> ?                     ????   
>                     j = 1 
> ```
>
> It?s been a long time since I?ve heard anyone talk college-level math 
aloud and you _definitely_ shouldn?t trust how I read the first term 
aloud, but this is roughly how I?d put it on my capsule.

+1 Nicely done.

-- 
GPG Key ID: 7BC158ED
Use `gpg --search-keys lambdatronic' to find me
Protect yourself from surveillance: https://emailselfdefense.fsf.org
=======================================================================
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

Link to individual message.

9. fluxion (fluxion (a) monocles.de)

> >
> > ```An equation of two terms. They?re added together. The first term is 
an integral with respect to dx. It?s of the square root of a single 
fraction. The numerator of the fraction is x plus 1. The denominator of 
the fraction is x squared plus 3. The second term is a summation. It 
starts at j equals 1 and goes to n. It sums up 1 divided by j squared.
> >                       n     
> >                      ____   
> > ?                     ?      
> > ?      ________        ?   1 
> > ?     ? x + 1           ?  ??
> > ?    ?  ??????  dx +    ?   2
> > ?   ?    2             ?   j 
> > ? ??    x  + 3        ?      
> > ?                     ????   
> >                     j = 1 
> > ```
> >
> > It?s been a long time since I?ve heard anyone talk college-level math 
aloud and you _definitely_ shouldn?t trust how I read the first term 
aloud, but this is roughly how I?d put it on my capsule.
> 
> +1 Nicely done.
> 
I also love this. Sometimes we are blind to the most simple and nice way
of doing something. Thanks!

Link to individual message.

---

Previous Thread: hello

Next Thread: Adding close_notify to the spec ?