Skip to content

Commit 6716e45

Browse files
committed
removed newline from TeX output
chore: adapt to updated argument and flag syntax (#570)
1 parent 329b1e8 commit 6716e45

File tree

103 files changed

+875
-882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+875
-882
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ In addition to what Verso provides, there are a number of additional roles, code
7373
Please use the following roles where they make sense:
7474

7575
* `` {lean}`TERM` `` - `TERM` is a Lean term, to be elaborated as such and included it in the rendered document with appropriate highlighting.
76-
The optional named argument `type` specifies an expected type, e.g. `` {lean type:="Nat"}`.succ .zero` ``
76+
The optional named argument `type` specifies an expected type, e.g. `` {lean (type := "Nat")}`.succ .zero` ``
7777

7878
* `` {name}`X` `` - `X` is a constant in the Lean environment.
7979
The optional positional argument can be used to override name resolution; if it is provided, then the positional argument is used to resolve the name but the contents of the directive are rendered.

Manual.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ draft := true
111111

112112
{docstring Dynamic}
113113

114-
{docstring Dynamic.mk (allowMissing := true)}
114+
{docstring Dynamic.mk +allowMissing}
115115

116116
{docstring Dynamic.get?}
117117

Manual/Attributes.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Each attribute determines how to store its own metadata and what the appropriate
5959
Attributes can be added to declarations as a {ref "declaration-modifiers"}[declaration modifier].
6060
They are placed between the documentation comment and the visibility modifiers.
6161

62-
:::syntax Lean.Parser.Term.attributes (open := false) (title := "Attributes")
62+
:::syntax Lean.Parser.Term.attributes -open (title := "Attributes")
6363
```grammar
6464
@[$_:attrInstance,*]
6565
```
@@ -104,7 +104,7 @@ This determines whether the attribute's effect is visible only in the current se
104104
These scope indications are also used to control {ref "syntax-rules"}[syntax extensions] and {ref "instance-attribute"}[type class instances].
105105
Each attribute is responsible for defining precisely what these terms mean for its particular effect.
106106

107-
:::syntax attrKind (open := false) (title := "Attribute Scopes") (alias := Lean.Parser.Term.attrKind)
107+
:::syntax attrKind -open (title := "Attribute Scopes") (alias := Lean.Parser.Term.attrKind)
108108
Globally-scoped declarations (the default) are in effect whenever the {tech}[module] in which they're established is transitively imported.
109109
They are indicated by the absence of another scope modifier.
110110
```grammar
@@ -115,7 +115,7 @@ Locally-scoped declarations are in effect only for the extent of the {tech}[sect
115115
local
116116
```
117117

118-
Scoped declarations are in effect whenever the {tech key:="current namespace"}[namespace] in which they are established is opened.
118+
Scoped declarations are in effect whenever the {tech (key := "current namespace")}[namespace] in which they are established is opened.
119119
```grammar
120120
scoped
121121
```

Manual/Axioms.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ htmlSplit := .never
1919
%%%
2020
:::leanSection
2121

22-
```lean (show := false)
22+
```lean -show
2323
universe u
2424
```
2525

2626
{deftech}_Axioms_ are postulated constants.
2727
While the axiom's type must itself be a type (that is, it must have type {lean}`Sort u`), there are no further requirements.
28-
Axioms do not {tech key:="reduction"}[reduce] to other terms.
28+
Axioms do not {tech (key := "reduction")}[reduce] to other terms.
2929
:::
3030

3131
Axioms can be used to experiment with the consequences of an idea before investing the time required to construct a model or prove a theorem.
@@ -138,7 +138,7 @@ Definitions that contain non-proof code that relies on axioms must be marked {ke
138138
:::example "Axioms and Compilation"
139139
Adding an additional `0` to {lean}`Nat` with an axiom makes it so functions that use it can't be compiled.
140140
In particular, {name}`List.length'` returns the axiom {name}`Nat.otherZero` instead of {name}`Nat.zero` as the length of the empty list.
141-
```lean (name := otherZero2) (error := true)
141+
```lean (name := otherZero2) +error
142142
axiom Nat.otherZero : Nat
143143

144144
def List.length' : List α → Nat
@@ -224,9 +224,9 @@ However, they allow the use of compiled code in proofs to be carefully controlle
224224
```
225225

226226
:::keepEnv
227-
```lean (show := false)
227+
```lean -show
228228
axiom Anything : Type
229229
```
230-
Finally, the axiom {name}`sorryAx` is used as part of the implementation of the {tactic}`sorry` tactic and {lean type:="Anything"}`sorry` term.
230+
Finally, the axiom {name}`sorryAx` is used as part of the implementation of the {tactic}`sorry` tactic and {lean (type := "Anything")}`sorry` term.
231231
Uses of this axiom are not intended to occur in finished proofs, and this can be confirmed using {keywordOf Lean.Parser.Command.printAxioms}`#print axioms`.
232232
:::

Manual/BasicProps.lean

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ However, it should not be confused with {name}`PProd`: using non-computable reas
9999

100100
In a {ref "tactics"}[tactic] proof, conjunctions can be proved using {name}`And.intro` explicitly via {tactic}`apply`, but {tactic}`constructor` is more common.
101101
When multiple conjunctions are nested in a proof goal, {tactic}`and_intros` can be used to apply {name}`And.intro` in each relevant location.
102-
Assumptions of conjunctions in the context can be simplified using {tactic}`cases`, pattern matching with {tactic}`let` or {tactic show:="match"}`Lean.Parser.Tactic.match`, or {tactic}`rcases`.
102+
Assumptions of conjunctions in the context can be simplified using {tactic}`cases`, pattern matching with {tactic}`let` or {tactic (show := "match")}`Lean.Parser.Tactic.match`, or {tactic}`rcases`.
103103

104104
{docstring And}
105105

@@ -113,7 +113,7 @@ Because {lean}`Sum` is a type, it is possible to check _which_ constructor was u
113113
In other words, because {lean}`Or` is not a {tech}[subsingleton], its proofs cannot be used as part of a computation.
114114

115115
In a {ref "tactics"}[tactic] proof, disjunctions can be proved using either constructor ({name}`Or.inl` or {name}`Or.inr`) explicitly via {tactic}`apply`.
116-
Assumptions of disjunctions in the context can be simplified using {tactic}`cases`, pattern matching with {tactic show:="match"}`Lean.Parser.Tactic.match`, or {tactic}`rcases`.
116+
Assumptions of disjunctions in the context can be simplified using {tactic}`cases`, pattern matching with {tactic (show := "match")}`Lean.Parser.Tactic.match`, or {tactic}`rcases`.
117117

118118
{docstring Or}
119119

@@ -125,14 +125,14 @@ This is because the decision procedure's result provides a suitable branch condi
125125
{docstring Or.by_cases'}
126126

127127

128-
```lean (show := false)
128+
```lean -show
129129
section
130130
variable {P : Prop}
131131
```
132132
Rather than encoding negation as an inductive type, {lean}`¬P` is defined to mean {lean}`P → False`.
133133
In other words, to prove a negation, it suffices to assume the negated statement and derive a contradiction.
134134
This also means that {lean}`False` can be derived immediately from a proof of a proposition and its negation, and then used to prove any proposition or inhabit any type.
135-
```lean (show := false)
135+
```lean -show
136136
end
137137
```
138138

@@ -146,7 +146,7 @@ end
146146

147147

148148

149-
```lean (show := false)
149+
```lean -show
150150
section
151151
variable {A B : Prop}
152152
```
@@ -171,7 +171,7 @@ theorem truth_functional_imp {A B : Prop} :
171171
```
172172
:::
173173

174-
```lean (show := false)
174+
```lean -show
175175
end
176176
```
177177

@@ -239,7 +239,7 @@ Unlike both {name}`Subtype` and {name}`Sigma`, it is a {tech}[proposition]; this
239239

240240
When writing a proof, the {tactic}`exists` tactic allows one (or more) witness(es) to be specified for a (potentially nested) existential statement.
241241
The {tactic}`constructor` tactic, on the other hand, creates a {tech}[metavariable] for the witness; providing a proof of the predicate may solve the metavariable as well.
242-
The components of an existential assumption can be made available individually by pattern matching with {tactic}`let` or {tactic show:="match"}`Lean.Parser.Tactic.match`, as well as by using {tactic}`cases` or {tactic}`rcases`.
242+
The components of an existential assumption can be made available individually by pattern matching with {tactic}`let` or {tactic (show := "match")}`Lean.Parser.Tactic.match`, as well as by using {tactic}`cases` or {tactic}`rcases`.
243243

244244
:::example "Proving Existential Statements"
245245

@@ -402,12 +402,12 @@ In these cases, the built-in automation has no choice but to use heterogeneous e
402402
$_ ≍ $_
403403
```
404404

405-
```lean (show := false)
405+
```lean -show
406406
section
407407
variable (x : α) (y : β)
408408
```
409409
Heterogeneous equality {lean}`HEq x y` can be written {lean}`x ≍ y`.
410-
```lean (show := false)
410+
```lean -show
411411
end
412412
```
413413

@@ -418,7 +418,7 @@ end
418418

419419
:::::leanSection
420420
::::example "Heterogeneous Equality"
421-
```lean (show := false)
421+
```lean -show
422422
variable {α : Type u} {n k l₁ l₂ l₃ : Nat}
423423
```
424424

@@ -429,7 +429,7 @@ variable
429429
{xs : Vector α l₁} {ys : Vector α l₂} {zs : Vector α l₃}
430430
set_option linter.unusedVariables false
431431
```
432-
```lean (name := assocFail) (error := true) (keep := false)
432+
```lean (name := assocFail) +error -keep
433433
theorem Vector.append_associative :
434434
xs ++ (ys ++ zs) = (xs ++ ys) ++ zs := by sorry
435435
```
@@ -456,15 +456,15 @@ However, such proof statements can be difficult to work with in certain circumst
456456

457457
:::paragraph
458458
Another is to use heterogeneous equality:
459-
```lean (keep := false)
459+
```lean -keep
460460
theorem Vector.append_associative :
461461
HEq (xs ++ (ys ++ zs)) ((xs ++ ys) ++ zs) := by sorry
462462
```
463463
:::
464464

465465
In this case, {ref "the-simplifier"}[the simplifier] can rewrite both sides of the equation without having to preserve their types.
466466
However, proving the theorem does require eventually proving that the lengths nonetheless match.
467-
```lean (keep := false)
467+
```lean -keep
468468
theorem Vector.append_associative :
469469
HEq (xs ++ (ys ++ zs)) ((xs ++ ys) ++ zs) := by
470470
cases xs; cases ys; cases zs

Manual/BasicTypes.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ In functional programming, {lean}`Unit` is the return type of things that "retur
6969
Mathematically, this is represented by a single completely uninformative value, as opposed to an empty type such as {lean}`Empty`, which represents unreachable code.
7070

7171
:::leanSection
72-
```lean (show := false)
72+
```lean -show
7373
variable {m : TypeType} [Monad m] {α : Type}
7474
```
7575

@@ -85,7 +85,7 @@ There are two variants of the unit type:
8585

8686
* {lean}`Unit` is a {lean}`Type` that exists in the smallest non-propositional {tech}[universe].
8787

88-
* {lean}`PUnit` is {tech key:="universe polymorphism"}[universe polymorphic] and can be used in any non-propositional {tech}[universe].
88+
* {lean}`PUnit` is {tech (key := "universe polymorphism")}[universe polymorphic] and can be used in any non-propositional {tech}[universe].
8989

9090
Behind the scenes, {lean}`Unit` is actually defined as {lean}`PUnit.{1}`.
9191
{lean}`Unit` should be preferred over {name}`PUnit` when possible to avoid unnecessary universe parameters.
@@ -101,7 +101,7 @@ If in doubt, use {lean}`Unit` until universe errors occur.
101101

102102
{deftech}_Unit-like types_ are inductive types that have a single constructor which takes no non-proof parameters.
103103
{lean}`PUnit` is one such type.
104-
All elements of unit-like types are {tech key:="definitional equality"}[definitionally equal] to all other elements.
104+
All elements of unit-like types are {tech (key := "definitional equality")}[definitionally equal] to all other elements.
105105

106106
:::example "Definitional Equality of {lean}`Unit`"
107107
Every term with type {lean}`Unit` is definitionally equal to every other term with type {lean}`Unit`:
@@ -143,7 +143,7 @@ inductive NotUnitLike where
143143
| mk (u : Unit)
144144
```
145145

146-
```lean (error:=true) (name := NotUnitLike)
146+
```lean +error (name := NotUnitLike)
147147
example (e1 e2 : NotUnitLike) : e1 = e2 := rfl
148148
```
149149
```leanOutput NotUnitLike
@@ -186,7 +186,7 @@ However, there is an important pragmatic difference: {lean}`Bool` classifies _va
186186
In other words, {lean}`Bool` is the notion of truth and falsehood that's appropriate for programs, while {lean}`Prop` is the notion that's appropriate for mathematics.
187187
Because proofs are erased from compiled programs, keeping {lean}`Bool` and {lean}`Prop` distinct makes it clear which parts of a Lean file are intended for computation.
188188

189-
```lean (show := false)
189+
```lean -show
190190
section BoolProp
191191

192192
axiom b : Bool
@@ -211,7 +211,7 @@ These propositions are called {tech}_decidable_ propositions, and have instances
211211
The function {name}`Decidable.decide` converts a proof-carrying {lean}`Decidable` result into a {lean}`Bool`.
212212
This function is also a coercion from decidable propositions to {lean}`Bool`, so {lean}`(2 = 2 : Bool)` evaluates to {lean}`true`.
213213

214-
```lean (show := false)
214+
```lean -show
215215
/-- info: true -/
216216
#check_msgs in
217217
#eval (2 = 2 : Bool)
@@ -246,7 +246,7 @@ The prefix operator `!` is notation for {lean}`Bool.not`.
246246

247247
### Logical Operations
248248

249-
```lean (show := false)
249+
```lean -show
250250
section ShortCircuit
251251

252252
axiom BIG_EXPENSIVE_COMPUTATION : Bool
@@ -256,7 +256,7 @@ The functions {name}`cond`, {name Bool.and}`and`, and {name Bool.or}`or` are sho
256256
In other words, {lean}`false && BIG_EXPENSIVE_COMPUTATION` does not need to execute {lean}`BIG_EXPENSIVE_COMPUTATION` before returning `false`.
257257
These functions are defined using the {attr}`macro_inline` attribute, which causes the compiler to replace calls to them with their definitions while generating code, and the definitions use nested pattern matching to achieve the short-circuiting behavior.
258258

259-
```lean (show := false)
259+
```lean -show
260260
end ShortCircuit
261261
```
262262

Manual/BasicTypes/Array/FFI.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set_option pp.rawOnError true
2020
tag := "array-ffi"
2121
%%%
2222

23-
:::ffi "lean_string_object" kind := type
23+
:::ffi "lean_string_object" (kind := type)
2424
```
2525
typedef struct {
2626
lean_object m_header;

Manual/BasicTypes/BitVec.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Because {name}`BitVec` is a {ref "inductive-types-trivial-wrappers"}[trivial wra
4040

4141
# Syntax
4242
:::leanSection
43-
```lean (show := false)
43+
```lean -show
4444
variable {w n : Nat}
4545
```
4646
There is an {inst}`OfNat (BitVec w) n` instance for all widths {lean}`w` and natural numbers {lean}`n`.
@@ -55,7 +55,7 @@ example : BitVec 8 := 0xff
5555
example : BitVec 8 := 255
5656
example : BitVec 8 := 0b1111_1111
5757
```
58-
```lean (show := false)
58+
```lean -show
5959
-- Inline test
6060
example : (0xff : BitVec 8) = 255 := by rfl
6161
example : (0b1111_1111 : BitVec 8) = 255 := by rfl
@@ -147,7 +147,7 @@ example : BitVec 8 := 1#'(by decide)
147147
```
148148

149149
Literals that are not in bounds are not allowed:
150-
```lean (error := true) (name := oob)
150+
```lean +error (name := oob)
151151
example : BitVec 8 := 256#'(by decide)
152152
```
153153
```leanOutput oob

Manual/BasicTypes/Fin.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ open Verso.Genre.Manual.InlineLean
1818
tag := "Fin"
1919
%%%
2020

21-
```lean (show := false)
21+
```lean -show
2222
section
2323
variable (n : Nat)
2424
```
@@ -92,7 +92,7 @@ When the literal is greater than or equal to {lean}`n`, the remainder when divid
9292
```
9393

9494
If Lean can't synthesize an instance of {lean}`NeZero n`, then there is no {lean}`OfNat (Fin n)` instance:
95-
```lean (error := true) (name := fin0)
95+
```lean +error (name := fin0)
9696
example : Fin 0 := 0
9797
```
9898
```leanOutput fin0
@@ -105,7 +105,7 @@ due to the absence of the instance above
105105
Hint: Additional diagnostic information may be available using the `set_option diagnostics true` command.
106106
```
107107

108-
```lean (error := true) (name := finK)
108+
```lean +error (name := finK)
109109
example (k : Nat) : Fin k := 0
110110
```
111111
```leanOutput finK

Manual/BasicTypes/Float.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ Lean provides two floating-point types: {name}`Float` represents 64-bit floating
3838
The precision of {name}`Float` does not vary based on the platform that Lean is running on.
3939

4040

41-
{docstring Float (label := "type") (hideStructureConstructor := true) (hideFields := true)}
41+
{docstring Float (label := "type") +hideStructureConstructor +hideFields}
4242

43-
{docstring Float32 (label := "type") (hideStructureConstructor := true) (hideFields := true)}
43+
{docstring Float32 (label := "type") +hideStructureConstructor +hideFields}
4444

4545

4646
:::example "No Kernel Reasoning About Floating-Point Numbers"
47-
The Lean kernel can compare expressions of type {lean}`Float` for syntactic equality, so {lean type:="Float"}`0.0` is definitionally equal to itself.
47+
The Lean kernel can compare expressions of type {lean}`Float` for syntactic equality, so {lean (type := "Float")}`0.0` is definitionally equal to itself.
4848
```lean
4949
example : (0.0 : Float) = (0.0 : Float) := by rfl
5050
```
5151

5252
Terms that require reduction to become syntactically equal cannot be checked by the kernel:
53-
```lean (error := true) (name := zeroPlusZero)
53+
```lean +error (name := zeroPlusZero)
5454
example : (0.0 : Float) = (0.0 + 0.0 : Float) := by rfl
5555
```
5656
```leanOutput zeroPlusZero
@@ -63,7 +63,7 @@ is not definitionally equal to the right-hand side
6363
```
6464

6565
Similarly, the kernel cannot evaluate {lean}`Bool`-valued comparisons of floating-point numbers while checking definitional equality:
66-
```lean (error := true) (name := zeroPlusZero') (keep := false)
66+
```lean +error (name := zeroPlusZero') -keep
6767
theorem Float.zero_eq_zero_plus_zero :
6868
((0.0 : Float) == (0.0 + 0.0 : Float)) = true :=
6969
by rfl
@@ -141,7 +141,7 @@ is syntactic sugar for
141141
(OfScientific.ofScientific 41352 true 2 : Float32)
142142
```
143143

144-
```lean (show := false)
144+
```lean -show
145145
example : (-2.2523 : Float) = (Neg.neg (OfScientific.ofScientific 22523 true 4) : Float) := by simp [OfScientific.ofScientific]
146146
example : (413.52 : Float32) = (OfScientific.ofScientific 41352 true 2 : Float32) := by simp [OfScientific.ofScientific]
147147
```

0 commit comments

Comments
 (0)