diff --git a/src/main/java/org/stfm/texdoclet/HelpOutput.java b/src/main/java/org/stfm/texdoclet/HelpOutput.java index 755d6eb..a26040d 100644 --- a/src/main/java/org/stfm/texdoclet/HelpOutput.java +++ b/src/main/java/org/stfm/texdoclet/HelpOutput.java @@ -62,11 +62,13 @@ public class HelpOutput { System.err .println("-hr Prints horizontal rows in the output (to get a better? view)."); System.err - .println("-include Creates output without latex initiation (writes it in initdocsinclude.tex), titlepage, contents."); + .println("-include Creates output in two seperated latex documents: one for the preamble part and another for the actual java documentation content."); System.err .println("-sectionlevel Specifies the highest level of sections (either \"subsection\", \"section\" or \"chapter\")."); System.err .println("-imagespath Path to the texdoclet_images dir (absolute or relative to the output document .tex file)."); + System.err + .println("-tablescale Scale factor to specify width of tables. Default value is 0.9."); } diff --git a/src/main/java/org/stfm/texdoclet/TableInfo.java b/src/main/java/org/stfm/texdoclet/TableInfo.java index 15b2cd2..f54b1d3 100755 --- a/src/main/java/org/stfm/texdoclet/TableInfo.java +++ b/src/main/java/org/stfm/texdoclet/TableInfo.java @@ -17,7 +17,7 @@ import javax.swing.text.html.HTML; *
* Here is an example table. *

- * + *
* * *
Column 1 Heading * Column two heading @@ -31,13 +31,12 @@ import javax.swing.text.html.HTML; * left *
- * + *
* * - * - * + * + * * * * @@ -50,17 +49,17 @@ import javax.swing.text.html.HTML; * *
A nested table example *
Column 1 HeadingColudliadfuapfd a fia fopia foipapio dupoau foapoifd pdpfiu apsd - * oipoioaofiduaopiufopiiiiiiiiiimn two headingColumn one HeadingColumn two headingColumn three heading
data * *
- *    1
- *  2
+ *  1
+ *   2
  *  3
- *  4
+ *    4
  * 
* *
* *
- *    first line
+ *  first line
  *  second line
  *  third line
  *  fourth line
@@ -176,7 +175,7 @@ public class TableInfo {
 	 *            into.
 	 */
 	public StringBuffer endTable() {
-		originalBuffer.append("\n% Table #" + tblno + "\n");
+		originalBuffer.append("\n% Table #" + tblno + "\n\\begin{center}\n");
 		int col = totalcolcnt;
 		if (col == 0) {
 			col = 1;
@@ -187,7 +186,7 @@ public class TableInfo {
 			originalBuffer.append("\\newlength{\\tbl" + tc + "c" + cc + "w}\n");
 			// originalBuffer.append("\\setlength{\\tbl"+tc+"c"+cc+"w}{"+(1.0/col)+"\\hsize}\n");
 			originalBuffer.append("\\setlength{\\tbl" + tc + "c" + cc + "w}{"
-					+ (1.0 / col) + "\\linewidth}\n");
+					+ (TeXDoclet.tableWidthScale / col) + "\\linewidth}\n");
 		}
 		if (red != -1.0 && green != -1.0 && blue != -1.0) {
 			originalBuffer.append("\\colorbox[rgb]{" + Double.toString(red)
@@ -216,6 +215,7 @@ public class TableInfo {
 			originalBuffer.append("}\n");
 		}
 
+		originalBuffer.append("\\end{center}\n");
 		return originalBuffer;
 	}
 
diff --git a/src/main/java/org/stfm/texdoclet/TeXDoclet.java b/src/main/java/org/stfm/texdoclet/TeXDoclet.java
index 573b84a..f206f7d 100755
--- a/src/main/java/org/stfm/texdoclet/TeXDoclet.java
+++ b/src/main/java/org/stfm/texdoclet/TeXDoclet.java
@@ -181,6 +181,7 @@ public class TeXDoclet extends Doclet {
 	static String imagesPath = null;
 	static String subtitle = null;
 	static String introFile = null;
+	static double tableWidthScale = 0.9;
 
 	public static void main(String args[]) {
 
@@ -308,6 +309,8 @@ public class TeXDoclet extends Doclet {
 			return 2;
 		} else if (option.equals("-texintro")) {
 			return 2;
+		} else if (option.equals("-tablescale")) {
+			return 2;
 		}
 		System.out.println("unknown option " + option);
 		return Doclet.optionLength(option);
@@ -405,6 +408,8 @@ public class TeXDoclet extends Doclet {
 				subtitle = args[i][1];
 			} else if (args[i][0].equals("-texintro")) {
 				introFile = args[i][1];
+			} else if (args[i][0].equals("-tablescale")) {
+				tableWidthScale = Double.parseDouble(args[i][1]);
 			}
 
 			if (sectionLevelMax != null
@@ -676,28 +681,44 @@ public class TeXDoclet extends Doclet {
 			os.println("}");
 		}
 
+		addFile(os, finishFile, false);
+
 		if (appendencies.size() > 0) {
-			os.println("\\appendix");
+			// os.println("\\appendix");
+			// Iterator it = appendencies.keySet().iterator();
+			// int i = 0;
+			// while (it.hasNext()) {
+			// os.println("\\" + sectionLevels[0] + "{}{");
+			// os.println(" \\label{appendix" + (i + 1) + "}");
+			// String sfa = (String) it.next();
+			// // System.out.println(sfa);
+			// addFile(os, sfa, true);
+			// os.println("}");
+			// i++;
+			// }
+			os.println("\\begin{appendix}");
 			Iterator it = appendencies.keySet().iterator();
 			int i = 0;
 			while (it.hasNext()) {
-				os.println("\\" + sectionLevels[0] + "{}{");
-				os.println(" \\label{appendix" + (i + 1) + "}");
 				String sfa = (String) it.next();
-				// System.out.println(sfa);
+				File f = new File(sfa);
+				String fname = f.getName().replace("_", "\\_");
+				System.out.println(fname);
+				os.println("\\" + sectionLevels[0] + "{File " + fname + "}{");
+				os.println(" \\label{appendix" + (i + 1) + "}");
+
 				addFile(os, sfa, true);
 				os.println("}");
 				i++;
 			}
+			os.println("\\end{appendix}");
 		}
 
-		os.println("\\markboth{}{}");
+		// os.println("\\markboth{}{}");
 		if (index) {
 			os.println("\\printindex");
 		}
 
-		addFile(os, finishFile, false);
-
 		if (!includeTexOutputInOtherTexFile) {
 			os.println("\\end{document}");
 		}
diff --git a/src/main/java/org/stfm/texdoclet/doc-files/appendix_a.html b/src/main/java/org/stfm/texdoclet/doc-files/appendix_a.html
index bfe054d..37bb52d 100644
--- a/src/main/java/org/stfm/texdoclet/doc-files/appendix_a.html
+++ b/src/main/java/org/stfm/texdoclet/doc-files/appendix_a.html
@@ -1,2 +1,2 @@
-

Appendix A content

-content of file doc-files/appendix_a.html \ No newline at end of file +

Appendix A content +

content of file doc-files/appendix_a.html \ No newline at end of file