Generate MathJax for the Golden Ratio Continued Fraction In anticipation of MathJax being temporarily disabled, the rendered MathJax in this question has been replaced with images. You are still welcome to post answers but you'll have to view the rendered MathJax on another site.

PPCG just got MathJax! This means we can now easily include well formatted mathematical formulas into posts. (Handy MathJax tutorial.)

For example, here is the golden ratio expressed as an infinite continued fraction:



The MathJax code for this equation is

$$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}}$$

You can find this by right clicking the formula and following Show Math As &rarr; TeX Commands.
The $$ means it is displayed on its own in the center of the page instead of inline. Use a single $ for inline.

Challenge

Write a program that takes in a non-negative integer, n, and outputs the MathJax code for that many "steps" of the continued fraction for the golden ratio.

To keep things standard across answers, you must use this exact MathJax syntax:


For n = 0, the output must be $$\varphi=1+\dots$$.
Which is rendered as:


For n = 1, the output must be $$\varphi=1+\cfrac1{1+\ddots}$$.
Which is rendered as:


For n = 2, the output must be $$\varphi=1+\cfrac1{1+\cfrac1{1+\ddots}}$$.
Which is rendered as:


For n = 3, the output must be $$\varphi=1+\cfrac1{1+\cfrac1{1+\cfrac1{1+\ddots}}}$$.
Which is rendered as:




This pattern continues on for larger n. You could say that n represents the number of division lines in the equation.

Notes


\cfrac is used instead of the more common \frac.
\dots is used instead of \ddots for n = 0.
Take input from stdin or the command line.
Output to stdout (with an optional trailing newline).
Alternatively, you may write a function that takes in n as an integer and returns the MathJax code as a string (or still prints it).


Scoring

The smallest submission in bytes wins. Tiebreaker goes to the earlier submission.
Python, 70 68 67 bytes



lambda n:"$$\\varphi=1+\%sdots%s$$"%("cfrac1{1+\\"*n+"d"[:n],"}"*n)


This defines an anonymous function which just uses simple string multiplication and string formatting.

(Thanks to @xnor for pointing out that \\c can just be written as \c, since c can't be escaped. Unfortunately this doesn't hold true for \\v, since \v is ASCII 11.)

Previous attempts:

lambda n:"$$\\varphi="+"1+\\cfrac1{"*n+"1+\\"+"ddots"[n&lt;1:]+"}"*n+"$$"
lambda n:r"$$\varphi=%s1+\%s$$"%("1+\cfrac1{"*n,"ddots"[n&lt;1:]+"}"*n)