summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1ee7560)
raw | patch | inline | side by side (parent: 1ee7560)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 13 Jun 2010 21:02:48 +0000 (23:02 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 13 Jun 2010 21:02:48 +0000 (23:02 +0200) |
… using the "float" package and a new float environment "l2lbox".
src/l2l.c | patch | blob | history | |
src/l2l_scanner.l | patch | blob | history |
diff --git a/src/l2l.c b/src/l2l.c
index 2fae2b9f2a4ea4bfa6335f16bb91efc7ff36ee58..221fbbba52b5284058a9417697f13b4720c300da 100644 (file)
--- a/src/l2l.c
+++ b/src/l2l.c
"\\fi\n"
"\n"
"\\usepackage{caption}\n"
+"\\usepackage{float}\n"
"\\usepackage{url}\n"
"\n"
+"\\floatstyle{ruled}\n"
+"\\newfloat{l2lbox}{tbp}{lof}\n"
+"\n"
"\\setlength{\\parskip}{6pt}\n"
"\n"
"\\renewcommand{\\headrulewidth}{0.4pt}\n"
diff --git a/src/l2l_scanner.l b/src/l2l_scanner.l
index d769e914a8535b9271bc6438029dcd1719fcf9f5..251b93b3685f683febbaec9b4b7a886cd42ab01d 100644 (file)
--- a/src/l2l_scanner.l
+++ b/src/l2l_scanner.l
*/
@(B|KT):{WHITESPACE}* {
+ _Bool is_image = 0;
+ _Bool is_box = 0;
+
+ if (! strncmp(yytext, "@B:", 3))
+ is_image = 1;
+ else if (! strncmp(yytext, "@KT:", 4))
+ is_box = 1;
+
if (l2l_scanner_state != L2L_FIGURE) {
- fprintf(yyout, "\\begin{figure}\n");
+ if (is_box)
+ fprintf(yyout, "\\begin{l2lbox}\n");
+ else
+ fprintf(yyout, "\\begin{figure}\n");
l2l_scanner_state = L2L_FIGURE;
}
else {
}
l2l_buf_ptr = &l2l_caption;
- if (! strncmp(yytext, "@B:", 3))
+ if (is_image)
BEGIN(caption);
- else if (! strncmp(yytext, "@KT:", 4))
+ else if (is_box)
BEGIN(box_caption);
else
assert(0);
@KL: {
if (l2l_scanner_state != L2L_FIGURE) {
- fprintf(yyout, "\\begin{figure}\n");
+ fprintf(yyout, "\\begin{l2lbox}\n");
l2l_scanner_state = L2L_FIGURE;
}
else {
}
<box>@(KE|L):{WHITESPACE}* {
- fprintf(yyout, "\\end{figure}");
+ fprintf(yyout, "\\end{l2lbox}");
l2l_scanner_state = L2L_BODY;
l2l_last_yystart = INITIAL;
BEGIN(l2l_last_yystart);