Skip to content

Commit

Permalink
Merge branch 'clerissonmn-mathjax-support'
Browse files Browse the repository at this point in the history
i equations supported
  • Loading branch information
wowthemesnet committed Mar 5, 2019
2 parents b9a779b + 8c1214f commit 796a53e
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 28 deletions.
16 changes: 16 additions & 0 deletions _includes/mathjax-support.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$', '$'], ["\\(", "\\)"] ],
displayMath: [ ['$$', '$$'], ["\\[", "\\]"] ],
processEscapes: true,
// skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
}
//,
//displayAlign: "left",
//displayIndent: "2em"
});
</script>

<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script>
59 changes: 31 additions & 28 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,40 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{{page.title}} | {{site.name}}</title>

{% seo %}

<link rel="shortcut icon" type="image/x-icon" href="{{site.baseurl}}/{{site.favicon}}">

<!-- Font Awesome Icons -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">

<!-- Google Fonts-->
<link href="https://fonts.googleapis.com/css?family=Nunito:400,700" rel="stylesheet">

<!-- Bootstrap Modified -->
<link rel="stylesheet" href="{{site.baseurl}}/assets/css/main.css">

<!-- Theme Stylesheet -->
<link rel="stylesheet" href="{{site.baseurl}}/assets/css/theme.css">

<!-- Jquery on header to make sure everything works, the rest of the scripts in footer for fast loading -->
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>

{% include tracking-header.html %}


{% include mathjax-support.html %}


</head>

<body class="{% if page.url == "/" %} homefirstpage {% endif %}">

<!-- Navbar -->
<nav id="MagicMenu" class="topnav navbar navbar-expand-lg navbar-light bg-white fixed-top">
<div class="container">
Expand All @@ -51,34 +54,34 @@
</div>
</div>
</nav>

<!-- Search Results -->
<div id="lunrsearchresults">
<ul class="mb-0"></ul>
</div>

<!-- Content -->
<main role="main" class="site-content">
{{ content }}
<main role="main" class="site-content">
{{ content }}
</main>
<!-- Scripts: popper, bootstrap, theme, lunr -->


<!-- Scripts: popper, bootstrap, theme, lunr -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>

<script src="{{site.baseurl}}/assets/js/theme.js"></script>
<!-- Footer -->


<!-- Footer -->
<footer class="bg-white border-top p-3 text-muted small">
<div class="container">
<div class="row align-items-center justify-content-between">
<div>
<span class="navbar-brand mr-2 mb-0"><strong>Mundana</strong></span>
<span class="navbar-brand mr-2 mb-0"><strong>Mundana</strong></span>
<span>Copyright © <script>document.write(new Date().getFullYear())</script>.</span>

<!-- Github Repo Star Btn-->
<a class="text-dark ml-1" target="_blank" href="https://github.com/wowthemesnet/mundana-theme-jekyll"><i class="fab fa-github"></i> Fork on Github</a>

Expand All @@ -89,9 +92,9 @@
</div>
</div>
</footer>

{% include tracking-footer.html %}

</body>

</html>
38 changes: 38 additions & 0 deletions _posts/2019-03-04-latex-math-equations-example.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
layout: post
title: "You can use LaTeX equations!!!"
categories: [ Jekyll, Mathjax ]
image: assets/images/equations.jpg
---

Thanks to [Mathjax](https://www.mathjax.org/), you can use LaTeX equations. Simple inline equations like $f(x) = ax+b$ can be written simply by using

```
$f(x) = ax + b$
```
while displayed equations just like
\\[
f(t) = \frac{a_0}{2} + \sum\limits_{n=0}^{\infty} \left[a_n \mathrm{cos}(\omega_n t) + \mathrm{sin}(\omega_n t) \right]
\\]
can be done by typing

```
\\[ f(t) = \frac{a_0}{2} + \Sum\limits_{n=0}^{\infty} \left[a_n \mathrm{cos}(\omega_n t) + \mathrm{sin}(\omega_n t) \right]. \\]
```

Numbered equations can be done by using `\tag{}` inside equation environment as show in
\\[
\vec{F} = m \ddot{\vec{r}}, \tag{1} \label{eq:sample}
\\]

by using

```
\\[
\vec{F} = m \ddot{\vec{r}} \tag{1} \label{eq:sample}
\\]
```

Thus the equation can be referenced by using `\ref{}` latex command. For exemple, the eq. ($\ref{eq:sample}$) is referenced by using `$\ref{eq:sample}$`

For more information see [Mathjax documentation](http://docs.mathjax.org/en/latest/tex.html)
Binary file added assets/images/equations.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 796a53e

Please sign in to comment.