From: Sebastian Harl Date: Sun, 13 Jun 2010 21:24:17 +0000 (+0200) Subject: l2l_scanner: Print "Abbildung|Listing" in bold font in figure captions. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c4ab7ff98eafd756c7c10b0b8cdd6e62b9089b32;p=lm2latex.git l2l_scanner: Print "Abbildung|Listing" in bold font in figure captions. --- diff --git a/src/l2l_scanner.l b/src/l2l_scanner.l index d02479d..cf7000c 100644 --- a/src/l2l_scanner.l +++ b/src/l2l_scanner.l @@ -436,10 +436,12 @@ ANY_COMMAND @(R|SW|D|T|V|A|L|ZT|LI|B|Bi|IT|IL|IE|KT|KL|KE|TT|TH|TL|TE): * images/boxes */ -@(B|KT):{WHITESPACE}* { +@(B|KT):{WHITESPACE}*((Abbildung|Listing)({WHITESPACE}|\n)+[0-9]+:)? { _Bool is_image = 0; _Bool is_box = 0; + char *label = NULL; + if (! strncmp(yytext, "@B:", 3)) is_image = 1; else if (! strncmp(yytext, "@KT:", 4)) @@ -456,6 +458,14 @@ ANY_COMMAND @(R|SW|D|T|V|A|L|ZT|LI|B|Bi|IT|IL|IE|KT|KL|KE|TT|TH|TL|TE): l2l_scanner_state = L2L_BODY; } + label = strstr(yytext, "Abbildung"); + if (! label) + label = strstr(yytext, "Listing"); + + if (label) + if (l2l_strbuf_append(&l2l_caption, "{\\bfseries %s}", label)) + YY_FATAL_ERROR("ERROR: internal error"); + l2l_buf_ptr = &l2l_caption; if (is_image) BEGIN(caption);