File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -209,20 +209,13 @@ let ocamltag tag pp ppf x = create2 "ocamltag" Fmt.string pp ppf tag x
209
209
210
210
let math ppf x = Fmt. pf ppf {|$% s$| } x
211
211
212
- let remove_empty_last_line x =
213
- let rec find_last_line pos x =
214
- if pos < 0 then x
215
- else
216
- match x.[pos] with
217
- | ' ' | '\012' | '\n' | '\r' | '\t' -> find_last_line (pos - 1 ) x
218
- | _ -> if pos = String. length x - 1 then x else String. sub x 0 (pos + 1 )
219
- in
220
- find_last_line (String. length x - 1 ) x
221
-
222
212
let equation ppf x =
223
213
let name = " equation*" in
224
214
mbegin ppf name;
225
215
Fmt. cut ppf () ;
226
- Fmt. string ppf (remove_empty_last_line x);
216
+ (* A blank line before \end{equation*} is a latex error,
217
+ we trim on the right the user input to avoid any surprise *)
218
+ let x = Astring.String. drop ~rev: true ~sat: Astring.Char.Ascii. is_white x in
219
+ Fmt. string ppf x;
227
220
Fmt. cut ppf () ;
228
221
mend ppf name
You can’t perform that action at this time.
0 commit comments