Week 12 NFL picks, predictions
Here are our NFL picks and predictions for Week 12 of the 2019 season.
by @taddhaislopBased on the point spreads attached to each game, Week 12 doesn't present many particularly difficult picks. Of course, based on the laws of weekly NFL predictions, that probably means we're in for a rough week of game picks.
This isn't to say Week 12 is void of its share of toss-up games. The Texans, Titans and 49ers opened as three-point home favorites over the Colts, Jaguars and Packers, respectively, making them toss-ups in the eyes of Vegas. The Eagles also opened as two-point home favorites over the Seahawks.
To balance out those close spreads, the Browns and Saints opened as double-digit favorites over the Dolphins and Panthers, respectively. We also feel pretty good about the Steelers and Ravens as road favorites.
Here are our Week 12 NFL picks straight up, all the way through the Monday night game in Los Angeles.
MORE NFL WEEK 12: Updated playoff picture | Power rankings
Indianapolis Colts at Houston Texans
(Texans -3)
Thursday, 8:20 p.m. ET, Fox, NFL Network, Amazon Prime Video
When an NFL team as good as the Texans gets embarrassed, that team typically bounces back with an inspired performance. So what Baltimore did to Houston last week could be bad news for Indianapolis this week. The return of Jacoby Brissett to the Colts' lineup and the ensuing win over the Jaguars was spoiled by the loss of Marlon Mack to a broken hand. The running back likely would have given Houston some trouble. Instead, with the Texans now being the better rushing team, it's up to Brissett to outplay Deshaun Watson. And the Colts QB ain't Lamar Jackson.
Pick: Texans 27, Colts 21
Miami Dolphins at Cleveland Browns
(Browns -10)
Sunday, 1 p.m. ET, Fox
Game 1 of Cleveland's Myles Garrett suspension era should be no trouble. Still at home off the mini-bye that followed the fiasco against the Steelers, the Browns are in position to draw closer to .500 and beat up on a team — figuratively this time, not literally — they should beat. Now aided by an enhanced running game with Kareem Hunt, Baker Mayfield will build his chemistry with Odell Beckham Jr. and Jarvis Landry against the NFL's second-worst scoring defense.
Pick: Browns 30, Dolphins 17
Denver Broncos at Buffalo Bills
(Bills -4 1/2)
Sunday, 1 p.m. ET, CBS
Statistically, these teams are mirror images of each other. The Bills have an iffy offense (358.9 yards per game) and a good defense (323 yards allowed per game); the Broncos also have an iffy offense (342.4 yards per game) and a good defense (323.7 yards allowed per game). Yet Buffalo is 7-3 and Denver is 3-7, illustrating the key differences between these teams. Yes, the Bills have played a much easier schedule, but they also have better coaching and the better quarterback. The carrot in front of them that is the AFC playoffs doesn't hurt.
Pick: Bills 17, Broncos 13
Pittsburgh Steelers at Cincinnati Bengals
(Steelers -7)
Sunday, 1 p.m. ET, CBS
This could be labeled a trap game of sorts for the Steelers — a divisional matchup against a feisty Bengals team scheduled a week before what will be an emotional rematch against the Browns. The good news for Pittsburgh is Mike Tomlin will make sure his team is focused in Cincinnati.
Pick: Steelers 21, Bengals 14
New York Giants at Chicago Bears
(Bears -6 1/2)
Sunday, 1 p.m. ET, Fox
The likely harmless noise around Bears coach Matt Nagy's job security would rise to a crescendo should Chicago lose this home game to New York. And it's entirely possible. The Giants, despite having lost six straight games, are coming off their bye week, and their defensive weakness won't be as big of an issue against the NFL's third worst offense in terms of yards per game. Of course, on the other side of the ball, the Bears still boast a top-five scoring defense. That unit will cause rookie Daniel Jones and Co. enough trouble, and Nagy's offense will manage just enough points.
Pick: Bears 20, Giants 17
Oakland Raiders at New York Jets
(Raiders -3)
Sunday, 1 p.m. ET, CBS
Yes, the Jets' offense has come alive over the last two weeks against the struggling defenses of the Giants and Redskins. But the Raiders' defense isn't exactly daunting. Oakland's three consecutive wins over the last three weeks came in one-score games, all at home. Back on the road and playing in the eastern time zone early Sunday afternoon, the Raiders won't be as fortunate. Sam Darnold will continue his hot streak.
Pick: Jets 27, Raiders 24
Carolina Panthers at New Orleans Saints
(Saints -10)
Sunday, 1 p.m. ET, CBS
This feels like the Panthers' last chance to stay alive in the NFC playoff picture, and in that regard, it's a massive opportunity for Carolina to shake off its bad loss to Atlanta with what would be a huge upset in New Orleans. The problem for the Panthers in this matchup isn't Kyle Allen vs. the noisy Superdome and/or the Saints defense; it's that struggling run defense vs. Alvin Kamara and Latavius Murray. New Orleans, meanwhile, has a defense that's quick enough to contain Christian McCaffrey.
Pick: Saints 26, Panthers 21
Tampa Bay Buccaneers at Atlanta Falcons
(Falcons -4)
Sunday, 1 p.m. ET, Fox
A few coaching changes during their bye a few weeks ago, and the Falcons suddenly are blowing out divisional opponents left and right. Kudos to Dan Quinn's team for responding to adversity and fighting to save the coach's job. Yet the defensive issues that plagued this team in the first half of the season could resurface against the Bucs' diverse attack. Tampa Bay will have its moments, but its league-worst scoring defense will allow too many points yet again.
Pick: Falcons 35, Buccaneers 31
Detroit Lions at Washington Redskins
(Lions -3 1/2)
Sunday, 1 p.m. ET, Fox
This one's relatively simple. The Lions are bad, and the Redskins are even worse. Matthew Stafford may or may not return from his back injury for this game, but the QB's availability might not matter for the Lions. Even for Detroit's terrible defense, Washington and its league-worst scoring offense poses no threat.
Pick: Lions 24, Redskins 14
Seattle Seahawks at Philadelphia Eagles
(Eagles -2)
Sunday, 1 p.m. ET, Fox
The Seahawks are healthy and coming off a bye. The Eagles are neither healthy nor coming off a bye. The Seahawks have an MVP candidate at quarterback. The Eagles, though Carson Wentz remains legit, do not. Despite Seattle's advantages, this feels like a game it will lose. Part of the reason is the long road trip and an early Sunday afternoon kickoff time on the east coast. Also, Philadelphia still has a top-10 defense. The Eagles opened as two-point home favorites, so this is an upset that technically isn't an upset.
Pick: Eagles 28, Seahawks 20
Jacksonville Jaguars at Tennessee Titans
(Titans -3)
Sunday, 4:05 p.m. ET p.m. ET, CBS
Here is the AFC South toss-up game of the week, barely edging Colts vs. Texans for the honor. Good luck guessing what you'll get from either Jacksonville or Tennessee. We feel a little better about the Titans since they're the better team statistically and the Jags are transitioning back to Nick Foles at QB. Yet the Titans are the most frustrating team in the NFL to pick, so we'll avoid the stress.
Pick: Jaguars 24, Titans 21
Dallas Cowboys at New England Patriots
(Patriots -5 1/2)
Sunday, 4:25 p.m. ET, Fox
America's most popular team against the defending champs? Yes, please. Fox's game of the week is as good as it gets even though the Patriots are relatively heavy home favorites. New England's defense deserves the praise it's getting, but Dallas has the most diverse offense it will have seen all season. (Yes, that includes Baltimore.) The Cowboys don't have a singular offensive strength for the Pats to take away; rather, they have a handful of weapons ready to take advantage when presented favorable matchups.
Pick: Cowboys 27, Patriots 23
Green Bay Packers at San Francisco 49ers
(49ers -3)
Sunday, 8:20 p.m. ET, NBC
This is a big one for the NFC playoff picture. Should the 49ers lose to the Packers and give up the inside track to the No. 1 seed, they would be in trouble given their tough schedule over the next few weeks. San Francisco, which up to this point has taken advantage of a relatively light schedule, looks better than Green Bay statistically, but Aaron Rodgers and Co. are coming off a bye completely healthy. The 49ers' pass rush will make it challenging, but Rodgers will outplay Jimmy Garoppolo on the national stage.
Pick: Packers 24, 49ers 20
Baltimore Ravens at Los Angeles Rams
(Ravens -3 1/2)
Monday, 8:15 p.m. ET, ESPN
The Rams have put together four consecutive strong defensive performances, but it's hard to imagine their slowing down the rushing and scoring freight train that is Lamar Jackson and the Ravens. On the road but in a favorable, prime-time slot, expect the NFL's hottest team to keep rolling.
Pick: Ravens 28, Rams 23


Current Balance
$
0
Future Balance
$
0
$
.00
Add Funds
Subtract Funds
Date
Transaction
Amount
Cleared


[[${artist.name}]]
History:
[[{$artist.history}]]
Education: [[${artist.education}]]
Lives in: [[${artist.livesIn}]]
Email: [[${artist.email}]]
Artworks
by [[${artist.name}]]
Edit
Delete


My Posts
Click on a user to see posts of that user
{{comment.name}} {{comment.body}} {{comment.email}}


There is synergy of energy, commitment, and
excitement that participants bring to a Mastermind Group.
The beauty of Mastermind Groups is
that participants raise the bar
by challenging each other to create and
implement goals, brainstorm ideas, and
support each other with total honesty,
respect and compassion.
I like to form groups around a specific activity, but even
with differing goals you’ll be able to lean on each other for support. Many
times when my progress has slowed on a specific goal, the members of my
mastermind are the only people who really understand what has been going on
behind the scenes, and give me support in spite of my failed efforts.
Hearing the different views my fellow mastermind
participants have allows me to see issues I wouldn’t otherwise become aware of
– in my life, and in my approach to my goals. Whether I agree with their
assessment or not, it always gives me a better
understanding of how I can better improve my approach.
Everyone in your group will have access to a different skillset
and network of people. I’ve often found that when I ask for help in my
mastermind groups, these resources help me make progress
in ways I never could by myself.
My fellow group members hold me accountable to goals I set. In addition,
just knowing that I have a regularly scheduled meeting
internally drives me to make progress – because I don’t want to be the only person
reporting back that I haven’t made an effort to move my projects forward.


{% extends "_layout/layout.html" %} {# 菜单导航 #} {% import "_components/navigator.html" as navigator %} {# 新菜单导航（用信用支付那些管理后台的页头） #} {% import "_components/navigator_new.html" as navigatorNew %} {# 提示 #} {% import "_components/alert.html" as Alert %} {# 步骤 #} {% import "_components/step.html" as Step %} {# 表单 #} {% import "_components/form.html" as Form %} {# 过滤 #} {% import "_components/filter.html" as Filter %} {# 下载 #} {% import "_components/download.html" as download %} {# 分页 #} {% import "_components/pagination.html" as Pager %} {# 提示 #} {% import "_components/notice.html" as Notice %} {# 我的银行 #} {% import "_components/myBanks.html" as MyBanks %} {# 弹框 #} {% import "_components/modal.html" as Modal %} {# 双色球 #} {% import "_components/amountRemind.html" as Amount %} {# 标签页 #} {% import "_components/tabs.html" as tabs %} {# 通用布局 #} {% block body %}


{% extends 'base.html' %} {% load static %} {% block title %}LOFOO(Local Food){% endblock %} {% block extra-style %} {% endblock %} {% block content %}
This application is sales bulletin board for local food.between customers and customers. The sales is B2C or C2C or B2B, everything is possible. But the important point is that the merchandises in that application is based on the user's location. You can sell your merchandises and buy merchandises by Sell application. It's also possible to update or delete your merchandises.


interface OperationLoader<T> : ComponentLoader<List<Operation<T>>>
Loads a collection of Operations in some way defined by the implementer.
T
- Type that the operations perform their function on.
abstract fun load(): TComponent
Loads a component. |
class DefaultOperationLoader<T> : OperationLoader<T>
A simple operation loader implementation that simply loads a set of operations specified by the name of the package + class it can be found in. |


Word Embeddings in Natural Language Processing
Contents
- 1. Frequency based Embedding
- a. Count Vector
- b. TfIdf Vector
- 2. Prediction Based Vector
- a. CBOW (Continuous Bag of Words)
- b. Skip Gram
In NLP application we have to work with texual data. Well we can't directly feed our textual data for training into our ML models, Deep Learning Models etc. Let it be regression, classification or any NLP task, we need to convert our textual data into numerical form that can be feeded into models for futher processing.
Word Embedding converts textual data into numerical data of some form. In general, word embedding convert a word into some sort of vector representation.
Now, we will broadly classify word embedding in 2 types and then dive deep into their types
{'basic': 0,'beauty': 1,'embedding': 2,'into': 3,'is': 4,'look': 5,'most': 6,'of': 7,'take': 8,'the': 9,'vectorizer': 10,'word': 11}
vectorizer = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
| basic | beauty | embedding | into | is | look | most | of | take | the | vectorizer | word | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| d1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 2 | 0 | 1 |
| d1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 2 | 1 | 2 |
>>> from sklearn.feature_extraction.text import CountVectorizer
>>> text = ["Take a look into the beauty of the word embedding.","The word vectorizer is the most basic word embedding"]
>>> cv = CountVectorizer()
>>> cv.fit(text)
>>> text_vector = cv.transform(text)
>>> text_vector.toarray()
array([[0, 1, 1, 1, 0, 1, 0, 1, 1, 2, 0, 1],
[1, 0, 1, 0, 1, 0, 1, 0, 0, 2, 1, 2]])
>>> cv.vocabulary_
{'basic': 0,
'beauty': 1,
'embedding': 2,
'into': 3,
'is': 4,
'look': 5,
'most': 6,
'of': 7,
'take': 8,
'the': 9,
'vectorizer': 10,
'word': 11}
TF = ( Freq of word in a document ) / ( No of words in that documents )
TF(take,d1) = 1/10 = 0.1
TF(the,d2) = 1/9 = 0.11
IDF = log( No of docs / No of docs term t has appeared ) #without smoothing
where
IDF(the) = log(2/2) = 1
IDF(take) = log(2/1) = 0.6931
TF-IDF(take,d1) = tf*idf = 0.1*0.6931 = 0.0693
>>> from sklearn.feature_extraction.text import CountVectorizer
>>> text = ["Take a look into the beauty of the word embedding.","The word vectorizer is the most basic word embedding"]
>>> cv = CountVectorizer()
>>> cv.fit(text)
>>> text_vector = cv.transform(text)
>>> text_vector.toarray() array([[0, 1, 1, 1, 0, 1, 0, 1, 1, 2, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 0, 2, 1, 2]])
>>> cv.vocabulary_ {'basic': 0, 'beauty': 1, 'embedding': 2, 'into': 3, 'is': 4, 'look': 5, 'most': 6, 'of': 7, 'take': 8, 'the': 9, 'vectorizer': 10, 'word': 11}
Lets look at an example to build word vectors by using Gensim Library.
import gensim.models.word2vec as w2v
import numpy as np
sentence_tokens = np.array([["This","is","a","game","of","thrones","books","corpus"],
["You","can","select","any","corpus"],
["You","must","convert","corpus","in","this","form"]])
embedding_size = 300 #size of embedding
min_word_count = 3 #word must appear atleast 3 times
num_workers = multiprocessing.cpu_count() #using multiple processors
context_size=7 #looking at 7 words at a time
downsampling = 1e-3 #Downsample setting for frequent words
thrones2vec = w2v.Word2Vec(
sg=1, #1 skip-gram 0- CBOW
seed=seed,
workers= num_workers,
size = num_features,
min_count = min_word_count,
window = context_size,
sample = downsampling
)
thrones2vec.build_vocab(sentence_tokens)
#start training, this might take time
thrones2vec.train(sentence_tokens,
total_examples=len(sentence_tokens),
epochs=25
)
thrones2vec.save("thrones2vec.w2v") #to save word2vec model
thrones2vec = w2v.Word2Vec.load("thrones2vec.w2v") #to load word2vec model
Lets look at some applications of word2vec.
>>> thrones2vec.wv.vectors #gives V*N dimensional matrix
>>> thrones2vec.wv.vocab #gives list of words of size V
>>> thrones2vec.wv.most_similar("stark")
[('eddard', 0.6009404063224792),
('snowbeard', 0.4654235243797302),
('accommodating', 0.46405118703842163),
('divulge', 0.4528692960739136),
('edrick', 0.43332362174987793),
('interred', 0.4253771901130676),
('executed', 0.42412883043289185),
('winterfell', 0.4224868416786194),
('shirei', 0.4207403063774109),
('absently', 0.419999361038208)]
>>> #Finding the degree of similarity between two words.
>>> thrones2vec.wv.similarity('woman','man')
0.73723527
>>> #Finding odd one out.
>>> thrones2vec.wv.doesnt_match('breakfast cereal dinner lunch';.split())
'cereal'
>>> #Amazing things like woman+king-man =queen
>>> thrones2vec.wv.most_similar(positive=['woman','king'],negative=['man'],topn=1)
queen: 0.508
>>> #Probability of a text under the model
>>> thrones2vec.wv.score(['The fox jumped over the lazy dog'.split()])
0.21
>>> def nearest_similarity_cosmul(start1, end1, end2):
.........similarities = thrones2vec.wv.most_similar_cosmul(
.........positive=[end2, start1],
.........negative=[end1])
.........start2 = similarities[0][0]
.........print("{start1} is related to {end1}, as {start2} is related to {end2}".format(**locals()))
>>> nearest_similarity_cosmul("stark", "winterfell", "riverrun")
'stark is related to winterfell, as tully is related to riverrun'
>>> nearest_similarity_cosmul("arya", "nymeria", "drogon")
'arya is related to nymeria, as dany is related to drogon'


There are no available Habitat artifacts (.hart files) for this origin/package.
There are two ways to add .hart files:
Don't have a plan file? Try the demo app.


Bomb
One of the most common enemies in the series.  Its attack strategy remains relatively unchanged from game to game: each time it is hit, it increases in size and strength up to three times, and after the third, it self-destructs and delivers massive damage to one member of the party. The Bomb appears as a summon in FF4, if you pick up the "Bomb" item it leaves behind, and uses a fire-elemental attack similar to his self-destruct. Grenade is a souped-up version of the Bomb; in FF9 it had its own suit of armor!
Expand Images
|
|
FF2 -Balloon -Bomb -Grenade -Mine |
|
|
FF3 -Balloon -Bomb -Grenade |
|
|
FF4 (ENEMY & SUMMON) -Balloon -Bomb -Gray Bomb -Grenade -Mom Bomb (boss) |
|
|
FF5 -Bomb -Byurobolos (NA) / Pyrobolus (JP) -Grenade |
|
|
FF6 -Balloon -Bomb -Grenade |
|
|
FF7 -Bomb -Grenade |
|
|
FF7CC -Trap -Bomb -Remedy Bomb -Touchy Bomb -Gray Bomb -Steam Engine -Grenade -Balloon -Mine -Detonator -S Mine -Volcano -Destroyer -Experiment No. 120 -Explosive |
|
|
FF8 -Bomb |
|
|
FF9 -Bomb -Grenade |
|
|
FF10 -Bomb -Bomb King -Grenade -Puroboros (NA) / Pyrobolus (JP) FFX-2 -Bomb -Detonater -Volcano |
|
|
FF11 -Bomb (many varieties) |
|
|
FF12 -Bomb -Balloon -Grenade -Purobulos -Mom Bomb -King Bomb (boss) -Pineapple (rare) -Bombshell (rare) -Megabomb (rare) -Matriarch Bomb (rare)
CP: An ensorceled weapon for use against mages in days past, left to grow wild. Known to react swiftly to the presence of magick, the action of which triggering the explosive energies contained within. Notwithstanding, the release of said energy leads to an explosion of a physical nature, making it greatly effective against targets who rely upon magickal protection. Many are the mages who hesitate to work magicks around bombs and their ilk. |
|
|
FF12RW -Bomb (Esper) ATK: Self-Destruct Also in this game: Mom Bomb and King Bomb (boss). |
|
|
Tactics -Bomb -Explosive (NA) / Explosure (JP) -Grenade |
|
|
Tactics Advance -Bomb -Grenade |
|
|
Tactics A2 -Bomb -Grenade |
|
|
Crystal Chronicles -Bomb -Ice Bomb -Thunder Bomb |
Final Fantasy, all games and animation bearing the Final Fantasy name, and all characters in said games or animation are copyright their respective creators, including but not limited to Squaresoft, Square Enix, Square EA, Tokyo TV, and ADV Films.


Skills
Skills measure a character's knowledge and ability.
The point cost of a skill is based on the level. The higher the skill, the more difficult it is to improve.
| Level | Cost |
|---|---|
| 0 | 0 |
| 1 | 3 |
| 2 | 4 |
| 3 | 5 |
| 4 | 6 |
| 5 | 8 |
| 6 | 10 |
| 7 | 12 |
| 8 | 16 |
| 9 | 20 |
| Level | Cost |
|---|---|
| 10 | 25 |
| 11 | 30 |
| 12 | 40 |
| 13 | 50 |
| 14 | 60 |
| 15 | 80 |
| 16 | 100 |
| 17 | 120 |
| 18 | 160 |
| 19 | 200 |
| Level | Cost |
|---|---|
| 20 | 250 |
| 21 | 300 |
| 22 | 400 |
| 23 | 500 |
| 24 | 600 |
| 25 | 800 |
| 26 | 1000 |
| 27 | 1200 |
| 28 | 1600 |
| 29 | 2000 |
Thus: to give a new character an Archer level of 6 requires 10 character points. To later raise that same character's Archer to 7 will cost 2 character points (12 for level 7, minus the 10 already spent to reach level 6), requiring 200 experience points.
The formula should be apparent if one needs to go beyond 29.
Average persons have 0 levels in most traits and 3 (skilled apprentice) to 6 (journeyman) in those related to their work. Natural talents or skilled masters may have one or two traits at level 9. Levels greater than 9 represent awesome ability.
Below is a list of skills. It is not exhaustive - it focuses on adventuring skills, leaving others to the imagination of players. The Adversary should feel free to add or drop skills to make the list fit their campaign world.
Master craftsmen can create works of great beauty and utility. The Adversary may rule that a character must specialize in a particular field (such as blacksmithing, woodworking, etc) in order to realize this level of quality. Specialization trades breadth for depth.
Most characters can run 10 spaces per action. Each level of this skill gives the character an additional space. It also allows one to swim faster than others, though the rate is halved.
Athlete is rolled to determine the progress of a race or chase, with each point of mox being one space of distance gained or lost.
Athletes may attempt to climb anything, from trees to cliffs to castle walls. The more difficult the surface (the less friction and handholds), the higher the challenge level. Ropes and grapples help. A failed roll usually means no progress, but a spectacular failure could mean a fall.
Leaping over obstacles or chasms requires a roll against a challenge level set by The Adversary.
Athletes can perform flips, cartwheels, rolls, and tumbles. A high level may let one swing on trapezes, walk tightropes, or lessen the damage taken from a fall.
This trait also represents muscle speed and reflexes. An adventurer's Dodge is based on Athlete.
This profession also grants the possessor knowledge of useful plants and herbs that can be made into salves to speed healing, prevent infections, fight off diseases, or cure poisons.
Finally, a talented healer can perform primitive surgery such as lancing boils or amputating limbs.
This skill lets a character discover and follow tracks. Some creatures are easier to track than others. Different types of terrain increase or lessen the challenge. Some, like rivers or solid rock, are impossible to track through - the only hope is to pick up the trail on the other side of the obstacle.
Rangers can train animals to perform work or tricks and can effectively handle such domesticated creatures. At higher levels, they can befriend wild animals. A master may even calm enraged beasts.
Finally, Rangers have the ability to determine location and heading by the heavens. Master navigators may even have a sixth sense about the time of day and the direction they are facing.
A rogue can pick locks, whether ordinary keyed locks or fancier combination or puzzle locks.
One can also set or disarm small traps. This can be used to protect a locked chest with a poison dart, to protect a hallway with a cocked crossbow, or to protect a door with a levered scythe - or to disarm any such protections set by others.
Rogues know how to hide things, craft disguises, forge documents, and tell bold-faced lies. They can also perform minor "magic" tricks via sleight of hand.
They can also locate black markets and information peddlers.
Master scholars and sages are highly prized by their patrons, and a visit to one can be expensive.
A sneak can follow someone through a crowd without the subject knowing. The sneak must be inconspicuous in dress and behavior - if everyone in town wears white clothing, someone will notice a black-cloaked figure following them no matter what the sneak roll.
Finally, this trait allows one to filch keys and pick pockets.


Problem solving
What was a simple problem you got blocked on?
A had been blocked today on a problem with not knowing how to tell my computer
how to use a repetitive action.
What problem solving techniques did you use?
I used the resources provided with the exercise which gave me the examples.
After this I reached out to my cohort in person and got them to point out where
I was missing important information.
How did you feel throughout the process?
I felt comfortable but nervous, not knowing why something wasn't working. I needed to
open myself up to ways of solving my problem.
What did you learn?
I learnt how to write meaningful code that could be understood well by Javascript,
this taught me the emphasis on working through a problem – rather than getting stuck
for too long analysing the situation.
Reflect on how confident you feel using the problem solving techniques and process:
Pseudocode
i had a chance to use this for the first time and I feel confident in using this again
Trying something
this has been my challenge within my bad habit of not being able to finish what i start.
I am gaining more confidence in trying something before i give up
Rubber ducky method
i tried this today for the first time as well and it was an excellent perception opener.
i will be using this with confidence next time i require
Reading error messages
this was very helpful, and i believe that using this within my practice i will only become
a better developer. i trust this and remain confident
Console.logging
as is above, my confidence as a developer continues to grow when i can incorporate useful
ways of finding solutions without over-commiting to one solution
Googling
this has been, and will always be something i do when i need to confirm what i might already know.
i've started to become more confident in searching through stackoverflow for answers
Asking your peers for help
i am comfortable with approaching my peers for support on the tasks that i am unsure about.
my goal with this is to be able communicate what exactly i would like to know and then work
through together
Asking coaches for help
i am very comfortable doing this, although i haven't had to do this since my first couple of sprints
Improving your process with reflection
this is becoming more important as i become closer to unknown processes and difficult tasks.
i want to continue to foster my own learning by giving a slice of my own progress
<


So, this is the challenge , and this is what it should look like. You can try anything on your own as well.


Frameworkless Frontend Development: Web Components
Basic custom element example
Custom element with attributes
Updating custom element attributes
Using Virtual DOM in custom elements
GitHubAvatar Component
Custom Events
TodoMVC with Web Components


---
title: "Happy Holidays"
date: "2018-12-19 00:00:00 -06:00"
categories:
- whats-blooming
layout: "post"
blog-banner: "whats-blooming-now-winter.jpg"
post-date: "December 19, 2018"
post-time: "12:00 PM"
blog-image: "2018-12-19-wbn.jpg"
published: true
---
Don't let winter fool you into thinking there is nothing to see up here at the Garden. When the temperature drops, a whole new Garden presents itself.
Come spend your holiday away from the crowds and surrounded by the stillness of nature.
Squirrels seem to be very active right now!
There are a lot of fruits still hanging on at the Garden. Check out these vibrant, red, fruit-covered trees in front of the Rose House.
This grass is as tall as it looks!
Winter is a great time to witness the true beauty of trees. These magnificent trees can be seen along the North border of the Water Pavilion.
This looks like a pleasant spot to contemplate.
Here's the view from the other side of the pond.
This grass with its mature seed heads add interest to the Garden year round!
This tree is raining red! It can be seen at the top of the Floral Walk and bordering the Herb Garden.
This shrub still puts on a unique show, even while 'asleep'!
Come and enjoy the serene and quiet of the winter Garden landscape. Don't forget the Garden will be closed for the holiday December 24-January 1.


{% extends "withnav_template.html" %} {% from "components/form.html" import form_wrapper %} {% from "govuk_frontend_jinja/components/back-link/macro.html" import govukBackLink %} {% from "components/page-footer.html" import page_footer %} {% from "components/page-header.html" import page_header %} {% from "components/branding-preview.html" import email_branding_preview %} {% block service_page_title %} Check your new branding {% endblock %} {% block backLink %} {{ govukBackLink({ "href": url_for('main.email_branding_options', service_id=current_service.id) }) }} {% endblock %} {% block maincolumn_content %} {{ page_header('Check your new branding') }}
Emails from {{ current_service.name }} will look like this.
{{ email_branding_preview('__NONE__') }}You can only use GOV.UK branding if people go to GOV.UK to access your service.
You cannot use GOV.UK branding if your organisation is independent from government.
{% call form_wrapper() %} {{ page_footer('Use this branding') }} {% endcall %} {% endblock %}


Canonical, the company behind Ubuntu, has just open-sourced a major part of its development and bug-tracking program Launchpad.


Sinatra-stocky
Second Flatiron Project, a Sinatra portfolio project that creates user account, collects stock symbols and its data. Capable of CRUD or Create Update Delete the user, portfolio and stocks.
Top Project API
Directory Tree
stocky
.
├── Gemfile
├── Gemfile.lock
├── README.md
├── Rakefile
├── app
│ ├── controllers
│ │ ├── application_controller.rb
│ │ ├── portfolio_controller.rb
│ │ ├── stock_controller.rb
│ │ └── user_controller.rb
│ ├── models
│ │ ├── portfolio.rb
│ │ ├── stock.rb
│ │ └── user.rb
│ └── views
│ ├── admin
│ │ └── allusers.erb
│ ├── failure.erb
│ ├── home.erb
│ ├── index.erb
│ ├── layout.erb
│ ├── portfolio
│ │ ├── create_portfolio.erb
│ │ ├── edit_portfolio.erb
│ │ ├── show_portfolio.erb
│ │ └── user_portfolio.erb
│ ├── stocks
│ │ ├── new_stock.erb
│ │ ├── stock.erb
│ │ ├── stock_edit.erb
│ │ └── user_stock_info.erb
│ └── users
│ ├── edit.erb
│ ├── login.erb
│ ├── profile.erb
│ └── signup.erb
├── config
│ ├── environment.rb
│ └── initializers
├── config.ru
├── db
│ ├── development.sqlite
│ ├── migrate
│ │ ├──<PHONE_NUMBER>0736_create_users.rb
│ │ ├──<PHONE_NUMBER>3559_create_portfolio.rb
│ │ └──<PHONE_NUMBER>3820_create_stocks.rb
│ ├── schema.rb
│ └── test.sqlite
├── doc
│ ├── ApplicationController.html
│ ├── Portfolio.html
│ ├── PortfolioController.html
│ ├── Stock.html
│ ├── StockController.html
│ ├── Stocks.html
│ ├── User.html
│ ├── UserController.html
│ ├── _index.html
│ ├── class_list.html
│ ├── css
│ │ ├── common.css
│ │ ├── full_list.css
│ │ └── style.css
│ ├── debug.log
│ ├── file.README.html
│ ├── file_list.html
│ ├── frames.html
│ ├── index.html
│ ├── js
│ │ ├── app.js
│ │ ├── full_list.js
│ │ └── jquery.js
│ ├── method_list.html
│ └── top-level-namespace.html
├── lib
├── public
│ ├── images
│ │ ├── corneal-small.png
│ │ ├── favicon.ico
│ │ ├── stocky_logo.jpg
│ │ └── stocky_logo.png
│ ├── javascripts
│ │ ├── Chart.bundle.js
│ │ ├── chartkick.js
│ │ └── util.js
│ └── stylesheets
│ └── main.css
├── spec
│ ├── application_controller_spec.rb
│ └── spec_helper.rb
└── spec.md
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Prerequisites
In your PC or MAC, it require Ruby to be installed (i.e. Ruby 2.6.6).
Installing Ruby on PC
To install Ruby on PC, follow this video instructions. Here's the Ruby Installer for Windows 10.
Installing Ruby on Mac or Linux
Installing ruby on Mac or Linux is quite easy than PC and here are the following YouTube steps:
Git clone the repo
I recommend using git instead of gem as this app or project is not yet publish for gem use.
To clone this repo, just click Clone or Download this repo as Zip; otherwise if you're system have a git app installed (Windows Steps - OSX Steps) do the following in your terminal or command line:
git clone https://github.com/johncban/sinatra-stocky.git
In the terminal or command prompt, change the current directory to sinatra-stocky folder.
And then execute the following command in the repo root folder to install the necessary gems:
$ bundle
API Registration for Token
In order to run the project properly, it will require you to register to the following API providers for free API token. 1. AlphaVantage API Key Registration. 2. In IEX Cloud, select the account type as Individual for free account.
Running the Project
After obtaining the API keys and Tokens, it will require to enter the API and token keys to the following controllers.
StockController
Inside the StockController or stock_controller.rb
, enter the Alpha Vantage token in line 5 then enter the IEX Cloud token to line 6.
class StockController < ApplicationController
alpha_token = "TOKEN HERE"
iex_token = "TOKEN HERE"
...
In line 80 inside StockController, it requires NewsAPI key in the following code block.
url = "https://newsapi.org/v2/everything?q=#{@company_name}&apiKey= API TOKEN HERE"
resp = Net::HTTP.get_response(URI.parse(url))
@data = JSON.parse(resp.body)
UserController
Inside UserController or user_controller.rb
, enter the AlphaVantage token in line 6.
require 'pry'
class UserController < ApplicationController
token = "TOKEN HERE"
...
The Shotgun Server
The project's server is Shotgun, the said server is Ruby Rack-based that atomate code reloading of sinatra-stocky and make the app's test faster.
After applying the API keys type shotgun
then press enter, then copy and paste the server address to the web browser. == Shotgun/WEBrick on http://<IP_ADDRESS>:9393/ [2020-04-12 04:30:46] INFO WEBrick 1.4.2 [2020-04-12 04:30:46] INFO ruby 2.6.5 (2019-10-01) [x86_64-linux] [2020-04-12 04:30:46] INFO WEBrick::HTTPServer#start: pid=2343 port=9393
Built With
Contributing
Bug reports and pull requests are welcome on GitHub at github.com/[USERNAME]/sinatra-stocky. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Newsjournal project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the of conduct[https://github.com/[USERNAME]/newsjournal/blob/master/CODE_OF_CONDUCT.md].


Free computer cloning and management
FOG rivals its paid competitors. Supporting nearly all operating systems, including Microsoft Windows, Apple OSX, and Linux based, FOG is compatible with nearly all environments.
FOG uses a web portal, allowing you to manage your network from anywhere and from any device. Schedule image deployment, software deployment, or even turn off computers from the comfort of your smartphone.
Install software, run scripts, add printers or even activate Windows straight from the web portal.
Have offices accross states, countries, or even across the world? FOG can image and manage all of them. Simply set up a FOG node in each of your building.
Need to manage computers that aren't in company offices? No problem, computers can be managed whever there is internet.
FOG is built around an active community. If you encounter a problem or just have questions post on the forums and get a response almost immediately. Not only will you have access to others who use FOG but also direct access to the development team who interact with the community daily.
Want to customize FOG to meet your enviornment? That is not only possible but encouraged, because FOG is open source you have complete control over your server. Get in touch with a developer by posting on the forums. Want a new feature but don't know how to program? Not a problem, simply post a feature request and the development team will take a look at it.
When it comes to managing computers, security is of the essence. The next stable release will include a new secuirty system that ensures server & client trust. Both the client and the server will communicate using a secure socket tunnel encrypted using RSA, AES, and certificate pinning.
I have used this at our College (Brislington Enterprise College, UK) for about 5 years on ~600 laptops and PCs, and would recommend it to anyone. I have previously used WDS, Ghost and a few others etc, and FOG wins hands down. I've never had a problem with it that wasn't fixed by a quick google search (unlike all the others). Yes it lacks the odd feature, but so do the others. this is the one to use. Keep up the good work. ~ jimchufff
Fog is a fantastic product.  We have FOG running at 2 sites, with the location patch, image replication over the internet and imaging from local servers. It has been a real timesaver. Thanks so much for developing it. ~Mark
FOG is THE solution for images and management!! From my home LAN to my school LAN of ~600!! With everything from imaging, automatic joining of the domain, printer management, and deployment of programs (snap-ins) this application is nothing short of a miracle!! Thank you so much to the FOG development team!! ~triplej057
Read more here


Intro to CSS Transitions, Transforms and Keyframes
Hannah Hudson
Introductions
- What's your name?
- Experience with CSS and/or animation?
- Anything you're hoping to learn?
Tonight's Agenda
- CSS Transitions
- CSS Transforms
- @keyframes Rule
- Create loader animation!
- Initialize it with JavaScript
How to Trigger a Change
- Hover
- Form or button focus
- Active or visited links
- JavaScript Event (ex: click, window load)
What Can We Change (Animate)?
Let's start with hover
CSS Hover Psuedo Selector
- The change happens immediately
- No control over speed, duration, timing etc.
Transition
Transition Properties
- Transition Duration
- Transition Delay
- Transition Property
- Transition Timing Function
Transition Duration
transition-duration: 1s;
This transition will take 1 second to finish
Transition Delay
transition-delay: 300ms;
This code will waut 300 miliseconds before starting
Transition Property
- The name of the property you want to transition
- Helpful when transitioning multiple properties
- Default value is "all"
Transition Timing Function
- Determines the in-between steps of the transition
- Example: Does the animation start off slow and get faster?
- Default value is "ease"
- Examples
Cubic Bezier
Its possible to define our own transition timing functions with Cubic Bezier
Transition Shorthand
property, duration, timing-function, delay
transition: color, 2s, ease-in-out , 1s
The only 'mandatory' property is transition-duration!
Transforms
- Allow us to change an element
- Can be triggered (hovered) but not a requirement
Rotate
transform: rotate(45deg);
- Takes a positive or negative angle value (most commonly, degrees)
- Also possible to split up X, Y and even Z axis. Docs Here!
- Transforming on hover needs a transition duration to work
Scale
transform: scale(2)
- Takes one or two integer values
- One number assumes X and Y
Translate
transform: translate(10px, 50px)
- Moves an element horizontally and/or vertically
- Takes negative or positive measurement values such as pixels
- One number assumes the X value
Skew
transform: skew(20deg, 10deg);
- Skews an element on the X and Y axis
- Takes one or two integer values
- One number assumes X
Multiple Transforms
transform: scale(2) rotate(90deg);
Keyframes
Lets us animate elements with or without a trigger event, define steps in the animation and more!
Declaring Our Keyframe Rule
This means the same thing!
Adding Animation Properties
We need a few more things to make our keyframe animation work


Thinking Neumannically? Think again ...
i7 processors having 2.7 GHz clock speed, boosted to 3.3 GHz. Means in one second<PHONE_NUMBER> clock cycles are executed, capable of executing 92 billion instructions per second.
It certainly leaves you with a chill feeling. Isn’t it?
Do we ever imagine that so much is going on when we simply do a “quick” check of our facebook account and that too several times a day?
This article is going to be about the most basic element which started the revolution of Digital Computers…
Question- Have you ever wondered that in the name John von Neumann, von starts with a small case v?
One of my great teachers always says – “Tum dekhta hai par dekhta nai”, means we see but we don’t observe. The question above stands a testimony of the quote.
While building EDVAC (Electronic Discrete Variable Automatic Computer, a computer weighing 7850 kg.), an architecture was proposed as von Neumann Architecture.
Now why are we discussing an architecture that was introduced over 60 years ago? Because, even today you pick any desktop computer and it still uses the same architecture.
John von Neumann was a great mathematician. As the greatest inventions have simplest underlying principle, von Neumann architecture is no exception.
It says that program and data reside in same memory. There is a connection between CPU and memory (RAM), called bus. At a time CPU can either be fetching/writing data or fetching an instruction from memory. It’s simple right?
If you’re an Undergraduate in Computer Science, I bet some bells must be ringing in your mind. I’ll give you a hint, it’s called – “Universal Turing Machine”, which reads data from memory (through a memory tape) executed it and again writes back the result in memory. It’s not just a coincidence for two concepts so similar to emerge in near about the same time. Many of us don’t know but Alan Turing and John von Neumann worked together to shape the computers as we see them today.
Coming back to the von Neumann architecture, we still use it with some modifications. Like cache has been inserted to get better speed. But that too is only a modification since at a time processor can either fetch an instruction or fetch/write data. So what’s so great about it that we still use it (no offense to sir Neumann). It’s simplicity of performing either of the tasks is the main reason why it’s still used.
Imagine a computer where Instructions reside in different memory and data in a different one (this is Harvard architecture). The problem will be when to select what has to be done and then the selection would itself require some computation to be done which would again be performed by the same CPU. This complexity has forced processor makers to think in terms of Neumann architecture.
The obvious question would be that if there is only a single bus, wouldn’t it be a drawback in terms of speed? Definitely yes!!
The term “von Neumann bottleneck” was coined by John Backus in his 1977 ACM Turing Award lecture. According to Backus: “Surely there must be a less primitive way of making big changes in the store than by pushing vast numbers of words back and forth through the von Neumann bottleneck. Not only is this tube a literal bottleneck for the data traffic of a problem, but, more importantly, it is an intellectual bottleneck that has kept us tied to word-at-a-time thinking instead of encouraging us to think in terms of the larger conceptual units of the task at hand. Thus programming is basically planning and detailing the enormous traffic of words through the von Neumann bottleneck, and much of that traffic concerns not significant data itself, but where to find it.”
To make it simpler, we all know about instruction set and simple C.
Suppose we want to add two numbers. The c statement will be:
c = a + b;
Where a, b, c are variables. Finally it will be converted into a sequence of instructions such as:
LDA a
ADD b
STA c
Further will be converted to:
DR -> M[a] //DR- data register M[a]- stands for memory reference at address a.
AC -> DR // AC – accumulator register
DR -> M[b]
AC -> AC + DR
M[c] -> AC
We observe that at one time either the data or an instruction (such as addition) is fetched from memory (and hence the Neumann architecture).
That means computer has to perform tasks serially? Yes, it performs tasks serially at this level. But today parallelism is achieved today using computers based on von Neumann architectures in a different way through threads and employing multiple processors in a system. You can find a great practical article here.
But from our previous program we can see how von Neumann architecture forces high level language developers to think in Neumann way. Read “this” article and you will be amazed.
There are systems build on Harvard architecture. But due to the concept of Cache memory we use today (which is modified Harvard architecture), the Harvard architecture is of little practical use.
In my opinion John von Neumann was a great administrator too, coz he employed the greatest administration rule, which was Keep It Short and Simple, unlike this article. :P
Oh I almost forgot to answer: why v is in small case in the name John von Neumann?
The answer is- go GOOGLE it!! Self learning is the best.
Be force with you.
Further Read “The First Draft Report on the EDVAC”.


Back
BURNS
Is it a major or minor burn?
Call the number or seek immediate care for major burns, which:
- Are deep
- Cause the skin to be dry and leathery
- May appear charred or have patches of white, brown or black
- Are larger than 3 inches (about 8 centimeters) in diameter or cover the hands,
feet, face,buttocks or a major joint.
Treating major burns Until emergency help arrives:
- Make sure you and the person who’s burned are safe and out of harm’s way. Move them away from the source of the burn. If it’s an electrical burn,
turn off the power source before touching them.
- Check to see if they’re breathing. If needed, start rescue breathing if you’ve been trained.
- Remove restrictive items from their body, such as belts and jewelry in or near the burned areas. Burned areas typically swell quickly
- Cover the burned area. Use a clean cloth or bandage that’s moistened with cool, clean water.
- Separate fingers and toes. If hands and feet are burned, separate the fingers and toes with dry and sterile, nonadhesive bandages.
- Remove clothing from burned areas, but don’t try to remove clothing that’s stuck to the skin.
- Avoid immersing the person or burned body parts in water. Hypothermia (severe loss of body heat) can occur if you immerse large, severe burns in water.
- Raise the burned area. If possible, elevate the burned area above their heart.
- Watch for shock. Signs and symptoms of shock include shallow breathing, pale complexion, and fainting.
Treating minor burns:
- Cool down the burn. After holding the burn under cool, running water, apply cool, wet compresses until the pain subsides.
- Remove tight items, such as rings, from the burned area. Be gentle, but move quickly before swelling starts.
- Avoid breaking blisters. Blisters with fluid protect the area from infection. If a blister breaks, clean the area and gently apply an antibiotic ointment.
- Apply a moisturizing lotion, such as one with aloe vera. After the burned area has been cooled, apply a lotion to provide relief and to keep the area from drying out.
- Loosely bandage the burn. Use sterile gauze. Avoid fluffy cotton that could shed and get stuck to the healing area. Also avoid putting too much pressure on the burned skin.
- Take an over-the-counter pain reliever if necessary. Consider acetaminophen (Tylenol), ibuprofen (Advil), or naproxen (Aleve).


Reference: From Calculus To Analysis (Steen Pedersen, 2015, Springer Verlag)
Prove the following number is rational:
(copy&pasted from MathType editor in MathJax format) \[\begin{array}{l} 23.6\overline {321} = 23.6321321321 \ldots \\ \left. {23.6\overline {321} = \frac{p}{q}} \right| p \in \mathbb{N} \wedge q \in \mathbb{N}\\ \Leftrightarrow 23632.1\overline {321} = 1000\frac{p}{q}\\ 23632.1\overline {321} - 23.6\overline {321} = 23608.5\\ \Rightarrow 23608.5 = 1000\frac{p}{q} - \frac{p}{q} = 999\frac{p}{q}\\ \Rightarrow 23608.5q = 999p\\ \Leftrightarrow 47217q = 1998p\\ \Leftrightarrow \frac{{47217}}{{1998}} = \frac{p}{q}\\ \Leftrightarrow \frac{{15739}}{{666}} = \frac{p}{q} \end{array}\]
Or copy&pasted from the MathType editor in LaTex 2.9 format: \[\begin{array}{l} 23.6\overline {321} = 23.6321321321 \ldots \\ \left. {23.6\overline {321} = \frac{p}{q}} \right| p \in \wedge q \in \\ \Leftrightarrow 23632.1\overline {321} = 1000\frac{p}{q}\\ 23632.1\overline {321} - 23.6\overline {321} = 23608.5\\ \Rightarrow 23608.5 = 1000\frac{p}{q} - \frac{p}{q} = 999\frac{p}{q}\\ \Rightarrow 23608.5q = 999p\\ \Leftrightarrow 47217q = 1998p\\ \Leftrightarrow \frac{{47217}}{{1998}} = \frac{p}{q}\\ \Leftrightarrow \frac{{15739}}{{666}} = \frac{p}{q} \end{array}\]
Another exercise
Find integers $p$ and $q$ such that $3.14\overline {15} = \frac{p}{q}$:
\[\begin{array}{l} \left. {3.14\overline {15} = \frac{p}{q}} \right|p \in \mathbb{N} \wedge q \in \mathbb{N}\\ \Leftrightarrow 314.15\overline {15} = 100\frac{p}{q}\\ 314.15\overline {15} - 3.14\overline {15} = 310.99\\ \Rightarrow 310.99 = 100\frac{p}{q} - \frac{p}{q} = 99\frac{p}{q}\\ \Rightarrow 310.99q = 99p\\ \Leftrightarrow 31099q = 9900p\\ \Leftrightarrow \frac{{31099}}{{9900}} = \frac{p}{q}\\ \end{array}\]
#1: Exercises
Reference: The Complete Book of Fun Maths (Philip Carter & Ken Russell, 2004, John Wiley & Sons)
Find the lowest number that has a remainder of...
- 1 when divided by 2,
- 2 when divided by 3,
- 3 when divided by 4,
- 4 when divided by 5
- and 5 when divided by 6.
Solution:
First we observe that for any number $x$ which suits these criteria, the above criteria can be rephrased as "coming up short 1 when dividing by $n$" like this:
\[ f(x)= \begin{cases} -x^{2}, &\text{if $x < 0$;}\\ \alpha + x, &\text{if $0 \leq x \leq 1$;}\\ x^{2}, &\text{otherwise.} \end{cases} x \in \left. {3.14\overline {15} = \frac{p}{q}} \right|p \in \mathbb{N} \wedge q \in \mathbb{N}\\ \]
Find the smallest number which m
#1: Sample MathJax Equations
#1: More on LaTeX advanced formulas
\cases
example:
\begin{align*}
\begin{cases}
x = 2t + 1 \\
y = t + 2 \\
z = 3
\end{cases}
\end{align*}
\vphantom{...}
basic example: the bit left of the vertical bar is not printed:
\begin{align*}
\left.%\kern-\nulldelimiterspace -- MathJax does not support \kern and \nulldelimiterspace
\vphantom{\begin{cases}
x = 2t + 1 \\
y = t + 2 \\
z = 3
\end{cases}}\right| \quad t \in \mathbb{R}
\end{align*}
Combined these deliver custom alignment: \begin{align*} \begin{cases} x = 2t + 1 \\ y = t + 2 \\ z = 3 \end{cases} & \left.%\kern-\nulldelimiterspace -- MathJax does not support \kern and \nulldelimiterspace \vphantom{\begin{cases} x = 2t + 1 \\ y = t + 2 \\ z = 3 \end{cases}}\right| \quad t \in \mathbb{R} \end{align*}
Or written another way using only \begin{cases}
and \right|
:
\[
\left.\begin{cases}
x = 2t + 1 \\
y = t + 2 \\
z = 3
\end{cases}
\right| \quad t \in \mathbb{R}
\]
However, when we want more spacing, we could do it this way, avec du \quad
:
\begin{equation*}
\left\{\renewcommand\arraystretch{1.2}
\begin{matrix}
x = 2t + 1 \\
y = t + 2 \\
z = 3
\end{matrix}
\quad
\right| \quad t \in \mathbb{R}
\end{equation*}
Regrettably, MathJax does not support the AmsTeX \begin{empheq}
package:
\begin{empheq}[left=\empheqlbrace, right=\enspace\empheqrvert\enspace t\in\mathbb R]{align*}
x & = 2t + 1\\
y & = t + 2\\
z & = 3
\end{empheq}
Hence, this next example will fail as well: \begin{empheq}[right=\enspace\empheqrvert\enspace t\in\mathbb R]{equation*} \begin{cases} x = 2t + 1\\ y = t + 2\\ z = 3\end{cases} \end{empheq}
We try those another way, using other commands: \[ \left\{ \enspace \begin{align*} x & = 2t + 1\\ y & = t + 2\\ z & = 3 \end{align*} \enspace \right\rvert \enspace t \in \mathbb R \]
Or, when using \begin{cases}
:
\[
\left.
\begin{cases}
x = 2t + 1\\
y = t + 2\\
z = 3
\end{cases}
\enspace
\right\rvert
\enspace t \in \mathbb R
\]
Next, we're writing apply-formulas:
The relevant bit is the \bigg\rvert, which you can substitute with \Big\rvert or \Bigg\rvert to get a smaller or larger vertical stroke. If you would like to resize the vertical stroke automatically depending on what occurs to the left of it, I would recommend \[ T(s) = \left. \frac{1}{H(\hat S)} \right\rvert_{\hat S = \epsilon^{1/n} \frac{s}{\omega_P}} \]
where \left.
puts an invisible left-bracket-like symbol on the left, whose right-side partner is the vertical stroke given by \right|
. These pairs work equally for other braces/brackets.
Niel de Beaudrap
Do not use |
directly. Instead I suggest you use \rvert
, which is provided by the amsmath package to address the overloading of the |
symbol. See section 4.14.2 of the amsmath documentation.
Try the following:
\begin{equation} \left.\frac{\frac{1}{x}}{\frac{5}{1+\frac{x}{7}}}\right\vert_{-5}^{17} \end{equation}
and use \begin{array}{|l@{}}
to place a vertical bar at the left side of the array:
\[
\begin{array}{|l@{}}
2A + 2B = 0\\
A - B = 1
\end{array}
\]
Or with ensuring \displaystyle: \[ \begin{array}{|>{\displaystyle}l@{}} 2A + 2B = 0\\ A - B = 1 \end{array} \]
or a better line spacing provides gathered
from package amsmath:
\[
\begin{array}{|l@{}}
\begin{gathered}
2A + 2B = 0\\
A - B = 1\\
\sum_{i=0}^{A} = B\\
\int_{0}^{A} x\,\mathrm{d}x = B
\end{gathered}
\end{array}
\]
versus the non-gathered form: \[ \begin{array}{|l@{}} 2A + 2B = 0\\ A - B = 1\\ \sum_{i=0}^{A} = B\\ \int_{0}^{A} x\,\mathrm{d}x = B \end{array} \]
With the empheq
package (providing the overload option) there is a much simpler solution: you can put about anything you please on the left or on the right of an amsmath environment. Please note that empheq
loads mathtools that in turn loads amsmath
:
\usepackage[svgnames]{xcolor} \usepackage[overload]{empheq}
\begin{gather}[left=\color{Purple}\empheqlbrace\enspace, right=quad\color{red} \empheqlVert]% 2A + 2B = 0\\ A - B = 1\\ \sum_{i=0}^{A} = B\\ \int_{0}^{A} x\,\mathrm{d}x = B \end{gather}
and since MathJax doesn't support empheq
, here we have the same in basic form:
\[
% using two \left+\right containers, one for each color:
\color{red}
\left.
\color{Purple}
\left\{
% 'reset' color for the stuff printed inside:
\color{black}
\enspace
\begin{gather}
2A + 2B = 0\\
A - B = 1\\
\sum_{i=0}^{A} = B\\
\int_{0}^{A} x\,\mathrm{d}x = B
\end{gather}
\quad
%do not print vert in purple:
\right.
%\color{red}
\right\lVert
\]
This page outlines some more advanced uses of mathematics markup using LaTeX. In particular it makes heavy use of the AMS-LaTeX packages supplied by the American Mathematical Society.
#1: Equation numbering
The equation environment automatically numbers your equation: \begin{equation} f(x)=(x+a)(x+b) \end{equation}
\[ {\displaystyle {f(x)}=(x+a)(x+b){\color {White}ww}(1)\,} \]
You can also use the \label and \ref (or \eqref from the amsmath package) commands to label and reference equations, respectively. For equation number 1, \ref results in {\displaystyle 1\,} 1\, and \eqref results in {\displaystyle (1)\,} (1)\,:
\begin{equation} \label{eq:someequation} 6^2 - 5 = 36-5 = 31 \end{equation}
this references equation \ref{eq:someequation}.
\[ {\displaystyle 6^{2}-5=36-5=31\qquad (1)} \]
\[ {\displaystyle {\text{this references equation 1.}}\,} \]
\begin{equation} \label{eq:erl} a = bq + r \end{equation}
where \eqref{eq:erl} is true if $a$ and $b$ are integers with $b \neq c$.
\[ {\displaystyle a=bq+r\qquad (1)} \]
\[ {\displaystyle {\text{where (1) is true if }}a{\text{ and }}b\,} {\displaystyle {\text{are integers with }}b\neq c.} \]
Further information is provided in the labels and cross-referencing chapter.
To have the enumeration follow from your section or subsection heading, you must use the amsmath package or use AMS class documents. Then enter
\numberwithin{equation}{section}
to the preamble to get enumeration at the section level or
\numberwithin{equation}{subsection}
to have the enumeration go to the subsection level.
\[ \numberwithin{equation}{subsection} \section{First Section} \subsection{A subsection} \]
\begin{equation} L' = {L}{\sqrt{1-\frac{v^2}{c^2}}} \end{equation}
\[ {\displaystyle L'={L}{\sqrt {1-{\frac {v^{2}}{c^{2}}}}}{\color {White}ww}(1.1.1)\,} \]
If the style you follow requires putting dots after ordinals (as it is required at least in Polish typography), the
\numberwithin{equation}{subsection}
command in the preamble will result in the equation number in the above example being rendered as follows: (1.1..1).
To remove the duplicate dot, add the following command immediately after \numberwithin{equation}{section}
:
\renewcommand{\theequation}{\thesection\arabic{equation}}
For a numbering scheme using \numberwithin{equation}{subsection}, use:
\renewcommand{\theequation}{\thesubsection\arabic{equation}}
in the preamble of the document.
Note: Although it may look like the \renewcommand works by itself, it won't reset the equation number with each new section. It must be used together with manual equation number resetting after each new section beginning, or with the much cleaner
\numberwithin
.
Subordinate equation numbering
To number subordinate equations in a numbered equation environment, place the part of document containing them in a subequations environment:
Maxwell's equations: \begin{subequations} \begin{align} B'&=-\nabla \times E,\\ E'&=\nabla \times B - 4\pi j, \end{align} \end{subequations}
\[ {\displaystyle {\begin{aligned}B'&=-\nabla \times E,&\quad &\mathrm {(1.1a)} \\E'&=\nabla \times B-4\pi j,&&\mathrm {(1.1b)} \end{aligned}}} \]
Unfortunately MathJAX does not support \begin{subequations}
yet. Hence we cannot use it and must use \begin{equation}
instead:
\begin{equation} \begin{aligned} B'&=-\nabla \times E,\\ E'&=\nabla \times B - 4\pi j, \end{aligned} \end{equation}
\[ {\displaystyle {\begin{aligned}B'&=-\nabla \times E,&\quad &\mathrm {(1.1a)} \\E'&=\nabla \times B-4\pi j,&&\mathrm {(1.1b)} \end{aligned}}} \]
Referencing subordinate equations can be done using either of two methods: adding a label after the
\begin{subequations}
command, which will reference the main equation (1.1 above), or adding a label at the end of each line, before the \\
command, which will reference the sub-equation (1.1a or 1.1b above). It is possible to add both labels in case both types of references are needed.
Vertically aligning displayed mathematics
A problem often encountered with displayed environments (displaymath
and equation
) is the lack of any ability to span multiple lines. While it is possible to define lines individually, these will not be aligned.
Above and below
The \overset
and \underset
commands[1] typeset symbols above and below expressions. Without AmsTex the same result of \overset
can be obtained with \stackrel
. This can be particularly useful for creating new binary relations:
\[ A \overset{!}{=} B; A \stackrel{!}{=} B \]
\[ {\displaystyle A{\overset {!}{=}}B;~~A{\stackrel {!}{=}}B\,} \]
or to show usage of L'Hôpital's rule:
\[ \lim_{x\to 0}{\frac{e^x-1}{2x}} \overset{\left[\frac{0}{0}\right]}{\underset{\mathrm{H}}{=}} \lim_{x\to 0}{\frac{e^x}{2}}={\frac{1}{2}} \]
\[ {\displaystyle \lim _{x\to 0}{\frac {e^{x}-1}{2x}}{\overset {\left[{\frac {0}{0}}\right]}{\underset {\mathrm {H} }{=}}}\lim _{x\to 0}{\frac {e^{x}}{2}}={\frac {1}{2}}} \]
It is convenient to define a new operator that will set the equals sign with H and the provided fraction:
\newcommand{\Heq}[1]{\overset{\left[#1\right]}{\underset{\mathrm{H}}{=}}}
which reduces the above example to:
\[ \newcommand{\Heq}[1]{\overset{\left[#1\right]}{\underset{\mathrm{H}}{=}}} \] \[ \lim_{x\to 0}{\frac{e^x-1}{2x}} \Heq{\frac{0}{0}} \lim_{x\to 0}{\frac{e^x}{2}}={\frac{1}{2}} \]
If the purpose is to make comments on particular parts of an equation, the \overbrace
and \underbrace
commands may be more useful. However, they have a different syntax (and can be aligned with the \vphantom
command):
\[ z = \overbrace{ \underbrace{x}_\text{real} + i \underbrace{y}_\text{imaginary} }^\text{complex number} \]
\[ {\displaystyle z=\overbrace {\underbrace {x} _{\text{real}}+i\underbrace {y} _{\text{imaginary}}} ^{\text{complex number}}} \]
Sometimes the comments are longer than the formula being commented on, which can cause spacing problems. These can be removed using the \mathclap
command[2]:
\[ y = a + f(\underbrace{b x}_{ \ge 0 \text{ by assumption}}) = a + f(\underbrace{b x}_{ \mathclap{\ge 0 \text{ by assumption}}}) \]
Regrettably, MathJAX does not support the \mathclap
command so we'll have to rely on situational hacks instead:
\[ y = a + f(\underbrace{b x}_{ \ge 0 \text{ by assumption}}) = a + f(\underbrace{\quad\quad b x \quad\quad}_{ {\ge 0 \text{ by assumption}}}) \]
Alternatively, to use brackets instead of braces use \underbracket
and \overbracket
commands[2]:
\[ z = \overbracket[3pt]{ \underbracket{x}_{\text{real}} + \underbracket[0.5pt][7pt]{iy}_{\text{imaginary}} }^{\text{complex number}} \]
The optional arguments set the rule thickness and bracket height respectively:
\underbracket[rule thickness][bracket height]{argument}_{text below}
The \xleftarrow
and \xrightarrow
commands[1] produce arrows which extend to the length of the text. Yet again, the syntax is different: the optional argument (using [
and ]
) specifies the subscript, and the mandatory argument (using {
and }
) specifies the superscript (which can be left empty by inserting a blank space).
\[ A \xleftarrow{\text{this way}} B \xrightarrow[\text{or that way}]{ } C \]
\[ {\displaystyle A{\xleftarrow {\text{this way}}}B{\xrightarrow[{\text{or that way}}]{}}C\,} \]
For more extensible arrows, you must use the mathtools package:
\begin{gather} a \xleftrightarrow[under]{over} b\\ % A \xLeftarrow[under]{over} B\\ % B \xRightarrow[under]{over} C\\ % C \xLeftrightarrow[under]{over} D\\ % D \xhookleftarrow[under]{over} E\\ % E \xhookrightarrow[under]{over} F\\ % F \xmapsto[under]{over} G\\ \end{gather}
and for harpoons:
\begin{gather} H \xrightharpoondown[under]{over} I\\ % I \xrightharpoonup[under]{over} J\\ % J \xleftharpoondown[under]{over} K\\ % K \xleftharpoonup[under]{over} L\\ % L \xrightleftharpoons[under]{over} M\\ % M \xleftrightharpoons[under]{over} N \end{gather}
MathJAX only supports the arrows from the extpfeil package, while we invite you to note the \Newextarrow
MathJAX-specific alternative for \newextarrow
:
\[
\usepackage{extpfeil}
\]
\[
\newextarrow{\injecta}{5599}{\succ\relbar\relbar}
\newextarrow{\injectb}{5599}{>\relbar\relbar}
\newextarrow{\injectc}{5599}{\succ\relbar\rightarrow}
\]
\[
\Newextarrow{\injecta}{19,19}{0x21A6}
\Newextarrow{\injectb}{19,19}{0x21A6}
\Newextarrow{\injectc}{19,19}{0x21A6}
\]
producing: \begin{gather} x\injecta[under]{above}y \\ x\injectb[under]{above}y \\ x\injectc[under]{above}y \end{gather}
\begin{gather} H \xtwoheadrightarrow[under]{over} I\\ % I \xtwoheadleftarrow[under]{over} J\\ % J \xmapsto[under]{over} K\\ % K \xlongequal[under]{over} L\\ % L \xtofrom[under]{over} M\\ \end{gather}
align
and align*
The align
and align*
environments, available through the amsmath package, are used for arranging equations of multiple lines. As with matrices and tables, \\
specifies a line break, and &
is used to indicate the point at which the lines should be aligned.
The align*
environment is used like the displaymath
or equation*
environment:
\begin{align*} f(x) &= (x+a)(x+b) \\ &= x^2 + (a+b)x + ab \end{align*}
\[ {\displaystyle {\begin{aligned}f(x)&=(x+a)(x+b)\\&=x^{2}+(a+b)x+ab\end{aligned}}\,} \]
Note that the align
environment must not be nested inside an equation
(or similar) environment. Instead, align
is a replacement for such environments; the contents inside an align
are automatically placed in math mode.
align*
suppresses numbering. To force numbering on a specific line, use the \tag{...}
command before the line break.
align
is similar, but automatically numbers each line like the equation
environment. Individual lines may be referred to by placing a \label{...}
before the line break. The \nonumber
or \notag
command can be used to suppress the number for a given line:
\begin{align} f(x) &= x^4 + 7x^3 + 2x^2 \nonumber \\ &\qquad {} + 10x + 12 \end{align}
\[ {\displaystyle {\begin{aligned}f(x)&=x^{4}+7x^{3}+2x^{2}\\&\qquad {}+10x+12\qquad \qquad (3)\end{aligned}}} \]
Notice that we've added some indenting on the second line. Also, we need to insert the double braces ({}
) before the +
sign, otherwise latex won't create the correct spacing after the +
sign. The reason for this is that without the braces, latex interprets the +
sign as a unary operator, instead of the binary operator that it really is.
More complicated alignments are possible, with additional &'s on a single line specifying multiple "equation columns", each of which is aligned. The following example illustrates the alignment rule of align*
:
\begin{align*} f(x) &= a x^2+b x +c & g(x) &= d x^3 \\ f'(x) &= 2 a x +b & g'(x) &= 3 d x^2 \end{align*}
\[ {\displaystyle {\begin{aligned}f(x)&=ax^{2}+bx+c&g(x)&=dx^{3}\\f'(x)&=2ax+b&g'(x)&=3dx^{2}\end{aligned}}\,} \]
Braces spanning multiple lines
If you want a brace to continue across a new line, do the following:
\begin{align} f(x) &= \pi \left\{ x^4 + 7x^3 + 2x^2 \right.\nonumber\\ &\qquad \left. {} + 10x + 12 \right\} \end{align}
\[ {\displaystyle {\begin{aligned}f(x)&=\pi \left\{x^{4}+7x^{3}+2x^{2}\right.\\&\qquad \left.{}+10x+12\right\}\qquad \qquad (4)\end{aligned}}} \]
In this construction, the sizes of the left and right braces are not automatically equal, in spite of the use of \left\{
and \right\}
. This is because each line is typeset as a completely separate equation — notice the use of
\right.
and \left.
so there are no unpaired \left
and \right
commands within a line (these aren't needed if the formula is on one line). You can control the size of the braces manually with the \big
, \Big
, \bigg
, and \Bigg
commands.
Alternatively, the height of the taller equation can be replicated in the other using the \vphantom
command:
\begin{align} A &= \left(\int_t XXX \right.\nonumber\\ &\qquad \left.\vphantom{\int_t} YYY \dots \right) \end{align}
\[ {\displaystyle {\begin{aligned}A&=\left(\int _{t}XXX\right.\\&\qquad YYY\dots {\biggr )}\qquad \qquad \mathrm {(5)} \end{aligned}}} \]
Using aligned braces for piecewise functions
You can also use \left\{
and \right.
to typeset piecewise functions:
\[f(x) = \left\{ \begin{array}{lr} x^2 & : x < 0\\ x^3 & : x \ge 0 \end{array} \right. \]
\[ {\displaystyle f(x)=\left\{ { \begin{array}{lr} x^{2}&:x<0\\ x^{3}&:x\geq 0 \end{array} } \right. } \]
The cases
environment
The cases
environment[1] allows the writing of piecewise functions:
\[ u(x) = \begin{cases} \exp{x} & \text{if } x \geq 0 \\ 1 & \text{if } x < 0 \end{cases} \]
\[ {\displaystyle u(x)={\begin{cases}\exp {x}&{\text{if }}x\geq 0\\1&{\text{if }}x<0\end{cases}}} \]
LaTeX will then take care of defining and or aligning the columns.
Within cases, text style math is used with results such as:
\[ {\displaystyle a={\begin{cases}\int x\,\mathrm {d} x\\b^{2}\end{cases}}} \]
Display style may be used instead, by using the dcases
environment[2] from mathtools:
\[ a = \begin{dcases} \int x\, \mathrm{d} x\\ b^2 \end{dcases} \]
\[ {\displaystyle a={\begin{cases}\displaystyle \int x\,\mathrm {d} x\\\displaystyle b^{2}\end{cases}}} \]
Often the second column consists mostly of normal text. To set it in the normal Roman font of the document, the dcases*
environment may be used:[2]
\[ f(x) = \begin{dcases*} x & when $x$ is even\\ -x & when $x$ is odd \end{dcases*} \]
\[ {\displaystyle f(x)={\begin{cases}x&{\text{when }}x{\text{ is even}}\\-x&{\text{when }}x{\text{ is odd}}\end{cases}}} \]
Other environments
Although align
and align*
are the most useful, there are several other environments that may also be of interest:
Environment name Description Notes
- eqnarray and eqnarray*
- Similar to align and align* Not recommended because spacing is inconsistent
- multline and multline*[1]
- First line left aligned, last line right aligned Equation number aligned vertically with first line and not centered as with other environments
- gather and gather*[1]
- Consecutive equations without alignment
- flalign and flalign*[1]
- Similar to align, but left aligns first equation column, and right aligns last column
- alignat and alignat*[1]
- Takes an argument specifying number of columns. Allows control of the horizontal space between equations This environment takes one argument, the number of “equation columns”: count the maximum number of &s in any row, add 1 and divide by 2. [1]
There are also a few environments that don't form a math environment by themselves and can be used as building blocks for more elaborate structures:
Math environment name Description
- gathered[1]
- Allows gathering equations to be set under each other and assigned a single equation number
- split[1]
- Similar to align*, but used inside another displayed mathematics environment
- aligned[1]
- Similar to align, to be used inside another mathematics environment.
- alignedat[1]
- Similar to alignat, and likewise takes an additional argument specifying the number of columns of equations to set.
For example:
\begin{equation} \left.\begin{aligned} B'&=-\partial \times E\\ E'&=\partial \times B - 4\pi j \end{aligned} \right\} \qquad \text{Maxwell's equations} \end{equation}
\[ {\displaystyle \left. {\begin{aligned} B'&=-\partial \times E\\ E'&=\partial \times B-4\pi j \end{aligned}} \right\}\quad {\text{Maxwell}}'{\text{s equations}}\qquad \mathrm {(1.1)} } \]
\begin{alignat}{2} \sigma_1 &= x + y &\quad \sigma_2 &= \frac{x}{y} \\ \sigma_1' &= \frac{\partial x + y}{\partial x} & \sigma_2' &= \frac{\partial \frac{x}{y}}{\partial x} \end{alignat}
\[ {\displaystyle {\begin{aligned}\sigma _{1}&=x+y&\sigma _{2}&={\frac {x}{y}}&\qquad &\qquad &(1)\\\sigma _{1}'&={\frac {\partial x+y}{\partial x}}&\sigma _{2}'&={\frac {\partial {\frac {x}{y}}}{\partial x}}&&&(2)\end{aligned}}} \]
and using gather*
and split
:
\begin{gather*}
a_0=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}f(x)\,\mathrm{d}x\\[6pt]
\begin{split}
a_n&=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}f(x)\cos nx\,\mathrm{d}x=\\
&=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}x^2\cos nx\,\mathrm{d}x
\end{split}\\[6pt]
\begin{split}
b_n&=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}f(x)\sin nx\,\mathrm{d}x=\\
&=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}x^2\sin nx\,\mathrm{d}x
\end{split}\\[6pt]
\end{gather*}
Indented Equations
To indent an equation, you can set fleqn
in the document class and then specify a certain value for the \mathindent
variable:
\documentclass[a4paper,fleqn]{report} \usepackage{amsmath} \setlength{\mathindent}{1cm} \begin{document}
Euler's formula is given below:
\begin{equation*} e^{ix} = \cos{x} + i \sin{x} \end{equation*}
This is a very important formula.
Page breaks in math environments
To suggest that LaTeX insert a page break inside an amsmath environment, you may use the \displaybreak
command before the line break. Just as with \pagebreak
, \displaybreak
can take an optional argument between 0 and 4 denoting the level of desirability of a page break. Whereas 0 means "it is permissible to break here", 4 forces a break. No argument means the same as 4.
Alternatively, you may enable automatic page breaks in math environments with \allowdisplaybreaks
. It too can have an optional argument denoting the priority of page breaks in equations. Similarly, 1 means "allow page breaks but avoid them" and 4 means "break whenever you want". You can prohibit a page break after a given line using \\*
.
LaTeX will insert a page break into a long equation if it has additional text added using \intertext{}
without any additional commands.
Note: these commands (\displaybreak
, \allowdisplaybreaks
and \intertext{}
) are not supported by MathJAX.
Specific usage may look like this:
\begin{align*} &\vdots\\ &=12+7 \int_0^2 \left( -\frac{1}{4}\left(e^{-4t_1}+e^{4t_1-8}\right) \right)\,dt_1\displaybreak[3]\\ &= 12-\frac{7}{4}\int_0^2 \left( e^{-4t_1}+e^{4t_1-8} \right)\,dt_1\\ &\vdots % \end{align*}
Page breaks before display maths (of all various forms) are controlled by \predisplaypenalty
. Its default 10000 means never break immediately before a display. Knuth (TeXbook chapter 19) explains this as a printers' tradition not to have a displayed equation at the start of a page. It can be relaxed with
\predisplaypenalty=0
Sometimes an equation might look best kept together preceding text by a higher penalty, for example a single-line paragraph about a single-line equation, especially at the end of a section.
Boxed Equations
For a single equation or alignment building block, with the tag outside the box, use \boxed{}
:
\begin{equation} \boxed{x^2+y^2 = z^2} \end{equation}
If you want the entire line or several equations to be boxed, use a minipage
inside an \fbox{}
:
\[ \fbox{ \addtolength{\linewidth}{-2\fboxsep}% \addtolength{\linewidth}{-2\fboxrule}% \begin{minipage}{\linewidth} \begin{equation} x^2+y^2=z^2 \end{equation} \end{minipage} } \]
and without the minipage
stuff, which isn't grokked by MathJAX:
\[
\boxed{
x^2+y^2=z^2 \\
x^3+y^3=z^3 \\
x^4+y^4=z^4
}
\]
though MathJAX does not support minipage
nor \fbox
: there you're probably better off using CSS to format the HTML context in which
the formula has been rendered.
There is also the mathtools \Aboxed{}
which is able to box across alignment marks:
\begin{align*} \Aboxed{ f(x) & = \int h(x)\, dx} \\ & = g(x) \end{align*}
Custom operators
Although many common operators are available in LaTeX, sometimes you will need to write your own, e.g. to typeset the argmax
operator. The \operatorname
and \operatorname*
commands[1] display custom operators; the *
version sets the underscored option underneath like the \lim
operator:
\[ \operatorname{arg\,max}_a f(a) = \operatorname*{arg\,max}_b f(b) \]
\[ {\displaystyle \operatorname {arg\,max} _{a}f(a)={\underset {b}{\operatorname {arg\,max} }}f(b)} \]
However, if the operator is frequently used, it is preferable to define a new operator that can be used throughout the entire document. The \DeclareMathOperator
and \DeclareMathOperator*
commands[1] are specified in the header of the document:
\[ \DeclareMathOperator*{\argmax}{arg\,max} \]
This defines a new command which may be referred to in the body:
\[ \argmax_c f(c) \]
\[ {\displaystyle {\underset {c}{\operatorname {arg\,max} }}f(c)} \]
Advanced formatting
Limits
There are defaults for placement of subscripts and superscripts. For example, limits for the lim
operator are usually placed below the symbol:
\begin{equation} \lim_{a\to \infty} \tfrac{1}{a} \end{equation}
\[ {\displaystyle \lim _{a\to \infty }{\tfrac {1}{a}}} \]
To override this behavior, use the \nolimits
operator:
\begin{equation} \lim\nolimits_{a\to \infty} \tfrac{1}{a} \end{equation}
\[ {\displaystyle \lim \nolimits _{a\to \infty }{\tfrac {1}{a}}} \]
A lim
in running text (inside $...$
) will have its limits placed on the side, so that additional leading won't be required. To override this behavior, use the \limits
command:
Observe: $\lim _{a\to \infty} \tfrac{1}{a}$ versus this one: $\lim \limits _{a\to \infty} \tfrac{1}{a}$.
Similarly one can put subscripts under a symbol that usually has them on the side:
\begin{equation} \int_a^b x^2 \mathrm{d} x \end{equation}
\[ {\displaystyle \int _{a}^{b}x^{2}\mathrm {d} x} \]
Limits below and under:
\begin{equation} \int\limits_a^b x^2 \mathrm{d} x \end{equation}
\[ {\displaystyle \int \limits _{a}^{b}x^{2}\mathrm {d} x} \]
To change the default placement of summation-type symbols to the side for every case, add the nosumlimits
option to the amsmath package. To change the placement for integral symbols, add intlimits
to the options. nonamelimits
can be used to change the default for named operators like det
, min
, lim
, etc.
To produce one-sided limits, use \underset
as follows:
\begin{equation} \lim_{a \underset{>}{\to} 0} \frac{1}{a} \end{equation}
\[ {\displaystyle \lim _{a{\underset {>}{\to }}0}{\frac {1}{a}}} \]
Subscripts and superscripts
You can place symbols in subscript or superscript (in summation style symbols) with \nolimits
:
\begin{equation} \sum\nolimits' C_n \end{equation}
\[ {\displaystyle \sum \nolimits 'C_{n}} \]
It's impossible to mix them with typical usage of such symbols:
\begin{equation} \sum_{n=1}\nolimits' C_n \end{equation}
\[ {\displaystyle \sum _{n=1}\nolimits 'C_{n}} \]
To add both a prime and a limit to a symbol, one might use the \sideset
command:
\begin{equation} \sideset{}{'}\sum_{n=1}C_n \end{equation}
\[ {\displaystyle \sideset {}{'}\sum _{n=1}C_{n}} \]
It is very flexible: for example, to put letters in each corner of the symbol use this command:
\begin{equation} \sideset{_a^b}{_c^d}\sum \end{equation}
\[ {\displaystyle \sideset {_{a}^{b}}{_{c}^{d}}\sum } \]
If you wish to place them on the corners of an arbitrary symbol, you should use \fourIdx
from the fouridx
package.
But a simple grouping can also solve the problem:
\begin{equation} {\sum\limits_{n=1} }'C_n \end{equation}
\[ {\displaystyle {\sum \limits _{n=1}}'C_{n}} \]
since a math operator can be used with limits or no limits. If you want to change its state, simply group it. You can make it another math operator if you want, and then you can have limits and then limits again.
Multiline subscripts
To produce multiline subscript, use the \substack
command:
\begin{equation} \prod_{\substack{ 1\le i \le n\\ 1\le j \le m}} M_{i,j} \end{equation}
\[ {\displaystyle \prod _{1\leq i\leq n \atop 1\leq j\leq m\ }M_{i,j}} \]
Text in aligned math display
To add small interjections in math environments, use the \intertext
command:
\begin{align*} \intertext{If} A &= \sigma_1+\sigma_2\\ B &= \rho_1+\rho_2\\ \intertext{then} C(x) &= e^{Ax^2+\pi}+B \end{align*}
Note that any usage of this command does not change the alignment.
\begin{align*} \shortintertext{If} A &= \sigma_1+\sigma_2\\ B &= \rho_1+\rho_2\\ \shortintertext{then} C(x) &= e^{Ax^2+\pi}+B \end{align*}
Also, in the above example, the command \shortintertext{}
from the mathtools package could have been used instead of intertext
to reduce the amount of vertical white space added between the lines.
Changing font size
There may be a time when you would prefer to have some control over the font size. For example, using text-mode maths, by default a simple fraction will look like this: ${\frac {a}{b}}$ and ${\textstyle {\frac {a}{b}}}$, whereas you may prefer to have it displayed larger, like when in display mode, but still keeping it in-line, like this: ${\displaystyle {\frac {a}{b}}}$.
A simple approach is to utilize the predefined sizes for maths elements:
- Size command
- Description
-
\displaystyle
- Size for equations in display mode
-
\textstyle
- Size for equations in text mode
-
\scriptstyle
- Size for first sub/superscripts
-
\scriptscriptstyle
- Size for subsequent sub/superscripts
A classic example to see this in use is typesetting continued fractions (though it's better to use the \cfrac
command[1] described in the Mathematics chapter instead of the method provided below). The following code provides an example.
\begin{equation} x = a_0 + \frac{1}{a_1 + \frac{1}{a_2 + \frac{1}{a_3 + a_4}}} \end{equation}
\[ {\displaystyle x=a_{0}+{\frac {1}{a_{1}+{\frac {1}{a_{2}+{\frac {1}{a_{3}+a_{4}}}}}}}} \]
As you can see, as the fractions continue, they get smaller (although they will not get any smaller than in this example, where they have reached the \scriptstyle
limit). If you want to keep the size consistent, you could declare each fraction to use the display style instead; e.g.
\begin{equation} x = a_0 + \frac{1}{\displaystyle a_1 + \frac{1}{\displaystyle a_2 + \frac{1}{\displaystyle a_3 + a_4}}} \end{equation}
\[ {\displaystyle x=a_{0}+{\frac {1}{\displaystyle a_{1}+{\frac {1}{\displaystyle a_{2}+{\frac {1}{\displaystyle a_{3}+a_{4}}}}}}}} \]
Another approach is to use the \DeclareMathSizes
command to select your preferred sizes. You can only define sizes for \displaystyle
, \textstyle
, etc. One potential downside is that this command sets the global maths sizes, as it can only be used in the document preamble.
But it's fairly easy to use: \DeclareMathSizes{ds}{ts}{ss}{sss}
, where ds
is the display size, ts
is the text size, etc. The values you input are assumed to be point (pt) size.
Note that the changes only take place if the value in the first argument matches the current document text size. It is therefore common to see a set of declarations in the preamble, in the event of the main font being changed. E.g.,
\DeclareMathSizes{10}{18}{12}{8} % For size 10 text \DeclareMathSizes{11}{19}{13}{9} % For size 11 text \DeclareMathSizes{12}{20}{14}{10} % For size 12 text
Forcing \displaystyle
for all math in a document
Put
\everymath{\displaystyle}
before
\begin{document}
to force all math to
\displaystyle
.
Adjusting vertical white space around displayed math
There are four parameters that control the vertical white space around displayed math:
\abovedisplayskip=12pt \belowdisplayskip=12pt \abovedisplayshortskip=0pt \belowdisplayshortskip=7pt
Short skips are used if the preceding line ends, horizontally, before the formula. These parameters must be set after
\begin{document}
.
Part of this page is extracted from:
KaTeX and MathJax Comparison Demo
Page by Murray Bourne, IntMath.com. Last updated: 28 Feb 2018
Time to process page = 1820 ms
Repeating fractions
The LaTeX code:
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
Summation notation
The LaTeX code:
\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)
Sum of a Series
I broke up the next two examples into separate lines so it behaves better on a mobile phone. That's why they include \displaystyle.
The LaTeX code:
\displaystyle\sum_{i=1}^{k+1}i
The LaTeX code:
\displaystyle= \left(\sum_{i=1}^{k}i\right) +(k+1)
The LaTeX code:
\displaystyle= \frac{k(k+1)}{2}+k+1
The LaTeX code:
\displaystyle= \frac{k(k+1)+2(k+1)}{2}
The LaTeX code:
\displaystyle= \frac{(k+1)(k+2)}{2}
The LaTeX code:
\displaystyle= \frac{(k+1)((k+1)+1)}{2}
Product notation
The LaTeX code:
\displaystyle 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots
The LaTeX code:
= \displaystyle \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
The LaTeX code:
\displaystyle\text{ for }\lvert q\rvert < 1.
Inline math
And here is some in-line math: , followed by some more text.
The LaTeX code:
k_{n+1} = n^2 + k_n^2 - k_{n-1}
Inline math uses
<span class="math">...</span>
rather than a div.
Greek Letters
The LaTeX code:
\Gamma\ \Delta\ \Theta\ \Lambda\ \Xi\ \Pi\ \Sigma\ \Upsilon\ \Phi\ \Psi\ \Omega
The LaTeX code:
\alpha\ \beta\ \gamma\ \delta\ \epsilon\ \zeta\ \eta\ \theta\ \iota\ \kappa\ \lambda\ \mu\ \nu\ \xi
The LaTeX code:
\ \omicron\ \pi\ \rho\ \sigma\ \tau\ \upsilon\ \phi\ \chi\ \psi\ \omega\ \varepsilon\ \vartheta\ \varpi\ \varrho\ \varsigma\ \varphi
Arrows
The LaTeX code:
\gets\ \to\ \leftarrow\ \rightarrow\ \uparrow\ \Uparrow\ \downarrow\ \Downarrow\ \updownarrow\ \Updownarrow
The LaTeX code:
\Leftarrow\ \Rightarrow\ \leftrightarrow\ \Leftrightarrow\ \mapsto\ \hookleftarrow
The LaTeX code:
\leftharpoonup\ \leftharpoondown\ \rightleftharpoons\ \longleftarrow\ \Longleftarrow\ \longrightarrow
The LaTeX code:
\Longrightarrow\ \longleftrightarrow\ \Longleftrightarrow\ \longmapsto\ \hookrightarrow\ \rightharpoonup
The LaTeX code:
\rightharpoondown\ \leadsto\ \nearrow\ \searrow\ \swarrow\ \nwarrow
Symbols
The LaTeX code:
\surd\ \barwedge\ \veebar\ \odot\ \oplus\ \otimes\ \oslash\ \circledcirc\ \boxdot\ \bigtriangleup
The LaTeX code:
\bigtriangledown\ \dagger\ \diamond\ \star\ \triangleleft\ \triangleright\ \angle\ \infty\ \prime\ \triangle
Calculus
The LaTeX code:
\int u \frac{dv}{dx}\,dx=uv-\int \frac{du}{dx}v\,dx
The LaTeX code:
f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x}
The LaTeX code:
\oint \vec{F} \cdot d\vec{s}=0
Lorenz Equations
The LaTeX code:
\begin{aligned} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{aligned}
Cross Product
This works in KaTeX, but the separation of fractions in this environment is not so good.
The LaTeX code:
\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix}
Here's a workaround: make the fractions smaller with an extra class that targets the spans with "mfrac" class (makes no difference in the MathJax case):
The LaTeX code:
\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix}
Accents
The LaTeX code:
\hat{x}\ \vec{x}\ \ddot{x}
Stretchy brackets
The LaTeX code:
\left(\frac{x^2}{y^3}\right)
Evaluation at limits
The LaTeX code:
\left.\frac{x^3}{3}\right|_0^1
Case definitions
The LaTeX code:
f(n) = \begin{cases} \frac{n}{2}, & \text{if } n\text{ is even} \\ 3n+1, & \text{if } n\text{ is odd} \end{cases}
Maxwell's Equations
The LaTeX code:
\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}
These equations are quite cramped. We can add vertical spacing using (for example) [1em]
after each line break (\\
). as you can see here:
The LaTeX code:
\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\[1em] \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\[0.5em] \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\[1em] \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}
Statistics
Definition of combination:
The LaTeX code:
\frac{n!}{k!(n-k)!} = {^n}C_k
The LaTeX code:
{n \choose k}
Fractions on fractions
The LaTeX code:
\frac{\frac{1}{x}+\frac{1}{y}}{y-z}
n-th root
The LaTeX code:
\sqrt[n]{1+x+x^2+x^3+\ldots}
Matrices
The LaTeX code:
\begin{pmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33} \end{pmatrix}
The LaTeX code:
\begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0 \end{bmatrix}
Punctuation
The LaTeX code:
f(x) = \sqrt{1+x} \quad (x \ge -1)
The LaTeX code:
f(x) \sim x^2 \quad (x\to\infty)
Now with punctuation:
The LaTeX code:
f(x) = \sqrt{1+x}, \quad x \ge -1
The LaTeX code:
f(x) \sim x^2, \quad x\to\infty
More examples...
Home | Math Display Experiments | MathJax and KaTeX Comparison
KaTeX and MathJax Comparison Demo
Page by Murray Bourne, IntMath.com. Last updated: 28 Feb 2018Process with KaTex Processed by MathJax
Time to process page = 1820 ms
Page processed with MathJax
Repeating fractions
The LaTeX code:
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
Summation notation
The LaTeX code:
\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)
Sum of a Series
I broke up the next two examples into separate lines so it behaves better on a mobile phone. That's why they include \displaystyle.
The LaTeX code:
\displaystyle\sum_{i=1}^{k+1}i
The LaTeX code:
\displaystyle= \left(\sum_{i=1}^{k}i\right) +(k+1)
The LaTeX code:
\displaystyle= \frac{k(k+1)}{2}+k+1
The LaTeX code:
\displaystyle= \frac{k(k+1)+2(k+1)}{2}
The LaTeX code:
\displaystyle= \frac{(k+1)(k+2)}{2}
The LaTeX code:
\displaystyle= \frac{(k+1)((k+1)+1)}{2}
Product notation
The LaTeX code:
\displaystyle\text{ for }\lvert q\rvert < 1.
The LaTeX code:
= \displaystyle \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
The LaTeX code:
\displaystyle 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots
Inline math
And here is some in-line math: , followed by some more text.
The LaTeX code:
k_{n+1} = n^2 + k_n^2 - k_{n-1}
Inline math uses
<span class="math">...</span>
rather than a div.
Greek Letters
The LaTeX code:
\Gamma\ \Delta\ \Theta\ \Lambda\ \Xi\ \Pi\ \Sigma\ \Upsilon\ \Phi\ \Psi\ \Omega
The LaTeX code:
\ \omicron\ \pi\ \rho\ \sigma\ \tau\ \upsilon\ \phi\ \chi\ \psi\ \omega\ \varepsilon\ \vartheta\ \varpi\ \varrho\ \varsigma\ \varphi
The LaTeX code:
\alpha\ \beta\ \gamma\ \delta\ \epsilon\ \zeta\ \eta\ \theta\ \iota\ \kappa\ \lambda\ \mu\ \nu\ \xi
Arrows
The LaTeX code:
\gets\ \to\ \leftarrow\ \rightarrow\ \uparrow\ \Uparrow\ \downarrow\ \Downarrow\ \updownarrow\ \Updownarrow
The LaTeX code:
\Leftarrow\ \Rightarrow\ \leftrightarrow\ \Leftrightarrow\ \mapsto\ \hookleftarrow
The LaTeX code:
\leftharpoonup\ \leftharpoondown\ \rightleftharpoons\ \longleftarrow\ \Longleftarrow\ \longrightarrow
The LaTeX code:
\Longrightarrow\ \longleftrightarrow\ \Longleftrightarrow\ \longmapsto\ \hookrightarrow\ \rightharpoonup
The LaTeX code:
\rightharpoondown\ \leadsto\ \nearrow\ \searrow\ \swarrow\ \nwarrow
Symbols
The LaTeX code:
\surd\ \barwedge\ \veebar\ \odot\ \oplus\ \otimes\ \oslash\ \circledcirc\ \boxdot\ \bigtriangleup
The LaTeX code:
\bigtriangledown\ \dagger\ \diamond\ \star\ \triangleleft\ \triangleright\ \angle\ \infty\ \prime\ \triangle
Calculus
The LaTeX code:
\int u \frac{dv}{dx}\,dx=uv-\int \frac{du}{dx}v\,dx
The LaTeX code:
f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x}
The LaTeX code:
\oint \vec{F} \cdot d\vec{s}=0
Lorenz Equations
The LaTeX code:
\begin{aligned} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{aligned}
Cross Product
This works in KaTeX, but the separation of fractions in this environment is not so good.
The LaTeX code:
\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix}
Here's a workaround: make the fractions smaller with an extra class that targets the spans with "mfrac" class (makes no difference in the MathJax case):
The LaTeX code:
\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix}
Accents
The LaTeX code:
\hat{x}\ \vec{x}\ \ddot{x}
Stretchy brackets
The LaTeX code:
\left(\frac{x^2}{y^3}\right)
Evaluation at limits
The LaTeX code:
\left.\frac{x^3}{3}\right|_0^1
Case definitions
The LaTeX code:
f(n) = \begin{cases} \frac{n}{2}, & \text{if } n\text{ is even} \\ 3n+1, & \text{if } n\text{ is odd} \end{cases}
Maxwell's Equations
The LaTeX code:
\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}
These equations are quite cramped. We can add vertical spacing using (for example) [1em]
after each line break (\\
). as you can see here:
The LaTeX code:
\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\[1em] \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\[0.5em] \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\[1em] \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}
Statistics
Definition of combination:
The LaTeX code:
\frac{n!}{k!(n-k)!} = {^n}C_k
The LaTeX code:
{n \choose k}
Fractions on fractions
The LaTeX code:
\frac{\frac{1}{x}+\frac{1}{y}}{y-z}
n-th root
The LaTeX code:
\sqrt[n]{1+x+x^2+x^3+\ldots}
Matrices
The LaTeX code:
\begin{pmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33} \end{pmatrix}
The LaTeX code:
\begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0 \end{bmatrix}
Punctuation
The LaTeX code:
f(x) = \sqrt{1+x} \quad (x \ge -1)
The LaTeX code:
f(x) \sim x^2 \quad (x\to\infty)
Now with punctuation:
The LaTeX code:
f(x) = \sqrt{1+x}, \quad x \ge -1
The LaTeX code:
f(x) \sim x^2, \quad x\to\infty
Try again?
Process with KaTex Processed by MathJax
Background and explanation
Read more about KaTeX and the examples above here:
See also: ASCIIMathML, KaTeX and MathJax Demo


Helsinki is a city that offers endless inspiration, yet we sometimes feel like it’s stuck in the shadow of other, better-known Nordic cities. As born and raised Helsinki natives, we want to offer our beloved city all the hype it deserves, and to help people to find places that are that meets the high expectations for quality. HypeHEL is here to tell you what to see, do and experience in Helsinki, the coolest city of the north. ❤