mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-19 00:15:39 +03:00
Fix line numbers in LaTeX and HTML with leading comments in code
This commit is contained in:
parent
54c97d1d0c
commit
228b6c830a
@ -135,7 +135,7 @@ let pygmentize_code (c : string Marked.pos) (language : C.backend_lang) : string
|
||||
"style=colorful,anchorlinenos=True,lineanchors=\""
|
||||
^ String_common.to_ascii (Pos.get_file (Marked.get_mark c))
|
||||
^ "\",linenos=table,linenostart="
|
||||
^ string_of_int (Pos.get_start_line (Marked.get_mark c) - 1);
|
||||
^ string_of_int (Pos.get_start_line (Marked.get_mark c) + 1);
|
||||
"-o";
|
||||
temp_file_out;
|
||||
temp_file_in;
|
||||
|
@ -247,7 +247,7 @@ let rec law_structure_to_latex
|
||||
%s```\n\
|
||||
\\end{minted}"
|
||||
(pre_latexify (Filename.basename (Pos.get_file (Marked.get_mark c))))
|
||||
(Pos.get_start_line (Marked.get_mark c) - 1)
|
||||
(Pos.get_start_line (Marked.get_mark c) + 1)
|
||||
(get_language_extension language)
|
||||
(Marked.unmark c)
|
||||
| A.CodeBlock (_, c, true) when not print_only_law ->
|
||||
|
@ -653,7 +653,7 @@ source_file_item:
|
||||
| text = law_text { LawText text }
|
||||
| BEGIN_CODE code_and_pos = code text = END_CODE {
|
||||
let (code, pos) = code_and_pos in
|
||||
CodeBlock (code, (text, pos), false)
|
||||
CodeBlock (code, (text, Pos.from_lpos $sloc), false)
|
||||
}
|
||||
| heading = law_heading {
|
||||
LawHeading (heading, [])
|
||||
|
Loading…
Reference in New Issue
Block a user