diff --git a/jishoScrape/src/kanjiTables.js b/jishoScrape/src/kanjiTables.js index 7751952..4d38c39 100644 --- a/jishoScrape/src/kanjiTables.js +++ b/jishoScrape/src/kanjiTables.js @@ -1,5 +1,10 @@ +/** + * Turns an array of kanji into a tabular for a chapter overview + * @param {string[]} kanjiArray A list of kanji to put into the table + * @returns {string} A tex tabular. + */ function kanjiTable(kanjiArray) { - const xLength = 15; + const xLength = 16; const yLength = Math.ceil(kanjiArray.length/xLength); const sideLength = Math.ceil(Math.sqrt(kanjiArray.length)); @@ -8,6 +13,8 @@ function kanjiTable(kanjiArray) { const lineArray = new Array; + lineArray.push(`{\\large ${y_index*16}}`); + for (let x_index = 0; x_index < xLength; x_index++) { const indexNumber = y_index * xLength + x_index; lineArray.push(kanjiArray[indexNumber] ? kanjiArray[indexNumber] : ''); @@ -16,8 +23,8 @@ function kanjiTable(kanjiArray) { tableString += `${lineArray.join(' & ')} \\\\\n` } - return `\\begin{tabular}{ ${'c '.repeat(xLength)}} -${tableString}\\end{tabular}` + return `\\begin{longtable}{ ${'c '.repeat(xLength+1)}} +${tableString}\\end{longtable}` } exports.kanjiTable = kanjiTable; \ No newline at end of file diff --git a/kanjiLib.tex b/kanjiLib.tex index b6b27e2..6f393f0 100644 --- a/kanjiLib.tex +++ b/kanjiLib.tex @@ -12,9 +12,10 @@ \newcommand{\jlptSection}[1]{ \section*{\uppercase{#1}} - \resizebox{\textwidth}{!}{ + \begin{center} + \fontsize{16}{16} \input{./data/tables/#1.tex} - } + \end{center} \localtableofcontents diff --git a/main.tex b/main.tex index cff6497..9e772b9 100644 --- a/main.tex +++ b/main.tex @@ -20,7 +20,7 @@ \setlength{\parskip}{0.5em} \setlength{\parindent}{0pt} -\usepackage{longtable} %N1 table is too long. +\usepackage{longtable} % For multipage tables %Japanese typesetting and fonts \usepackage[japanese]{babel} @@ -31,47 +31,47 @@ \input{./kanjiLib.tex} -\usepackage{etoc} %For local tocs containing level based kanji list. +\usepackage{etoc} % For local tocs containing level based kanji list. \begin{document} -\input{./title/titlepage.tex} + \input{./title/titlepage.tex} -\break + \break -\tableofcontents -\break + \tableofcontents + \break -\section*{Preface} + \section*{Preface} -%TODO: Add more detailed information + %TODO: Add more detailed information -Thanks to Timothy Eyre for making the Choumei font and the edition containing stroke order numbers. You can find his work at \url{https://www.nihilist.org.uk/} + Thanks to Timothy Eyre for making the Choumei font and the edition containing stroke order numbers. You can find his work at \url{https://www.nihilist.org.uk/} -Kanji data is taken from \url{https://jisho.org/} + Kanji data is taken from \url{https://jisho.org/} -This document splits the kanjis into JLPT levels. Please note that there is no official list of kanji JLPT levels. This list is based on \href{http://www.tanos.co.uk/jlpt/skills/kanji/}{tanos.co.uk}. + This document splits the kanjis into JLPT levels. Please note that there is no official list of kanji JLPT levels. This list is based on \href{http://www.tanos.co.uk/jlpt/skills/kanji/}{tanos.co.uk}. -\break + \break -\jlptSection{n5} + \jlptSection{n5} -\input{./data/testing/test.tex} + \input{./data/testing/test.tex} -\jlptSection{n4} + \jlptSection{n4} -% \input{./data/pages/n4.tex} + % \input{./data/pages/n4.tex} -\jlptSection{n3} + \jlptSection{n3} -% \input{./data/pages/n3.tex} + % \input{./data/pages/n3.tex} -\jlptSection{n2} + \jlptSection{n2} -% \input{./data/pages/n2.tex} + % \input{./data/pages/n2.tex} -\jlptSection{n1} + \jlptSection{n1} -% \input{./data/pages/n1.tex} + % \input{./data/pages/n1.tex} \end{document} \ No newline at end of file