- Commit
- 05177ec8b76ff095dfd58a469984a8c5bc3cd882
- Parent
- 497c4cc9b562ad0be09c2c2ebd901c4b937ef654
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
LaTeX writer: Fixed straight single, double quote.
Added comments about required packages.
My personal build of CMark ✏️
LaTeX writer: Fixed straight single, double quote.
Added comments about required packages.
1 file changed, 8 insertions, 0 deletions
Status | File Name | N° Changes | Insertions | Deletions |
Modified | src/latex.c | 8 | 8 | 0 |
diff --git a/src/latex.c b/src/latex.c @@ -182,9 +182,15 @@ static inline void out(struct render_state *state, utf8proc_encode_char(c, state->buffer); cmark_strbuf_putc(state->buffer, '}'); break; + case 34: // '"' + cmark_strbuf_puts(state->buffer, + "\\textquotedbl{}"); + // requires \usepackage[T1]{fontenc} + break; case 39: // '\'' cmark_strbuf_puts(state->buffer, "\\textquotesingle{}"); + // requires \usepackage{textcomp} break; case 160: // nbsp cmark_strbuf_putc(state->buffer, '~'); @@ -533,6 +539,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, case CMARK_NODE_LINK: if (entering) { url = cmark_chunk_literal(cmark_node_get_url(node)); + // requires \usepackage{hyperref} switch(get_link_type(node)) { case URL_AUTOLINK: lit(state, "\\url{", false); @@ -561,6 +568,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, if (entering) { url = cmark_chunk_literal(cmark_node_get_url(node)); lit(state, "\\protect\\includegraphics{", false); + // requires \include{graphicx} out(state, url, false, URL); lit(state, "}", false); state->silence = true; // don't print the alt text