To be able to edit code and run cells, you need to run the notebook yourself. Where would you like to run the notebook?

This notebook takes about 20 seconds to run.

In the cloud (experimental)

Binder is a free, open source service that runs scientific notebooks in the cloud! It will take a while, usually 2-7 minutes to get a session.

On your computer

(Recommended if you want to store your changes.)

  1. Copy the notebook URL:
  2. Run Pluto

    (Also see: How to install Julia and Pluto)

  3. Paste URL in the Open box

Frontmatter

If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and social media.

Author 1
"https://github.com/mitmath/JuliaComputation/raw/main/notebooks/Broadening.pdf"
👀 Reading hidden code
url = "https://github.com/mitmath/JuliaComputation/raw/main/notebooks/Broadening.pdf"
10.4 μs
"/tmp/jl_17tXDz"
👀 Reading hidden code
path = download(url)
477 ms
👀 Reading hidden code
data = read(path)
40.1 μs
👀 Reading hidden code
# @htl("""

# <embed src=$(url) width="500" height="375"
# type="application/pdf">
# """)
18.3 μs
👀 Reading hidden code
using HypertextLiteral
: @htl, @htl_str

24.0 ms
👀 Reading hidden code
@htl("""

<script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@3.0.279/build/pdf.min.js" integrity="sha256-DTvuEzaEnHA+06bgzETjueIC6ZR7VSrcVwHOGRY62Yg=" crossorigin="anonymous"></script>
<script id="asdf">

const div = this ?? document.createElement("div")

const data = $(PlutoRunner.publish_to_js(data))

const url = URL.createObjectURL(new Blob([data]))
pdfjsLib.getDocument(url).promise.then((pdf) => {
const page_promises = [...Array(pdf.numPages)].map((_,i) => pdf.getPage(i+1).then((page) => {

let scale = 1.5;
let viewport = page.getViewport({ scale: scale, });
let outputScale = window.devicePixelRatio || 1;
let canvas = document.createElement('canvas');
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
716 ms
import URIs
👀 Reading hidden code
6.6 ms
@htl("""
<iframe style="width: 100%; height: 400px" src=$("https://mozilla.github.io/pdf.js/web/viewer.html?file=$(URIs.escapeuri(url))")></iframe>

""")
👀 Reading hidden code
48.5 ms
@htl("""

<script id="asdf">

const embed = this ?? document.createElement("embed")
embed.style = "width: 100%; height: 400px"

const data = $(PlutoRunner.publish_to_js(data))

const url = URL.createObjectURL(new Blob([data]), { type: "application/pdf" })
embed.type = "application/pdf"
embed.src = url

return embed
</script>

""")
👀 Reading hidden code
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
291 μs
@htl("""

<script id="asdf">

const embed = this ?? document.createElement("iframe")
embed.style = "width: 100%; height: 400px"

const data = $(PlutoRunner.publish_to_js(data))

const url = URL.createObjectURL(new Blob([data]), { type: "application/pdf" })
embed.type = "application/pdf"
embed.src = url

return embed
</script>

""")
👀 Reading hidden code
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
281 μs
# @htl("""

# <script id="asdf">

# const iframe = this ?? document.createElement("iframe")
# iframe.style = "width: 100%; height: 400px"
# iframe.allow = "accelerometer; ambient-light-sensor; autoplay; battery; camera; display-capture; document-domain; encrypted-media; execution-while-not-rendered; execution-while-out-of-viewport; fullscreen; geolocation; gyroscope; layout-animations; legacy-image-formats; magnetometer; microphone; midi; navigation-override; oversized-images; payment; picture-in-picture; publickey-credentials-get; sync-xhr; usb; wake-lock; screen-wake-lock; vr; web-share; xr-spatial-tracking"
# const data = $(PlutoRunner.publish_to_js(data))

# const url = URL.createObjectURL(new Blob([data]), { type: "text/html" })

# iframe.src = `https://mozilla.github.io/pdf.js/web/viewer.html?file=\${encodeURIComponent(url)}`
# return iframe
# </script>

# """)
👀 Reading hidden code
18.2 μs