Zulip Chat Archive
Stream: general
Topic: How to write Lean code in spoilers
Kevin Buzzard (Nov 30 2025 at 23:15):
(this comment was moved to a new thread from under a comment where there was Lean code without syntax highlighting in a spoiler block)
In spoilers you can use ````lean4 and end with ```` to quote code.
Aaron Liu (Nov 30 2025 at 23:16):
I think you have to should use lean4 because lean is lean3
Kevin Buzzard (Nov 30 2025 at 23:19):
(Testing indicates that you're right; I edited)
Michael Rothgang (Nov 30 2025 at 23:28):
Thanks; corrected!
Yaël Dillies (Dec 01 2025 at 07:12):
Aaron Liu said:
I think you
have toshould use lean4 because lean is lean3
You can also nothing since the default language for code blocks is lean4 on this Zulip
Kevin Buzzard (Dec 01 2025 at 10:27):
My point was that doing nothing doesn't work in the spoiler case, that was why I brought this up.
Notification Bot (Dec 01 2025 at 10:28):
6 messages were moved here from #Is there code for X? > Cotangent Bundle as a Manifold by Kevin Buzzard.
Yaël Dillies (Dec 01 2025 at 10:29):
Really?
Yaël Dillies (Dec 01 2025 at 10:30):
Oh indeed, that's very surprising! Could be worth bringing it up to the Zulip people.
Anne Baanen (Dec 01 2025 at 10:56):
IIRC, lean meaning Lean 3 is a choice by the code highlighter that Zulip depends on. So if we fix it in that project, it should (eventually) make its way to Zulip too. But I don't know the right keywords to search for...
Yaël Dillies (Dec 01 2025 at 11:05):
@Eric Wieser should know what to do
Eric Wieser (Dec 02 2025 at 23:23):
Anne Baanen said:
IIRC,
leanmeaning Lean 3 is a choice by the code highlighter that Zulip depends on. So if we fix it in that project, it should (eventually) make its way to Zulip too. But I don't know the right keywords to search for...
This was a deliberate choice to preserve existing documents that used lean to highlight lean3 code
Eric Wieser (Dec 02 2025 at 23:23):
I think for quite some time this was true of python vs python3 too
Eric Wieser (Dec 02 2025 at 23:23):
The highlighter in question is Pygments
Eric Wieser (Dec 02 2025 at 23:24):
Probably we also need to update it with all the new private meta import etc keywords
Eric Wieser (Dec 02 2025 at 23:25):
(note here that "documents" includes the source code of old LaTeX papers using minted for Lean 3)
Jakub Nowak (Dec 03 2025 at 00:17):
Maybe related. I can type "<grave> <grave> <grave> l <TAB>", and this will automatically complete "l" to "lean4" and create closing "<grave> <grave> <grave>". Inside spoiler it still completes "l" to "lean4", but doesn't create closing "<grave> <grave> <grave>".
Kevin Buzzard (Dec 03 2025 at 01:32):
Inside spoiler you're probably already in a three-grave situation, so you might be closing it not opening it.
Last updated: Dec 20 2025 at 21:32 UTC