forked from bcjaeger/seminar-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1008 lines (683 loc) · 21.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="" xml:lang="">
<head>
<title>Happier version control with Git and GitHub</title>
<meta charset="utf-8" />
<meta name="author" content="Byron C. Jaeger" />
<script src="libs/header-attrs/header-attrs.js"></script>
<link href="libs/remark-css/default.css" rel="stylesheet" />
<link href="libs/remark-css/default-fonts.css" rel="stylesheet" />
</head>
<body>
<textarea id="source">
class: center, middle, inverse, title-slide
# Happier version control with Git and GitHub
## (and Rstudio)
### Byron C. Jaeger
### Wake Forest School of Medicine
### 2021-09-28 (updated: 2021-09-28)
---
class: center, middle
<style type="text/css">
.blue { color: DodgerBlue; }
.larger { font-size: 160px; }
.largish {font-size: 40px; }
.blue_background {
font-size: 40px;
background-color: rgba(30,144,255, 0.1);
}
.rainbow-text {
background-image: linear-gradient(to left, violet, indigo, blue, green, yellow, orange, red);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
</style>
# .larger[HELLO]
My name is Byron
---
background-image: url(img/run_R_kids.png)
background-size: 100%
---
class: center, middle, inverse
# .larger[DISCLAIMERS]
---
# I am recycling materials
--
- Alice Bartlett: [Git for humans, 2016](https://speakerdeck.com/alicebartlett/git-for-humans) (slides)
--
- Jenny Bryan:
+ [Rstudio::conf 2017](https://www.rstudio.com/resources/rstudioconf-2017/happy-git-and-gihub-for-the-user-tutorial/) (full tutorial with demos)
+ [Excuse me, do you have a moment to talk about version control?](https://peerj.com/preprints/3159v2/) (article)
+ [useR! 2019](https://www.youtube.com/watch?v=ZCeBnQBQ1h8) (quick tutorial with demo; see 10:44 - 14:35)
+ [Happy Git with R, 2021](https://happygitwithr.com/) (full textbook)
<br>
--
Why? Because these materials are _fantastic_. Don't re-invent the wheel.
---
class: middle, center
# I know the basics of git, and that is about it!
---
class: inverse, middle, center
# .larger[Tell me<br>about you]
---
<iframe src="https://app.sli.do/event/hvo96l22" height="90%" width="100%" frameBorder="0" style="min-height: 560px;" title="Happier version control with Git and GitHub"></iframe>
---
<iframe src="https://app.sli.do/event/2l0benjw" height="90%" width="100%" frameBorder="0" style="min-height: 560px;" title="Happier version control with Git and GitHub"></iframe>
---
class: inverse, center, middle
# .larger[GIT]
---
background-image: url(img/git_book.png)
background-size: contain
background-position: 50% 65%
# Happy Git with R by Jenny Bryan
---
class: inverse, center, middle
# .larger[What is Git]
---
class: middle
# Git is a .blue[version control system]
- It is an application that runs on your computer, just like Microsoft Word or Google Chrome.
- Its original purpose was to help groups of developers work collaboratively on big software projects.
---
class: inverse, center, middle
# .larger[What does<br/>Git do]
---
class: middle
# Git manages the evolution of a set of files (.blue[repository])
Imagine “Track Changes” from Microsoft Word on a whole directory instead of just one file.
---
class: inverse, center, middle
# .larger[Who made Git?]
---
background-image: url(img/Linus_Torvalds_1.jpg)
---
class: inverse, center, middle
# .larger[Git for<br/>data science]
---
class: left, middle
# Git (with the help of GitHub) has been repurposed for activities other than software development, such as
# [writing books](https://github.com/hadley/r4ds)
# [managing personal websites](https://github.com/rbind/apreshill)
# [writing scientific articles](https://github.com/bcjaeger/ACC-AHA-BP-guideline-groups)
---
class: inverse, center, middle
# .larger[Git for<br/>beginners]
---
background-image: url(img/Linus_Torvalds_2.jpg)
background-size: 100%
class: left, middle, inverse
# .larger[is<br>unfriendly]
---
background-image: url(img/git_terminal.png)
background-size: 100%
---
class: center, middle, inverse
# .larger[JARGON]
---
class: center, middle
# Wait, should I even use this?
---
class: inverse, center, middle
# .larger[Yes<br>I'll give you 5 reasons why]
---
class: inverse, center, middle
# .larger[Git lets you tell the story of your project]
---
class: middle
# Git takes snapshots of all the files in a folder
# This folder is called a .blue[repository] or .blue[repo]
---
class: middle
# When you want to take a snapshot of a file or files, you create a .blue[commit].
---
background-image: url(img/file_management_1.png)
background-size: 100%
---
background-image: url(img/file_management_2.png)
background-size: 100%
---
background-image: url(img/file_management_3.png)
background-size: 100%
---
background-image: url(img/file_management_4.png)
background-size: 100%
---
background-image: url(img/file_management_5.png)
background-size: 100%
---
background-image: url(img/file_management_6.png)
background-size: 100%
---
background-image: url(img/file_management_7.png)
background-size: 100%
---
class: left, middle
# When you .blue[commit] a file or set of files,<br>Git will save some information automatically.
---
class: left, middle
# 1. Who
# 2. When
---
class: center, middle
# You can add more information about the changes you made with a .blue[commit message].
---
class: left, middle
background-color: #bcdeff
.largish[__Prevent factor coercion__ <br><br>]
.largish[_Character vectors may be automatically converted to factors by some data import functions. Our data management directly changes character values in the vectors (creating `NA` factor values), so we are delaying conversion to factors until the modeling phase._]
---
# Wait, `NA` factor values?
(Even though it's a Git presentation, you should know this about R)
```r
chr <- c("A", "B", "C")
f <- factor(chr)
f[2] <- "D"
f
```
```
## [1] A <NA> C
## Levels: A B C
```
---
class: left, middle
background-color: #e8bdbd
.largish[__Prevent factor coercion__ <br><br>]
.largish[set `stringsAsFactors = FALSE`]
---
background-image: url(img/file_management_just_a_name.png)
background-size: 80%
---
background-image: url(img/file_management_8.png)
background-size: 100%
---
background-image: url(img/file_management_9.png)
background-size: 100%
---
background-image: url(img/file_management_10.png)
background-size: 100%
---
background-image: url(img/file_management_11.png)
background-size: 100%
---
class: left, middle
# .blue[Repository] - your project folder
# .blue[Commit] - save a snapshot
---
class: inverse, center, middle
# .larger[Git lets you time travel]
---
class: left, middle
# Once you've saved some snapshots of your repository, git lets you travel through them
---
background-image: url(img/file_management_12.png)
background-size: 90%
# Git stores the whole history of your project
---
background-image: url(img/file_management_13.png)
background-size: 90%
# Each of these commits has an identifier called a .blue[hash]
---
class: left, middle
# Getting the files from a commit in the past is known as doing a .blue[check out]
---
background-image: url(img/file_management_14.png)
background-size: 90%
# I can tell Git what commit I want to check out using the commit hash.
---
background-image: url(img/file_management_15.png)
background-size: 90%
# I can tell Git what commit I want to check out using the commit hash.
---
background-image: url(img/file_management_15.png)
background-size: 90%
# My other commits still exist, but when I look in my repo, it's like they never happened
---
class: left, middle
# .blue[hash] - a computer generated id
# .blue[check out] - time travel to a specific commit
---
class: inverse, center, middle
# .larger[Git lets you experiment]
---
class: left, middle
# So far, everything has been linear and neat.
---
class: left, middle
# This isn't really how projects develop.
# Sometimes you want to experiment.
# Sometimes your experiments don't work.
---
class: left, middle
# In Git, you can create easily discardable experiments with .blue[branches]
---
class: left, middle
# A .blue[branch] is a moveable label attached to a single commit
---
background-image: url(img/file_management_16.png)
background-size: 100%
# The default branch name in git is .blue[master (or main)]
---
background-image: url(img/file_management_17.png)
background-size: 100%
# You can add your own branches too
---
background-image: url(img/file_management_18.png)
background-size: 100%
# A user will often do a lot of work on a branch
---
background-image: url(img/file_management_19.png)
background-position: 50% 60%
background-size: 100%
---
class: left, middle
# Branches are useful for trying things out.
# They are easy to throw away if you don't like the changes.
---
class: left, middle
# Once projects are up and running, most development is done in branches.
# The main branch is the 'live' version.
---
class: left, middle
# When you are happy with the changes you made in a branch, you need a way to get those changes back into the main branch.
---
background-image: url(img/file_management_20.png)
background-position: 50% 70%
background-size: 100%
# To get changes from one branch into another, you .blue[merge] them.
---
background-image: url(img/file_management_21.png)
background-position: 50% 70%
background-size: 100%
# So, this commit combines all the commits from both branches.
---
background-image: url(img/merge.gif)
background-size: 90%
---
class: left, middle
# .blue[branch] - a moveable label that points to a commit
# .blue[merge] - the combination of commits from two or more branches
---
class: inverse, center, middle
# .larger[Git helps you back up your work]
---
class: left, middle
# Everyone knows you should back up your work regularly.
---
class: left, middle
# Ideally, to somewhere that is not the same place as your computer.
---
background-image: url(img/file_management_22.png)
background-size: 100%
---
class: left, middle
# Safer
# Access from different places
# Shared
---
class: left, middle
# In Git this place is called a .blue[remote]
---
background-image: url(img/github_logo.png)
background-size: cover
---
class: left, middle
# To get some work from a repository stored in a remote for the first time, the first thing you do is .blue[clone] the repository.
---
background-image: url(img/file_management_23.png)
background-size: 100%
---
background-image: url(img/file_management_24.png)
background-size: 100%
---
background-image: url(img/file_management_25.png)
background-size: 100%
---
class: middle, right
background-image: url(img/file_management_26.png)
background-size: 100%
# Now everyone<br>has the repo on<br>their computer
---
class: middle, right
background-image: url(img/file_management_27.png)
background-size: 100%
---
class: middle, right
background-image: url(img/file_management_28.png)
background-size: 100%
# Ligong can send<br>his changes to<br>the remote
---
class: middle, right
background-image: url(img/file_management_28.png)
background-size: 100%
# this is known<br>as a .blue[push]
---
class: bottom, right
background-image: url(img/file_management_29.png)
background-size: 100%
---
class: bottom, right
background-image: url(img/file_management_32.png)
background-size: 100%
# Now Shakia's<br>repo is behind<br>the remote.
---
class: bottom, right
background-image: url(img/file_management_32.png)
background-size: 100%
# To get these<br>changes, Shakia<br>can .blue[pull] them
---
class: bottom, right
background-image: url(img/file_management_33.png)
background-size: 100%
---
class: left, middle
# .blue[clone] - copy a repository from a remote location to your local computer.
# .blue[push] - send your local commit(s) to your remote
# .blue[pull] - copy the most recent version of the remote to your local computer (merge conflicts can happen).
---
class: inverse, center, middle
# .larger[Git helps you collaborate]
---
class: left, middle
# When you clone a repository, you attempt to push and pull commits to the remote
# What could go wrong?
---
background-image: url(img/too_many_cooks.png)
background-size: cover
---
class: left, middle
# Instead of cloning someone else's repo, you can .blue[fork] the repo.
---
class: left, middle
# When you .blue[fork] a repo, you create a copy of it on your GitHub account. (this is not a clone)
# Now you have a remote you can clone and commit changes to.
# This positions you to request that the repo owner to merge a branch of your forked repo into their main branch, i.e., a .blue[pull request].
---
background-image: url(img/fork-and-clone_1.png)
background-size: 100%
---
background-image: url(img/fork-and-clone_2.png)
background-size: 100%
---
background-image: url(img/fork-and-clone_3.png)
background-size: 100%
---
background-image: url(img/file_management_34.png)
background-size: 100%
---
background-image: url(img/file_management_36.png)
background-size: 100%
---
background-image: url(img/file_management_37.png)
background-size: 100%
---
background-image: url(img/file_management_38.png)
background-size: 100%
---
background-image: url(img/file_management_40.png)
background-size: 100%
---
background-image: url(img/file_management_41.png)
background-size: 100%
---
background-image: url(img/file_management_42.png)
background-size: 100%
---
background-image: url(img/file_management_43.png)
background-size: 100%
---
class: inverse, middle, center
# .larger[Git is a lot. Where should<br>I start?]
---
background-image: url(img/github_account_1.png)
background-position: 50% 70%
background-size: 80%
# Go to [https://github.com/](https://github.com/) and click "Sign up"
---
background-image: url(img/github_account_2.png)
background-size: cover
---
layout: true
background-size: 85%
background-position: 40% 50%
---
class: inverse, center, middle
# .larger[Make a pull request]
---
background-image: url(img/github_account_3.png)
# Go to [my GitHub](https://github.com/bcjaeger)
---
background-image: url(img/github_account_4.png)
# Click 'Repositories' near the top of the page
---
background-image: url(img/github_account_5.png)
# Search 'seminar-git' (maybe already at top)
---
background-image: url(img/github_account_6.png)
# Click on the 'seminar-git' repository
---
background-image: url(img/github_account_7.png)
# Click on index.Rmd (don't click index.html)
---
background-image: url(img/github_account_8.png)
# Click the pencil to .blue[fork] the repo
---
background-image: url(img/github_account_9.png)
# If you see this, you are in the right place!
---
class: left, middle
# If you don't have that screen, don't worry. Clicking the pencil has forked the repo and created a new branch. Check your profile page.
---
background-image: url(img/github_account_10.png)
# Scroll down to about here.
---
background-image: url(img/github_account_11.png)
# Add your own adjectives or exclamations
---
background-image: url(img/github_account_12.png)
# Document, then click propose changes
---
background-image: url(img/github_account_13.png)
# Review, then click 'create pull request'
---
layout: false
class: center, middle
# .larger[Yes!]
# You completed your first pull request!
# .rainbow-text[Great work!]
---
class: inverse, middle, center
# .larger[Make a repo on GitHub]
---
background-image: url(img/github_account_14.png)
background-size: 90%
# click 'Repositories' on your profile page
---
background-image: url(img/github_account_15.png)
background-size: 90%
# click 'new'
---
background-image: url(img/github_account_16.png)
background-size: 70%
# Name your repo
---
background-image: url(img/github_account_17.png)
background-size: 70%
# Give it a description
---
background-image: url(img/github_account_18.png)
background-size: 70%
# Make it public or private
---
background-image: url(img/github_account_19.png)
background-size: 70%
# Initialize with a README file
---
background-image: url(img/github_account_20.png)
background-size: 70%
# Click 'Create repository'
---
background-image: url(img/github_account_21.png)
background-size: 90%
# You did it!
---
# Jargon
.blue[repository (repo)] - your project folder
.blue[commit] - a snapshot of your repository
.blue[hash] - an id for your commit
.blue[checkout] - time travel to a specific commit
.blue[branch] - a movable label that points to a commit
.blue[merge] - combining two branches
.blue[remote] - a computer with the repository on it
.blue[clone] - get the repository from the remote for the first time
.blue[push] - send commits to a remote
.blue[pull] - get commits from a remote
.blue[fork] - copy a remote to your GitHub profile.
---
class: inverse, middle, center
# .larger[Git and Rstudio]
---
background-image: url(img/usethis_logo.png)
---
background-image: url(img/usethis_logo.png)
background-size: 30%
background-position: 47.5% 13%
# .larger[Demo]
# Create a project that uses Git and GitHub
# Create a project from GitHub (fork and clone)
# Initiate pull requests!
---
# .larger[Create]
# `create_project()`
# `use_git()`
# `use_github()`
---
# .larger[Fork & clone]
# `create_from_github()`
# `pr_init()`
# `pr_finish()`
---
<iframe src="https://app.sli.do/event/g4eliw1h" height="90%" width="100%" frameBorder="0" style="min-height: 560px;" title="Happier version control with Git and GitHub"></iframe>
---
class: center, middle
# .larger[Thank you!]
</textarea>
<style data-target="print-only">@media screen {.remark-slide-container{display:block;}.remark-slide-scaler{box-shadow:none;}}</style>
<script src="https://remarkjs.com/downloads/remark-latest.min.js"></script>
<script>var slideshow = remark.create({
"highlightStyle": "github",
"highlightLines": true,
"countIncrementalSlides": false
});
if (window.HTMLWidgets) slideshow.on('afterShowSlide', function (slide) {
window.dispatchEvent(new Event('resize'));
});
(function(d) {
var s = d.createElement("style"), r = d.querySelector(".remark-slide-scaler");
if (!r) return;
s.type = "text/css"; s.innerHTML = "@page {size: " + r.style.width + " " + r.style.height +"; }";
d.head.appendChild(s);
})(document);
(function(d) {
var el = d.getElementsByClassName("remark-slides-area");
if (!el) return;
var slide, slides = slideshow.getSlides(), els = el[0].children;
for (var i = 1; i < slides.length; i++) {
slide = slides[i];
if (slide.properties.continued === "true" || slide.properties.count === "false") {
els[i - 1].className += ' has-continuation';
}
}
var s = d.createElement("style");
s.type = "text/css"; s.innerHTML = "@media print { .has-continuation { display: none; } }";
d.head.appendChild(s);
})(document);
// delete the temporary CSS (for displaying all slides initially) when the user
// starts to view slides
(function() {
var deleted = false;
slideshow.on('beforeShowSlide', function(slide) {
if (deleted) return;
var sheets = document.styleSheets, node;
for (var i = 0; i < sheets.length; i++) {
node = sheets[i].ownerNode;
if (node.dataset["target"] !== "print-only") continue;
node.parentNode.removeChild(node);
}
deleted = true;
});
})();
(function() {
"use strict"
// Replace <script> tags in slides area to make them executable
var scripts = document.querySelectorAll(
'.remark-slides-area .remark-slide-container script'
);
if (!scripts.length) return;
for (var i = 0; i < scripts.length; i++) {
var s = document.createElement('script');
var code = document.createTextNode(scripts[i].textContent);
s.appendChild(code);
var scriptAttrs = scripts[i].attributes;
for (var j = 0; j < scriptAttrs.length; j++) {
s.setAttribute(scriptAttrs[j].name, scriptAttrs[j].value);
}
scripts[i].parentElement.replaceChild(s, scripts[i]);
}
})();
(function() {
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) {
links[i].target = '_blank';
}
}
})();
// adds .remark-code-has-line-highlighted class to <pre> parent elements
// of code chunks containing highlighted lines with class .remark-code-line-highlighted
(function(d) {
const hlines = d.querySelectorAll('.remark-code-line-highlighted');
const preParents = [];
const findPreParent = function(line, p = 0) {
if (p > 1) return null; // traverse up no further than grandparent
const el = line.parentElement;
return el.tagName === "PRE" ? el : findPreParent(el, ++p);
};
for (let line of hlines) {
let pre = findPreParent(line);
if (pre && !preParents.includes(pre)) preParents.push(pre);
}
preParents.forEach(p => p.classList.add("remark-code-has-line-highlighted"));
})(document);</script>
<script>
slideshow._releaseMath = function(el) {
var i, text, code, codes = el.getElementsByTagName('code');
for (i = 0; i < codes.length;) {
code = codes[i];
if (code.parentNode.tagName !== 'PRE' && code.childElementCount === 0) {
text = code.textContent;
if (/^\\\((.|\s)+\\\)$/.test(text) || /^\\\[(.|\s)+\\\]$/.test(text) ||
/^\$\$(.|\s)+\$\$$/.test(text) ||
/^\\begin\{([^}]+)\}(.|\s)+\\end\{[^}]+\}$/.test(text)) {
code.outerHTML = code.innerHTML; // remove <code></code>
continue;
}
}
i++;
}
};
slideshow._releaseMath(document);
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement('script');
script.type = 'text/javascript';