Coder Social home page Coder Social logo

Comments (6)

chipzoller avatar chipzoller commented on May 27, 2024 1

I think this should be an enhancement, yes, and I also like the idea of activating it globally with per-page overrides like we have done with other parameters. Although our theme wasn't specifically designed to cater to math notation, it is somewhat of a relative of programming and other code. It seems like there should be similar facility to enable (and optimize for) its use.

from hugo-clarity.

onweru avatar onweru commented on May 27, 2024

@jpboignard, thanks for raising this. I have attached screenshots of the diagnosis, an explanation from the docs why this is happening and a solution.


Diagnosis

Screen Shot 2020-08-26 at 10 42 18 AM


Docs

See this section from the docs
Screen Shot 2020-08-26 at 10 41 24 AM


Solution

To remedy this, you can simply change this line in your config.toml to:

unsafe = true # change to false to disable inclusion of raw HTML and math functions

@chipzoller, I will need your help documenting this

from hugo-clarity.

jpboignard avatar jpboignard commented on May 27, 2024

It does not work for me.
In the exampleSite, in safe or unsafe mode, the bottom of the page http://localhost:1313/post/math-typesetting/ only display this:
image

from hugo-clarity.

onweru avatar onweru commented on May 27, 2024

@jpboignard, if you donโ€™t mind, I would like to see your code. Perhaps the config.toml & the math block youโ€™re trying to publish

from hugo-clarity.

onweru avatar onweru commented on May 27, 2024

As it turns out, the answer to this issue is, in fact, right under our nose. The first sentence of that posts states ๐Ÿ‘‡

Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.

In fact, the entire post documents how you activate math notation on a Hugo website.

When you look at the scripts loaded from the aforementioned link, you will notice katex.min.js is among them (see the attached screenshot). This means, the Hugo themes site, a Hugo site, has implemented what is documented within the aforementioned post.

Since this issue is already well documented (again, by the aforementioned post) I think we will document this only as an addendum.

No further changes will be required on this theme's config.

@chipzoller, do you think we should treat this as a feature request? Maybe, go a little further and conditionally load the katex third party JavaScript libraries ? The condition would be as follows:

Sitewide via config.toml file

...
[params]
...
enableMathNotation=false # change to true to activate math notation
...

It would be overridable from a page frontmatter

...
[params]
...
enableMathNotation=true # I want to activate math notation on this page even if it's off site-wide
...

Screen Shot 2020-10-05 at 9 30 32 am

from hugo-clarity.

chipzoller avatar chipzoller commented on May 27, 2024

@onweru I'm circling back on this as my task to update the README. Please confirm that the functionality is present and all that's needed from a docs standpoint is to write about the enableMathNotation in the config.toml file, overridable at the post level.

from hugo-clarity.

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.