hack to put comparison table on one page
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 22 Jul 2022 22:23:35 +0000 (23:23 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 22 Jul 2022 22:23:35 +0000 (23:23 +0100)
openpower/Makefile
openpower/mdwn_inline.py
openpower/simple_v_spec.tex
openpower/sv/comparison_table.mdwn
openpower/texmunge.py [new file with mode: 0755]

index 5d9c2d89d3382245439423144120a32c8694a268..bf9e9f55a8e7731b80103b6b0427217d142272a1 100755 (executable)
@@ -49,7 +49,8 @@ tex_out/comparison_table.tex : sv/comparison_table.mdwn
        mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
                --filter pandoc_img.py \
-            -N -o tex_out/comparison_table.tex sv/comparison_table.mdwn
+            -N -o tex_out/comparison_table_pre.tex sv/comparison_table.mdwn
+       ./texmunge.py tex_out/comparison_table_pre.tex tex_out/comparison_table.tex 
 
 tex_out/vector_isas.tex : sv/vector_isa_comparison.mdwn
        mkdir -p tex_out
index cea39fe21d3958bc977e03d7e9a629d6c94e8cc9..53d30ac08f20e8af89f679c8303200dd1f706b94 100755 (executable)
@@ -5,6 +5,11 @@ import sys
 with open(sys.argv[2], "w") as o:
     with open(sys.argv[1], "r") as f:
         for line in f.readlines():
+            if sys.argv[1].endswith("comparison_table.tex") and \
+                line.startswith("\begin{itemize}"):
+                o.write(line)
+                o.write("\\itemsep -0.3em\n")
+                continue
             if not line.startswith("[[!inline"):
                 o.write(line)
                 continue
index d640fc438f73a2553b56348d18a02721e044a496..679f81ecdbecffc72a1bbbc566a6a43902dbda5d 100644 (file)
@@ -184,6 +184,16 @@ For questions, comments, and clarification, please contact the following:
     \item Andrey Miroshnikov - Libre-SOC engineer, assisting with documentation - andrey@technepisteme.xyz
 \end{itemize}
 
+\begin{landscape}
+\chapter*{Comparison Table}
+\addcontentsline{toc}{chapter}{Comparison Table} \markboth{INTRODUCTION}{}
+\hypertarget{svux2fcomparison_table}{}
+{
+\fontsize{6}{8}\selectfont
+\input{tex_out/comparison_table.tex}
+}
+\end{landscape}
+
 \part{Scalable Vectors Primer}
 \input{svp64-primer/acronyms}
 \chapter*{Executive Summary}
@@ -251,14 +261,6 @@ For questions, comments, and clarification, please contact the following:
 }
 \end{landscape}
 
-\chapter{Comparison Table}\hypertarget{svux2fcomparison_table}{}
-\begin{landscape}
-{
-\fontsize{7}{9}\selectfont
-\input{tex_out/comparison_table.tex}
-}
-\end{landscape}
-
 \end{appendices}
 
 \part{Scalar Instructions}
index 224f12ae3b1cf7d56be5b9a8c35e19fa6d5e5477..776a446578c530bd63a83d1512e0f4aa3aea0934 100644 (file)
@@ -1,4 +1,3 @@
-# ISA Comparison Table
 
 | ISA <br>name   | Num <br>opcodes | Taxonomy / <br> Class | Predicate <br> Masks | Twin <br> Predication |  Explicit <br> Vector regs | 128-bit | Bigint <br> capability | LDST <br> Fault-First | Data-dependent <br> Fail-first | Predicate-<br> Result | Matrix HW<br> support |
 |----------------|-----------------|-----------------------|----------------------|-----------------------|----------------------------|---------|------------------------|-----------------------|--------------------------------|-----------------------|-----------------------|
diff --git a/openpower/texmunge.py b/openpower/texmunge.py
new file mode 100755 (executable)
index 0000000..f8bc1c5
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+
+import sys
+
+with open(sys.argv[2], "w") as o:
+    with open(sys.argv[1], "r") as f:
+        for line in f.readlines():
+
+            if sys.argv[1].endswith("comparison_table_pre.tex") and \
+               line.startswith(r"\begin{itemize}"):
+                o.write(line)
+                o.write("\\itemsep -0.3em\n")
+                continue
+            o.write(line)