[PATCH 1/3] Update qqzreorder.pl to take care of listing at the end of QQA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 75056ec5dd25a1e6daa45cf4592e51fbb26685a8 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@xxxxxxxxx>
Date: Sat, 18 Nov 2017 21:03:23 +0900
Subject: [PATCH 1/3] Update qqzreorder.pl to take care of listing at the end of QQA

Also add a blank line above \begin{listing} so that the reordered
\QuickE{} is output at the right place.

Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
 memorder/memorder.tex   |  1 +
 utilities/qqzreorder.pl | 24 ++++++++++++------------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/memorder/memorder.tex b/memorder/memorder.tex
index 7a72c68..68dc09b 100644
--- a/memorder/memorder.tex
+++ b/memorder/memorder.tex
@@ -2634,6 +2634,7 @@ suffice to prevent the \co{exists} clause from triggering.
 	shows a somewhat nonsensical but very real example.
 	Creating a more useful (but still real) litmus test is left
 	as an exercise for the reader.
+
 \begin{listing}[tbp]
 { \scriptsize
 \begin{verbbox}[\LstLineNo]
diff --git a/utilities/qqzreorder.pl b/utilities/qqzreorder.pl
index 197d5a0..624d68b 100644
--- a/utilities/qqzreorder.pl
+++ b/utilities/qqzreorder.pl
@@ -2,8 +2,8 @@
 #
 # Move line of \QuickE{} below \end{enumerate} to just above
 # the \end{enumerate}.
-# Move line of \QuickE{} below \end{figure} to above
-# \begin{figure} corresponding to it.
+# Move line of \QuickE{} below \end{listing} to above
+# \begin{listing} corresponding to it.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -25,8 +25,8 @@
 
 my $line;
 my $after_end_enum = 0;
-my $in_figure = 0;
-my $after_figure = 0;
+my $in_listing = 0;
+my $after_listing = 0;
 my $line_idx = 1;
 my @line_buf;
 
@@ -42,15 +42,15 @@ while($line = <>) {
 	$after_end_enum = 0;
 	next;
     }
-    if ($in_figure) {
-	if ($line =~ /\\end\{figure\}/) {
-	    $after_figure = 1;
-	    $in_figure = 0;
+    if ($in_listing) {
+	if ($line =~ /\\end\{listing\}/) {
+	    $after_listing = 1;
+	    $in_listing = 0;
 	}
 	$line_buf[++$line_idx] = $line;
 	next;
     }
-    if ($after_figure) {
+    if ($after_listing) {
 	if ($line =~ /%/) {
 	    $line_buf[++$line_idx] = $line;
 	    next;
@@ -68,7 +68,7 @@ while($line = <>) {
 	    $line_buf[1] = $line;
 	}
 	$line_idx = 1;
-	$after_figure = 0;
+	$after_listing = 0;
 	next;
     }
     if ($line =~ /\\end\{enumerate\}/) {
@@ -77,8 +77,8 @@ while($line = <>) {
 	$after_end_enum = 1;
 	next;
     }
-    if ($line =~ /\\begin\{figure\}/) {
-	$in_figure = 1;
+    if ($line =~ /\\begin\{listing\}/) {
+	$in_listing = 1;
 	$line_buf[++$line_idx] = $line;
 	next;
     }
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux