Does this issue occur when all extensions are disabled?: Yes/No
- Version…: 1.65.0-insider (user setup)
- Commit: 32456dc9e7d3194a94dd3ee0322ccf47e461d09c
- Date: 2022-02-23T05:16:22.798Z
- OS: WSL
Steps to Reproduce:
1. Open the ipynb file provided in this issue (JSON provided)
2. Notice how errors are displayed in the output `ParseError: KaTeX parse error: No such environment: verbatim at position 7: \begin{̲v̲e̲r̲b̲a̲t̲i̲m̲}̲ rand([rng=GLOB…`
Now, switch the mime type to `text/markdown` and this will work.
<details>
<summary>Here's the ipynb contents generated using Jupyter</summary>
```json
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1234"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"1234"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"search: \u001b[0m\u001b[1mr\u001b[22m\u001b[0m\u001b[1ma\u001b[22m\u001b[0m\u001b[1mn\u001b[22m\u001b[0m\u001b[1md\u001b[22m \u001b[0m\u001b[1mr\u001b[22m\u001b[0m\u001b[1ma\u001b[22m\u001b[0m\u001b[1mn\u001b[22m\u001b[0m\u001b[1md\u001b[22mn t\u001b[0m\u001b[1mr\u001b[22m\u001b[0m\u001b[1ma\u001b[22m\u001b[0m\u001b[1mn\u001b[22msco\u001b[0m\u001b[1md\u001b[22me mac\u001b[0m\u001b[1mr\u001b[22moexp\u001b[0m\u001b[1ma\u001b[22m\u001b[0m\u001b[1mn\u001b[22m\u001b[0m\u001b[1md\u001b[22m @mac\u001b[0m\u001b[1mr\u001b[22moexp\u001b[0m\u001b[1ma\u001b[22m\u001b[0m\u001b[1mn\u001b[22m\u001b[0m\u001b[1md\u001b[22m @mac\u001b[0m\u001b[1mr\u001b[22moexp\u001b[0m\u001b[1ma\u001b[22m\u001b[0m\u001b[1mn\u001b[22m\u001b[0m\u001b[1md\u001b[22m1\n",
"\n"
]
},
{
"data": {
"text/latex": [
"\\begin{verbatim}\n",
"rand([rng=GLOBAL_RNG], [S], [dims...])\n",
"\\end{verbatim}\n",
"Pick a random element or array of random elements from the set of values specified by \\texttt{S}; \\texttt{S} can be\n",
"\n",
"\\begin{itemize}\n",
"\\item an indexable collection (for example \\texttt{1:9} or \\texttt{('x', \"y\", :z)}),\n",
"\n",
"\n",
"\\item an \\texttt{AbstractDict} or \\texttt{AbstractSet} object,\n",
"\n",
"\n",
"\\item a string (considered as a collection of characters), or\n",
"\n",
"\n",
"\\item a type: the set of values to pick from is then equivalent to \\texttt{typemin(S):typemax(S)} for integers (this is not applicable to \\href{@ref}{\\texttt{BigInt}}), to $[0, 1)$ for floating point numbers and to $[0, 1)+i[0, 1)$ for complex floating point numbers;\n",
"\n",
"\\end{itemize}\n",
"\\texttt{S} defaults to \\href{@ref}{\\texttt{Float64}}. When only one argument is passed besides the optional \\texttt{rng} and is a \\texttt{Tuple}, it is interpreted as a collection of values (\\texttt{S}) and not as \\texttt{dims}.\n",
"\n",
"\\begin{quote}\n",
"\\textbf{compat}\n",
"\n",
"Julia 1.1\n",
"\n",
"Support for \\texttt{S} as a tuple requires at least Julia 1.1.\n",
"\n",
"\\end{quote}\n",
"\\section{Examples}\n",
"\\begin{verbatim}\n",
"julia> rand(Int, 2)\n",
"2-element Array{Int64,1}:\n",
" 1339893410598768192\n",
" 1575814717733606317\n",
"\n",
"julia> using Random\n",
"\n",
"julia> rand(MersenneTwister(0), Dict(1=>2, 3=>4))\n",
"1=>2\n",
"\n",
"julia> rand((2, 3))\n",
"3\n",
"\n",
"julia> rand(Float64, (2, 3))\n",
"2×3 Array{Float64,2}:\n",
" 0.999717 0.0143835 0.540787\n",
" 0.696556 0.783855 0.938235\n",
"\\end{verbatim}\n",
"\\begin{quote}\n",
"\\textbf{note}\n",
"\n",
"Note\n",
"\n",
"The complexity of \\texttt{rand(rng, s::Union\\{AbstractDict,AbstractSet\\})} is linear in the length of \\texttt{s}, unless an optimized method with constant complexity is available, which is the case for \\texttt{Dict}, \\texttt{Set} and \\texttt{BitSet}. For more than a few calls, use \\texttt{rand(rng, collect(s))} instead, or either \\texttt{rand(rng, Dict(s))} or \\texttt{rand(rng, Set(s))} as appropriate.\n",
"\n",
"\\end{quote}\n"
],
"text/markdown": [
"```\n",
"rand([rng=GLOBAL_RNG], [S], [dims...])\n",
"```\n",
"\n",
"Pick a random element or array of random elements from the set of values specified by `S`; `S` can be\n",
"\n",
" * an indexable collection (for example `1:9` or `('x', \"y\", :z)`),\n",
" * an `AbstractDict` or `AbstractSet` object,\n",
" * a string (considered as a collection of characters), or\n",
" * a type: the set of values to pick from is then equivalent to `typemin(S):typemax(S)` for integers (this is not applicable to [`BigInt`](@ref)), to $[0, 1)$ for floating point numbers and to $[0, 1)+i[0, 1)$ for complex floating point numbers;\n",
"\n",
"`S` defaults to [`Float64`](@ref). When only one argument is passed besides the optional `rng` and is a `Tuple`, it is interpreted as a collection of values (`S`) and not as `dims`.\n",
"\n",
"!!! compat \"Julia 1.1\"\n",
" Support for `S` as a tuple requires at least Julia 1.1.\n",
"\n",
"\n",
"# Examples\n",
"\n",
"```julia-repl\n",
"julia> rand(Int, 2)\n",
"2-element Array{Int64,1}:\n",
" 1339893410598768192\n",
" 1575814717733606317\n",
"\n",
"julia> using Random\n",
"\n",
"julia> rand(MersenneTwister(0), Dict(1=>2, 3=>4))\n",
"1=>2\n",
"\n",
"julia> rand((2, 3))\n",
"3\n",
"\n",
"julia> rand(Float64, (2, 3))\n",
"2×3 Array{Float64,2}:\n",
" 0.999717 0.0143835 0.540787\n",
" 0.696556 0.783855 0.938235\n",
"```\n",
"\n",
"!!! note\n",
" The complexity of `rand(rng, s::Union{AbstractDict,AbstractSet})` is linear in the length of `s`, unless an optimized method with constant complexity is available, which is the case for `Dict`, `Set` and `BitSet`. For more than a few calls, use `rand(rng, collect(s))` instead, or either `rand(rng, Dict(s))` or `rand(rng, Set(s))` as appropriate.\n",
"\n"
],
"text/plain": [
"\u001b[36m rand([rng=GLOBAL_RNG], [S], [dims...])\u001b[39m\n",
"\n",
" Pick a random element or array of random elements from the set of values\n",
" specified by \u001b[36mS\u001b[39m; \u001b[36mS\u001b[39m can be\n",
"\n",
" • an indexable collection (for example \u001b[36m1:9\u001b[39m or \u001b[36m('x', \"y\", :z)\u001b[39m),\n",
"\n",
" • an \u001b[36mAbstractDict\u001b[39m or \u001b[36mAbstractSet\u001b[39m object,\n",
"\n",
" • a string (considered as a collection of characters), or\n",
"\n",
" • a type: the set of values to pick from is then equivalent to\n",
" \u001b[36mtypemin(S):typemax(S)\u001b[39m for integers (this is not applicable to\n",
" \u001b[36mBigInt\u001b[39m), to \u001b[35m[0, 1)\u001b[39m for floating point numbers and to \u001b[35m[0, 1)+i[0,\n",
" 1)\u001b[39m for complex floating point numbers;\n",
"\n",
" \u001b[36mS\u001b[39m defaults to \u001b[36mFloat64\u001b[39m. When only one argument is passed besides the optional\n",
" \u001b[36mrng\u001b[39m and is a \u001b[36mTuple\u001b[39m, it is interpreted as a collection of values (\u001b[36mS\u001b[39m) and not\n",
" as \u001b[36mdims\u001b[39m.\n",
"\n",
"\u001b[39m\u001b[1m │ \u001b[22m\u001b[39m\u001b[1mJulia 1.1\u001b[22m\n",
"\u001b[39m\u001b[1m │\u001b[22m\n",
"\u001b[39m\u001b[1m │\u001b[22m Support for \u001b[36mS\u001b[39m as a tuple requires at least Julia 1.1.\n",
"\n",
"\u001b[1m Examples\u001b[22m\n",
"\u001b[1m ≡≡≡≡≡≡≡≡≡≡\u001b[22m\n",
"\n",
"\u001b[36m julia> rand(Int, 2)\u001b[39m\n",
"\u001b[36m 2-element Array{Int64,1}:\u001b[39m\n",
"\u001b[36m 1339893410598768192\u001b[39m\n",
"\u001b[36m 1575814717733606317\u001b[39m\n",
"\u001b[36m \u001b[39m\n",
"\u001b[36m julia> using Random\u001b[39m\n",
"\u001b[36m \u001b[39m\n",
"\u001b[36m julia> rand(MersenneTwister(0), Dict(1=>2, 3=>4))\u001b[39m\n",
"\u001b[36m 1=>2\u001b[39m\n",
"\u001b[36m \u001b[39m\n",
"\u001b[36m julia> rand((2, 3))\u001b[39m\n",
"\u001b[36m 3\u001b[39m\n",
"\u001b[36m \u001b[39m\n",
"\u001b[36m julia> rand(Float64, (2, 3))\u001b[39m\n",
"\u001b[36m 2×3 Array{Float64,2}:\u001b[39m\n",
"\u001b[36m 0.999717 0.0143835 0.540787\u001b[39m\n",
"\u001b[36m 0.696556 0.783855 0.938235\u001b[39m\n",
"\n",
"\u001b[36m\u001b[1m │ \u001b[22m\u001b[39m\u001b[36m\u001b[1mNote\u001b[22m\u001b[39m\n",
"\u001b[36m\u001b[1m │\u001b[22m\u001b[39m\n",
"\u001b[36m\u001b[1m │\u001b[22m\u001b[39m The complexity of \u001b[36mrand(rng, s::Union{AbstractDict,AbstractSet})\u001b[39m is\n",
"\u001b[36m\u001b[1m │\u001b[22m\u001b[39m linear in the length of \u001b[36ms\u001b[39m, unless an optimized method with\n",
"\u001b[36m\u001b[1m │\u001b[22m\u001b[39m constant complexity is available, which is the case for \u001b[36mDict\u001b[39m, \u001b[36mSet\u001b[39m\n",
"\u001b[36m\u001b[1m │\u001b[22m\u001b[39m and \u001b[36mBitSet\u001b[39m. For more than a few calls, use \u001b[36mrand(rng, collect(s))\u001b[39m\n",
"\u001b[36m\u001b[1m │\u001b[22m\u001b[39m instead, or either \u001b[36mrand(rng, Dict(s))\u001b[39m or \u001b[36mrand(rng, Set(s))\u001b[39m as\n",
"\u001b[36m\u001b[1m │\u001b[22m\u001b[39m appropriate."
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"?rand"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"interpreter": {
"hash": "826320bbfe537aae42eeb362ae5fce76caa1fa66aa5993e91d7cbda9ea11c7b8"
},
"kernelspec": {
"display_name": "Julia 1.6.4",
"language": "julia",
"name": "julia-1.6.4"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
```
</details>
![image](https://user-images.githubusercontent.com/1948812/155388592-9f2cdaa8-1be3-4f47-8e87-a51f61b49e6b.png)