Skip to content

Commit

Permalink
Fix shit for latex output
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Mar 1, 2024
1 parent 6dbb995 commit 82e95fa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
3 changes: 3 additions & 0 deletions directive.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@
do (incf cursor))
(match! "| " line cursor)))

(defmethod consume-end ((_ blockquote-header) component parser line cursor)
cursor)

(defclass blockquote (block-directive)
())

Expand Down
28 changes: 20 additions & 8 deletions latex/latex.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@
(when (scan-type component 'components:strikethrough)
(texfun! usepackage {cancel}))
(when (scan-type component 'components:blockquote)
(texfun! usepackage {csquotes}))
(texfun! usepackage {csquotes})
(texfun! usepackage {tabularx})
(texfun! usepackage {array}))
(when (scan-type component 'components:code-block)
(texfun! usepackage {minted}))
(when (scan-type component 'components:align)
Expand Down Expand Up @@ -171,13 +173,23 @@

(define-tex-output components:blockquote-header)
(define-tex-output components:blockquote
(texfun textquote [)
(when (components:source component)
(loop for child across (components:children (components:source component))
do (cl-markless:output child)))
(format stream "]{~%")
(call-next-method)
(format stream "~&}~%"))
(cond ((= 0 (components:indentation component))
(texfun textquote [)
(when (components:source component)
(loop for child across (components:children (components:source component))
do (output child)))
(format stream "][]{~%")
(call-next-method)
(format stream "~&}~%"))
(T
(format stream "~&\\noindent")
(texfun! begin{tabularx} "{\\textwidth}{m{5em}X}")
(loop for child across (components:children (components:source component))
do (output child))
(format stream " & ")
(call-next-method)
(format stream " \\\\")
(texfun! end{tabularx}))))

(define-tex-output components:unordered-list
(texfun! begin{itemize})
Expand Down

0 comments on commit 82e95fa

Please sign in to comment.