Comments (6)
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.
@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
Docs
See this section from the docs
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.
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:
from hugo-clarity.
@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.
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
...
from hugo-clarity.
@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)
- [Bug] CORS error when using www. subdomain, .css and .js files not loading HOT 4
- [Bug] Mobile rendering display problem HOT 2
- [Bug] `-webkit-appearance: none` breaks embedded form styling HOT 3
- [Bug] CORS error when using multilingual sites, .css and .js files not loading
- [Bug] CORs error when publishing to Gitlab Pages HOT 3
- [Feature] Mastodon profile support HOT 4
- [Bug] Inline MathJax/Katex doesn't work HOT 1
- [Bug] Caret icon path is incorrect if iconsDir is changed. HOT 1
- [Bug] `blog_search_field_placeholder` i18n key does not seem to be used. HOT 1
- [Bug] Path to thumbnail images incorrect on second and higher page
- [Bug] ReadingTime broken after git submodule update HOT 1
- [Bug] Related posts in series not displayed in example site
- [Docs] HOT 3
- [Feature]
- [Feature] Tabs for code blocks
- [Bug] [Feature Request] tags, categories & series items use posts' layout
- [Bug] Posts that have today's date but no time get first published at the end of the day HOT 4
- [Feature] Multipage Blog Post
- [Bug] featured: true / featured: false not working as expected HOT 5
- [Bug] If an image is scalable or not is not determined correctly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-clarity.