Skip to content

Commit ec7edf6

Browse files
committed
Updated f string and added a small explanation in the note for clarity.
1 parent e354c98 commit ec7edf6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

notebooks/07_annotations.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@
541541
"\n",
542542
"for i, (xlabel, ylabel) in enumerate(zip([0.5, 1.6, 2.8, 4.2], [0.95, 0.6, 0.5, 0.45])):\n",
543543
" p.line(x, jv(i, x), line_width=3, color=PiYG[4][i])\n",
544-
" p.add_layout(Label(text=r\"$$J_\" + str(i) + \"(x)$$\", x=xlabel, y=ylabel))\n",
544+
" p.add_layout(Label(text=rf\"$$J_{i}(x)$$\", x=xlabel, y=ylabel))\n",
545545
"\n",
546546
"show(p)"
547547
]
@@ -554,11 +554,11 @@
554554
"\n",
555555
"- Use of standard LaTeX delimeters of ``$$``. Other options are available.\n",
556556
"- Use raw Python strings e.g. ``r\"$$\\alpha$$\"`` so that backslashes are interpreted as normal characters rather than control sequences. \n",
557+
" - Raw strings can be used in conjunction with f-strings by using 'rf'.\n",
557558
"- ``Div`` and ``Paragraph`` accept LaTeX for just part of their contents, but for all other elements the whole contents must be LaTeX.\n",
558559
" - To put normal text in a LaTeX string use ``\\text{...}``.\n",
559560
" - We are actively working on improvements in this area.\n",
560561
"\n",
561-
"\n",
562562
"#### Where can LaTeX be used?"
563563
]
564564
},

0 commit comments

Comments
 (0)