Skip to content

Commit 444542d

Browse files
committed
added latex support
1 parent 3e48c45 commit 444542d

File tree

5 files changed

+73
-15
lines changed

5 files changed

+73
-15
lines changed

‎Gemfile.lock‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ GEM
1313
jekyll-paginate (~> 1.1.0)
1414
jekyll-seo-tag (~> 2.6.1)
1515
jekyll-sitemap (~> 1.4.0)
16-
em-websocket (0.5.1)
16+
em-websocket (0.5.2)
1717
eventmachine (>= 0.12.9)
1818
http_parser.rb (~> 0.6.0)
1919
eventmachine (1.2.7)
2020
eventmachine (1.2.7-x64-mingw32)
21-
faraday (1.0.1)
21+
faraday (1.1.0)
2222
multipart-post (>= 1.2, < 3)
23+
ruby2_keywords
2324
ffi (1.13.1)
2425
ffi (1.13.1-x64-mingw32)
2526
forwardable-extended (2.6.0)
@@ -74,14 +75,14 @@ GEM
7475
mercenary (0.4.0)
7576
multi_json (1.15.0)
7677
multipart-post (2.1.1)
77-
nio4r (2.5.2)
78-
octokit (4.18.0)
78+
nio4r (2.5.4)
79+
octokit (4.19.0)
7980
faraday (>= 0.9)
8081
sawyer (~> 0.8.0, >= 0.5.3)
8182
pathutil (0.16.2)
8283
forwardable-extended (~> 2.6)
83-
public_suffix (4.0.5)
84-
puma (4.3.5)
84+
public_suffix (4.0.6)
85+
puma (5.0.2)
8586
nio4r (~> 2.0)
8687
rack (1.6.13)
8788
rack-jekyll (0.5.0)
@@ -97,7 +98,8 @@ GEM
9798
rb-inotify (0.10.1)
9899
ffi (~> 1.0)
99100
rexml (3.2.4)
100-
rouge (3.22.0)
101+
rouge (3.24.0)
102+
ruby2_keywords (0.0.2)
101103
safe_yaml (1.0.5)
102104
sassc (2.4.0)
103105
ffi (~> 1.9)
@@ -124,7 +126,7 @@ GEM
124126
trollop (2.9.9)
125127
tzinfo (1.2.7)
126128
thread_safe (~> 0.1)
127-
tzinfo-data (1.2020.1)
129+
tzinfo-data (1.2020.4)
128130
tzinfo (>= 1.0.0)
129131
unicode-display_width (1.7.0)
130132
wdm (0.1.1)

‎_config.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ description: >- # this means to ignore newlines until "baseurl:"
66
url: "" # the base hostname & protocol for your site, e.g. https://example.github.io
77
baseurl: "" # the subpath of your site, e.g. /blog
88

9+
# Menu Links
910
urls:
1011
- text: About Me
1112
url: /about
@@ -32,6 +33,7 @@ author_location: India
3233
author_website_url: "https://sujaykundu.com"
3334
typewrite-text: devlopr is a jekyll theme built for developers. You can edit this in _config.yml file
3435

36+
# Experiences
3537
author_work_experiences:
3638
- company_name: Google
3739
company_logo: google.png
@@ -46,6 +48,7 @@ author_work_experiences:
4648
description: Worked on various Azure Cloud Products
4749
visibility: true
4850

51+
# Education
4952
author_education_details:
5053
- college_logo: mit.png
5154
college_name: MIT
@@ -54,6 +57,7 @@ author_education_details:
5457
description: Bachelor of Technology
5558
visibility: true
5659

60+
# Projects
5761
author_project_details:
5862
- project_thumbnail: gamershub.png
5963
project_title: Gamers Hub

‎_includes/head.html‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,20 @@
126126
<script src="{{site.url}}{{site.baseurl}}/assets/bower_components/imagesloaded/imagesloaded.pkgd.min.js"></script>
127127
<script src="{{site.url}}{{site.baseurl}}/assets/bower_components/nanobar/nanobar.min.js"></script>
128128
<script src="{{site.url}}{{site.baseurl}}/assets/bower_components/typewrite/dist/typewrite.min.js"></script>
129-
<!-- <script src="https://cdn.jsdelivr.net/npm/instantsearch.js@2.6.0/dist/instantsearch.min.js"></script> -->
130129
<script src="{{site.url}}{{site.baseurl}}/assets/js/search.js"></script>
131130
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.20.1/moment.min.js"></script>
132131
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
133132

133+
<!-- for Mathjax support -->
134+
{% if page.usemathjax %}
135+
<script type="text/x-mathjax-config">
136+
MathJax.Hub.Config({
137+
TeX: { equationNumbers: { autoNumber: "AMS" } }
138+
});
139+
</script>
140+
<script type="text/javascript" async src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
141+
{% endif %}
142+
134143
<!-- Github Button -->
135144
<script async defer src="https://buttons.github.io/buttons.js"></script>
136145
<script

‎_posts/2019-02-04-welcome-to-jekyll.md‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
---
22
layout: post
3-
title: "Welcome to devlopr jekyll !"
4-
summary: Hello World ! This is a sample post
3+
title: "Welcome to devlopr-jekyll !"
4+
summary: "Getting Started using devlopr-jekyll"
55
author: John Doe
66
date: '2019-05-22 14:35:23 +0530'
77
category: jekyll
88
thumbnail: /assets/img/posts/code.jpg
99
keywords: devlopr jekyll, how to use devlopr, devlopr, how to use devlopr-jekyll, devlopr-jekyll tutorial,best jekyll themes
1010
permalink: /blog/welcome-to-devlopr-jekyll
11+
usemathjax: true
1112
---
13+
14+
1215
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
1316

1417
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
@@ -23,8 +26,14 @@ print_hi('Tom')
2326
#=> prints 'Hi, Tom' to STDOUT.
2427
{% endhighlight %}
2528

26-
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
29+
or
30+
31+
```javascript
32+
var a = 1;
33+
var b = 2;
34+
function sum (num1,num2){
35+
return num1+num2;
36+
}
37+
var result = sum(a,b);
38+
```
2739

28-
[jekyll-docs]: https://jekyllrb.com/docs/home
29-
[jekyll-gh]: https://github.com/jekyll/jekyll
30-
[jekyll-talk]: https://talk.jekyllrb.com/
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
layout: post
3+
title: "Added Latex Support"
4+
summary: Writing Equations using Latex
5+
author: John Doe
6+
date: '2020-10-25 9:35:23 +0530'
7+
category: jekyll
8+
thumbnail: /assets/img/posts/code.jpg
9+
keywords: devlopr jekyll, how to use devlopr, devlopr, how to use devlopr-jekyll, devlopr-jekyll tutorial,best jekyll themes
10+
permalink: /blog/added-latex-equations-support
11+
usemathjax: true
12+
---
13+
14+
## You can now use LaTex to write equations :
15+
16+
In the frontmatter of the article add this :
17+
18+
`usemathjax: true`
19+
20+
After that, simply wrap the math symbols of your article with two double-dollar sign $$:
21+
22+
For Example :
23+
24+
- use this `$$E=mc^2$$`
25+
26+
You should be able to see it in your post as: $$E=mc^2$$
27+
28+
use `$$mean = \frac{\displaystyle\sum_{i=1}^{n} x_{i}}{n}$$` to write :
29+
30+
$$mean = \frac{\displaystyle\sum_{i=1}^{n} x_{i}}{n}$$
31+
32+
- Use `k_{n+1} = n^2 + k_n^2 - k_{n-1}` to write
33+
34+
$$k_{n+1} = n^2 + k_n^2 - k_{n-1}$$

0 commit comments

Comments
 (0)