mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 14:23:07 +02:00
feat: life is cruel and full of zasadzkas
This commit is contained in:
parent
dffd938862
commit
8aac30472f
Binary file not shown.
@ -0,0 +1,426 @@
|
||||
\documentclass[12pt]{article}
|
||||
|
||||
\usepackage{listings}
|
||||
\usepackage{graphicx}
|
||||
|
||||
\lstset{
|
||||
basicstyle=\small,
|
||||
breaklines=true
|
||||
}
|
||||
|
||||
|
||||
\date{\today}
|
||||
\title{ECOTE - preliminary project \\
|
||||
Translator of a \LaTeX \, subset to HTML
|
||||
}
|
||||
\author{Krzysztof Rudnicki, 307585 \\
|
||||
Semester: 2023L}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\section{General overview and assumptions}
|
||||
My task is to create a translator of \LaTeX \, subset to selected text format with focus on \LaTeX \, tables \\
|
||||
I decided to change to translator of \LaTeX \, subset to HTML since I know \LaTeX \, very well and HTML relatively well, I decide to translate \LaTeX into HTML since HTML is easy, a little bit different than \LaTeX and popular which makes this translator a practical tool.
|
||||
\subsection{Assumptions}
|
||||
\begin{itemize}
|
||||
\item No \LaTeX \, (\%) comments in the script
|
||||
\item There are no extra packages in \LaTeX \, script (provided with \\ \textbackslash usepackage keyword) besides ones distributed with \LaTeX
|
||||
\item There are no extra classes in \LaTeX \, script besides ones distributed with \LaTeX
|
||||
\item There is nothing between \textbackslash documentclass keyword and \\ \textbackslash begin\{document\} keyword
|
||||
\item No standard \LaTeX \, instructions are modified in the script
|
||||
\item "Tables" will be represented using \LaTeX \, \emph{table} environment
|
||||
\end{itemize}
|
||||
\section{Functional requirements}
|
||||
The goal of the project is to transform .tex file to (working ) .html file if the subset of .tex file is within project scope or output error message explaining why the html could not be outputed
|
||||
\subsection{\LaTeX \, subset}
|
||||
This project will focus almost exclusively on \emph{tabular} environment \\
|
||||
\begin{itemize}
|
||||
\item $\backslash$documentclass\{class\}: Defines what layout standard \LaTeX will use
|
||||
\item $\backslash$begin\{document\}: Ends (in our case empty) preamble
|
||||
\item $\backslash$end\{document\}: Ends \LaTeX \, document
|
||||
\item $\backslash$begin\{tabular\}[pos]\{table spec\}: Opens environment used to typeset tables
|
||||
\item $\backslash$end\{tabular\}: Closes environment used to typeset tables
|
||||
\end{itemize}
|
||||
Supported tabular arguments:
|
||||
\begin{itemize}
|
||||
\item l, c, r - respectively left-justified, centered and right-justified column
|
||||
\item | - single vertical line
|
||||
\item || - double vertical line
|
||||
\item p\{'width'\} - paragraph column (that wraps), aligned at the top
|
||||
\item m\{'width'\} - paragraph column (that wraps), aligned at the middle
|
||||
\item b\{'width'\} - paragraph column (that wraps), aligned at the bottom
|
||||
\end{itemize}
|
||||
|
||||
Supported commands inside tabular environment
|
||||
\begin{itemize}
|
||||
\item \& - separate columns
|
||||
\item $\backslash$$\backslash$ - start new row
|
||||
\item $\backslash$hline - horizontal line
|
||||
\item $\backslash$cline\{i-j\} horizontal line beginning in column i and ending in column j
|
||||
\item $\backslash$newline - new line \emph{inside} the cell
|
||||
\end{itemize}
|
||||
\section{Implementation}
|
||||
I decided to use Python as a language in which I will implement my solution \\
|
||||
The reasons for using python are as follow:
|
||||
\begin{enumerate}
|
||||
\item It is the easiest language among those that I know
|
||||
\item I know it enough to be confident in my ability to implement this solution in python
|
||||
\item I want to learn python more through this project
|
||||
\end{enumerate}
|
||||
Negative aspects of python which is that it is very slow language do not bother me as I believe the project scope will not be big enough for this to become an issue
|
||||
|
||||
\subsection{General architecture}
|
||||
\begin{tabular}{|l|p{10cm}|}
|
||||
\hline
|
||||
Module & Description \\
|
||||
\hline
|
||||
Main & Handles parameters inputed as program arguments and interaction between modules \\
|
||||
\hline
|
||||
FileHandler & Handles file reading \\
|
||||
\hline
|
||||
LatexHandler & reads \LaTeX \, file content, parses it using LatexWalker class of pylatexenc library and detects errors \\
|
||||
\hline
|
||||
TabHandler & Transforms tabular environment into html table
|
||||
\\
|
||||
\hline
|
||||
TabArgHandler & Handles positional and table spec arguments of tabular environment and translates them to html \\
|
||||
\hline
|
||||
TabInsideHandler & Handles actual content of table and translates them to html \\
|
||||
\hline
|
||||
HTMLOutput class & Transforms \LaTeX \, code into html with the assumptions that no errors were found by LatexHandler and if there were any they were dealt with \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
|
||||
|
||||
\begin{figure}[h]
|
||||
\caption{Module class diagram}
|
||||
\includegraphics[width=\textwidth]{class.png}
|
||||
\end{figure}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\subsection{Data structures}
|
||||
\begin{itemize}
|
||||
\item File entered by user is represented by python File class
|
||||
\item Parsed \LaTeX \, code is represented by data structure based on node classes
|
||||
\item Tabular environment parameters are stored in an array, if the parameter contains additional optional parameters they are stored in a pair of the parent argument and array of all optional arguments
|
||||
\item Generated HTML code is stored in node classes
|
||||
\item Final HTML code is stored in plain text and then written to File
|
||||
\end{itemize}
|
||||
|
||||
\subsection{Module descriptions}
|
||||
\subsubsection{Main}
|
||||
Handles user arguments and communication between modules \\
|
||||
Input: \\
|
||||
args[] - Array of user inputed arguments \\
|
||||
Functions:
|
||||
\begin{itemize}
|
||||
\item Handle arguments - Checks if arguments are correct and adjust program to their contents, in particular saves tex file path
|
||||
\item Invoke FileHandler - starts file handler class and gets returned file or errors
|
||||
\item Invoke Latex Handler - Sends file from file handler to LatexHandler
|
||||
\end{itemize}
|
||||
\subsubsection{FileHandler}
|
||||
Reads file from filename provided by user and at the end saves HTML file \\
|
||||
Parameters: \\
|
||||
\begin{itemize}
|
||||
\item filename - user entered tex filename
|
||||
\item saveFilename - (optional) filename for output file
|
||||
\item HTMLFile - converted final html file in File format
|
||||
\item LatexFile - latex file in File format
|
||||
\end{itemize}
|
||||
Functions:
|
||||
\begin{itemize}
|
||||
\item ReadFile - Using user filename as argument reads file and saves it to LatexFile
|
||||
\item SaveFile - Using filename provided by user or tex filename as argument converts HTML string to file and saves it
|
||||
\end{itemize}
|
||||
|
||||
\subsubsection{LatexHandler}
|
||||
Reads file from filename provided by user and at the end saves HTML file \\
|
||||
Parameters: \\
|
||||
\begin{itemize}
|
||||
\item filename - user entered tex filename
|
||||
\item saveFilename - (optional) filename for output file
|
||||
\item HTMLFile - converted final html file in File format
|
||||
\item LatexFile - latex file in File format
|
||||
\end{itemize}
|
||||
Functions:
|
||||
\begin{itemize}
|
||||
\item ReadFile - Using user filename as argument reads file and saves it to LatexFile
|
||||
\item SaveFile - Using filename provided by user or tex filename as argument converts HTML string to file and saves it
|
||||
\end{itemize}
|
||||
|
||||
\subsubsection{HTMLOutput}
|
||||
Reads file from filename provided by user and at the end saves HTML file \\
|
||||
Parameters: \\
|
||||
\begin{itemize}
|
||||
\item filename - user entered tex filename
|
||||
\item saveFilename - (optional) filename for output file
|
||||
\item HTMLFile - converted final html file in File format
|
||||
\item LatexFile - latex file in File format
|
||||
\end{itemize}
|
||||
Functions:
|
||||
\begin{itemize}
|
||||
\item ReadFile - Using user filename as argument reads file and saves it to LatexFile
|
||||
\item SaveFile - Using filename provided by user or tex filename as argument converts HTML string to file and saves it
|
||||
\end{itemize}
|
||||
|
||||
\subsubsection{TabHandler}
|
||||
Handles tables and converts them to html nodes \\
|
||||
Parameters: \\
|
||||
\begin{itemize}
|
||||
\item TableNode - node containing only the table
|
||||
\end{itemize}
|
||||
Functions:
|
||||
\begin{itemize}
|
||||
\item ParseTable - Parses Table node and checks for errors
|
||||
\item ConvertToHTML - Converts table node to html using TabInsideHandler and TabArgHandler
|
||||
\end{itemize}
|
||||
|
||||
\subsubsection{TabInsideHandler}
|
||||
Handles inside of tabular environment and converts them to html nodes \\
|
||||
Parameters: \\
|
||||
\begin{itemize}
|
||||
\item TableContents - Latex node containing only inside of table
|
||||
\end{itemize}
|
||||
Functions:
|
||||
\begin{itemize}
|
||||
\item ReadTableContent - Parses table content and checks for errors
|
||||
\item ConvertToHTML - Converts table inside node to html
|
||||
\end{itemize}
|
||||
|
||||
\subsubsection{TabArgHandler}
|
||||
Handles arguments of tabular environment and converts them to html nodes \\
|
||||
Parameters: \\
|
||||
\begin{itemize}
|
||||
\item TableArguments - Arguments provided with $\backslash$begin\{tabular\} environment
|
||||
\end{itemize}
|
||||
Functions:
|
||||
\begin{itemize}
|
||||
\item ReadTableARguments - Parses table arguments and checks for errors
|
||||
\item ConvertToHTML - Converts table arguments to html
|
||||
\end{itemize}
|
||||
|
||||
\subsection{Input/output description}
|
||||
Input is a .tex file (\LaTeX \, file) \\
|
||||
Outpus is an .html file \\
|
||||
In case of errors error message will be outputed on the terminal \\
|
||||
Input File path is entered as an argument to terminal with "-i" or "--input" flag for example:
|
||||
\begin{lstlisting}[language=bash]
|
||||
python main.py -i texFile.tex
|
||||
\end{lstlisting}
|
||||
Output file path can be named by user by using "-o" or "--output" flag:
|
||||
\begin{lstlisting}[language=bash]
|
||||
python main.py -i texFile.tex -o htmlFile.html
|
||||
\end{lstlisting}
|
||||
If no "-o" flag is issued the output file will have the same name as input file with changed extension to html (so in this example texFile.tex will become texFile.html) \\
|
||||
If the path to file name consists of spaces, path name needs to be but in ""
|
||||
\begin{lstlisting}[language=bash]
|
||||
python main.py -i "My Folder/input.tex"
|
||||
\end{lstlisting}
|
||||
\subsection{Others}
|
||||
\section{Functional test cases}
|
||||
|
||||
\begin{tabular}{|p{3cm}|p{6cm}|p{6cm}|}
|
||||
\hline
|
||||
Title & Input (\LaTeX) & Output \\
|
||||
\hline
|
||||
|
||||
empty file &
|
||||
\begin{lstlisting}
|
||||
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! expected \documentclass at the begining of LaTeX file
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
Document class &
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! expected \begin{document} after document class
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Extra text between document class and begin document
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
"extra text"
|
||||
\begin{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! unexpected text between document class and begin document
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Just document class and begin document
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! no \end{document} at the end of LaTeX code
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\end{tabular}
|
||||
|
||||
\begin{tabular}{|p{3cm}|p{6cm}|p{6cm}|}
|
||||
\hline
|
||||
Title & Input (\LaTeX) & Output \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Just document class and begin/end document
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
\end{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
<html>
|
||||
</html>
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Plain text inside
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
Lorem ipsum dolor sit amet.
|
||||
\end{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
<html>
|
||||
Lorem ipsum dolor sit amet.
|
||||
</html>
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Reduntant \end{document} (ignored)
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
Lorem ipsum dolor sit amet.
|
||||
\end{document}
|
||||
\end{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
<html>
|
||||
Lorem ipsum dolor sit amet.
|
||||
</html>
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
LaTeX comments
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
Lorem ipsum dolor sit amet.
|
||||
% some comment
|
||||
\end{document}
|
||||
\end{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! LaTeX comment detected at line 3
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
|
||||
|
||||
\end{tabular}
|
||||
|
||||
\begin{tabular}{|p{3cm}|p{6cm}|p{6cm}|}
|
||||
\hline
|
||||
Title & Input (\LaTeX) & Output \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Table with vertical lines
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
\begin{tabular}{ l | c | r }
|
||||
test & 2 & test \\
|
||||
4 & 5 & 6 \\
|
||||
\end{tabular}
|
||||
\end{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
<html>
|
||||
<table>
|
||||
<tr>
|
||||
<td align='left'>test</td>
|
||||
<td align='center' style="border-left: 1px solid black;">2</td>
|
||||
<td align='right'>test</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left'>4</td>
|
||||
<td align='center' style="border-left: 1px solid black;">5</td>
|
||||
<td align='right'>6</td>
|
||||
</tr>
|
||||
</table>
|
||||
</html>
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Missing &
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
\begin{tabular}{ l c r }
|
||||
1 & 2 & 3 \\
|
||||
4 & 5 6 \\
|
||||
\end{tabular}
|
||||
\end{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! Missing third column in second row
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\end{tabular}
|
||||
|
||||
\begin{tabular}{|p{3cm}|p{6cm}|p{6cm}|}
|
||||
\hline
|
||||
Title & Input (\LaTeX) & Output \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Too much columns
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
\begin{tabular}{ l c r }
|
||||
1 & 2 & 3 & 4 & 5 \\
|
||||
4 & 5 6 \\
|
||||
\end{tabular}
|
||||
\end{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! Too much columns in row 1, expected 3, got 5
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\end{tabular}
|
||||
|
||||
\end{document}
|
||||
BIN
preliminaryReport/actualReport/class.png
Normal file
BIN
preliminaryReport/actualReport/class.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
@ -1,9 +0,0 @@
|
||||
Every error message
|
||||
Every possible input
|
||||
Design code for errors
|
||||
Design of test cases to introductory document
|
||||
Execution must be presented during hours scheduled in laboratory
|
||||
Write code easy to modiffy
|
||||
|
||||
Test cases:
|
||||
Input data and result of test (input/OUTPUT of data) -> both correct and incorrect dataS
|
||||
@ -1,11 +0,0 @@
|
||||
Every error message
|
||||
Every possible input
|
||||
Design code for errors
|
||||
Design of test cases to introductory document
|
||||
Execution must be presented during hours scheduled in laboratory
|
||||
Write code easy to modiffy
|
||||
|
||||
Test cases:
|
||||
Input data and result of test (input/OUTPUT of data) -> both correct and incorrect dataS
|
||||
decide whether to use antrl
|
||||
bachus one
|
||||
Binary file not shown.
@ -1,204 +0,0 @@
|
||||
\documentclass[12pt]{article}
|
||||
|
||||
\usepackage{listings}
|
||||
|
||||
|
||||
\lstset{
|
||||
basicstyle=\small,
|
||||
breaklines=true
|
||||
}
|
||||
|
||||
|
||||
\date{\today}
|
||||
\title{ECOTE - preliminary project \\
|
||||
Translator of a LaTeX subset to HTML
|
||||
}
|
||||
\author{Krzysztof Rudnicki, 307585 \\
|
||||
Semester: 2023L}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\section{General overview and assumptions}
|
||||
initial task proposals (at least: assumptions, variant selection, implementation technology, scope, etc.). \\
|
||||
My task is to create a translator of \LaTeX \, subset to selected text format with focus on \LaTeX \, tables \\
|
||||
I decided to change to translator of \LaTeX \, subset to HTML since I know \LaTeX \, very well and HTML relatively well, I decide to translate \LaTeX into HTML since HTML is easy, a little bit different than \LaTeX and popular which makes this translator a practical tool.
|
||||
\subsection{Assumptions}
|
||||
\begin{itemize}
|
||||
\item No \LaTeX \, (\%) comments in the script
|
||||
\item There are no extra packages in \LaTeX \, script (provided with \\ \textbackslash usepackage keyword) besides ones distributed with \LaTeX
|
||||
\item There are no extra classes in \LaTeX \, script besides ones distributed with \LaTeX
|
||||
\item There is nothing between \textbackslash documentclass keyword and \\ \textbackslash begin\{document\} keyword
|
||||
\item No standard \LaTeX \, instructions are modified in the script
|
||||
\item "Tables" will be represented using \LaTeX \, \emph{table} environment
|
||||
\end{itemize}
|
||||
\section{Functional requirements}
|
||||
The goal of the project is to transform .tex file to (working ) .html file if the subset of .tex file is within project scope or output error message explaining why the html could not be outputed
|
||||
\subsection{\LaTeX \, subset}
|
||||
This project will focus almost exclusively on \emph{table} environment \\
|
||||
more speciffically table environment containing tabular inside of it
|
||||
\begin{enumerate}
|
||||
\item $\backslash$documentclass\{class\}: Defines what layout standard \LaTeX will use
|
||||
\item $\backslash$begin\{document\}: Ends (in our case empty) preamble
|
||||
\item $\backslash$end\{document\}: Ends \LaTeX \, document
|
||||
\item $\backslash$textit\{Text\}: Makes the text italic.
|
||||
\item $\backslash$underline\{Text\}: Underlines the text.
|
||||
\item $\backslash$begin\{itemize\} $\backslash$item Item 1 $\backslash$item Item 2 $\backslash$end\{itemize\}: Creates an unordered list with the given items.
|
||||
\item $\backslash$begin\{enumerate\} $\backslash$item Item 1 $\backslash$item Item 2 $\backslash$end\{enumerate\}: Creates an ordered list with the given items.
|
||||
\item $\backslash$begin\{center\} Text $\backslash$end\{center\}: Centers the text.
|
||||
\item $\backslash$begin\{tabular\}\{|c|c|c|\} $\backslash$hline Column 1 \& Column 2 \& Column 3 $\backslash$ $\backslash$hline Row 1, Column 1 \& Row 1, Column 2 \& Row 1, Column 3 $\backslash$ Row 2, Column 1 \& Row 2, Column 2 \& Row 2, Column 3 $\backslash$ $\backslash$hline $\backslash$end\{tabular\}: Creates a table with the given columns and rows.
|
||||
\end{enumerate}
|
||||
\section{Implementation}
|
||||
I decided to use Python as a language in which I will implement my solution \\
|
||||
The reasons for using python are as follow:
|
||||
\begin{enumerate}
|
||||
\item It is the easiest language among those that I know
|
||||
\item I know it enough to be confident in my ability to implement this solution in python
|
||||
\item I want to learn python more through this project
|
||||
\end{enumerate}
|
||||
Negative aspects of python which is that it is very slow language do not bother me as I believe the project scope will not be big enough for this to become an issue
|
||||
|
||||
\subsection{General architecture}
|
||||
|
||||
\subsection{Data structures}
|
||||
\subsection{Module descriptions}
|
||||
\subsection{Input/output description}
|
||||
Input is a .tex file (\LaTeX \, file) \\
|
||||
Outpus is an .html file \\
|
||||
In case of errors error message will be outputed on the terminal \\
|
||||
Input File path is entered as an argument to terminal with "-i" or "--input" flag for example:
|
||||
\begin{lstlisting}[language=bash]
|
||||
python main.py -i texFile.tex
|
||||
\end{lstlisting}
|
||||
Output file path can be named by user by using "-o" or "--output" flag:
|
||||
\begin{lstlisting}[language=bash]
|
||||
python main.py -i texFile.tex -o htmlFile.html
|
||||
\end{lstlisting}
|
||||
If no "-o" flag is issued the output file will have the same name as input file with changed extension to html (so in this example texFile.tex will become texFile.html) \\
|
||||
If the path to file name consists of spaces, path name needs to be but in ""
|
||||
\begin{lstlisting}[language=bash]
|
||||
python main.py -i "My Folder/input.tex"
|
||||
\end{lstlisting}
|
||||
\subsection{Others}
|
||||
\section{Functional test cases}
|
||||
|
||||
\begin{tabular}{|p{3cm}|p{6cm}|p{6cm}|}
|
||||
\hline
|
||||
Title & Input (\LaTeX) & Output \\
|
||||
\hline
|
||||
|
||||
empty file &
|
||||
\begin{lstlisting}
|
||||
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! expected \documentclass at the begining of LaTeX file
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
Document class &
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! expected \begin{document} after document class
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Extra text between document class and begin document
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
"extra text"
|
||||
\begin{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! unexpected text between document class and begin document
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Just document class and begin document
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! no \end{document} at the end of LaTeX code
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\end{tabular}
|
||||
|
||||
\begin{tabular}{|p{3cm}|p{6cm}|p{6cm}|}
|
||||
\hline
|
||||
Title & Input (\LaTeX) & Output \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Just document class and begin/end document
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
\end{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
<html>
|
||||
</html>
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Plain text inside
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
Lorem ipsum dolor sit amet.
|
||||
\end{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
<html>
|
||||
Lorem ipsum dolor sit amet.
|
||||
</html>
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
Reduntant \end{document} (ignored)
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
Lorem ipsum dolor sit amet.
|
||||
\end{document}
|
||||
\end{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
<html>
|
||||
Lorem ipsum dolor sit amet.
|
||||
</html>
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\begin{lstlisting}
|
||||
LaTeX comments
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
\documentclass[options]{class}
|
||||
\begin{document}
|
||||
Lorem ipsum dolor sit amet.
|
||||
% some comment
|
||||
\end{document}
|
||||
\end{document}
|
||||
\end{lstlisting}&
|
||||
\begin{lstlisting}
|
||||
Error! LaTeX comment detected at line 3
|
||||
\end{lstlisting} \\
|
||||
\hline
|
||||
|
||||
\end{tabular}
|
||||
|
||||
\end{document}
|
||||
99
preliminaryReport/tests/simpletable.css
Normal file
99
preliminaryReport/tests/simpletable.css
Normal file
@ -0,0 +1,99 @@
|
||||
|
||||
/* start css.sty */
|
||||
.cmtt-10{font-family: monospace,monospace;}
|
||||
p{margin-top:0;margin-bottom:0}
|
||||
p.indent{text-indent:0;}
|
||||
p + p{margin-top:1em;}
|
||||
p + div, p + pre {margin-top:1em;}
|
||||
div + p, pre + p {margin-top:1em;}
|
||||
a { overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; hyphens: auto; }
|
||||
@media print {div.crosslinks {visibility:hidden;}}
|
||||
table.tabular{border-collapse: collapse; border-spacing: 0;}
|
||||
a img { border-top: 0; border-left: 0; border-right: 0; }
|
||||
center { margin-top:1em; margin-bottom:1em; }
|
||||
td center { margin-top:0em; margin-bottom:0em; }
|
||||
.Canvas { position:relative; }
|
||||
img.math{vertical-align:middle;}
|
||||
div.par-math-display, div.math-display{text-align:center;}
|
||||
li p.indent { text-indent: 0em }
|
||||
li p:first-child{ margin-top:0em; }
|
||||
li p:last-child, li div:last-child { margin-bottom:0.5em; }
|
||||
li p:first-child{ margin-bottom:0; }
|
||||
li p~ul:last-child, li p~ol:last-child{ margin-bottom:0.5em; }
|
||||
.enumerate1 {list-style-type:decimal;}
|
||||
.enumerate2 {list-style-type:lower-alpha;}
|
||||
.enumerate3 {list-style-type:lower-roman;}
|
||||
.enumerate4 {list-style-type:upper-alpha;}
|
||||
div.newtheorem { margin-bottom: 2em; margin-top: 2em;}
|
||||
div.newtheorem .head{font-weight: bold;}
|
||||
.obeylines-h,.obeylines-v {white-space: nowrap; }
|
||||
div.obeylines-v p { margin-top:0; margin-bottom:0; }
|
||||
.overline{ text-decoration:overline; }
|
||||
.overline img{ border-top: 1px solid black; }
|
||||
td.displaylines {text-align:center; white-space:nowrap;}
|
||||
.centerline {text-align:center;}
|
||||
.rightline {text-align:right;}
|
||||
pre.verbatim {font-family: monospace,monospace; text-align:left; clear:both; }
|
||||
.fbox {padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
|
||||
div.fbox {display:table}
|
||||
div.center div.fbox {text-align:center; clear:both; padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
|
||||
div.minipage{width:100%;}
|
||||
div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em;}
|
||||
div.center div {text-align: left;}
|
||||
div.flushright, div.flushright div.flushright {text-align: right;}
|
||||
div.flushright div {text-align: left;}
|
||||
div.flushleft {text-align: left;}
|
||||
.underline{ text-decoration:underline; }
|
||||
.underline img{ border-bottom: 1px solid black; margin-bottom:1pt; }
|
||||
.framebox-c, .framebox-l, .framebox-r { padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
|
||||
.framebox-c {text-align:center;}
|
||||
.framebox-l {text-align:left;}
|
||||
.framebox-r {text-align:right;}
|
||||
span.thank-mark{ vertical-align: super }
|
||||
span.footnote-mark sup.textsuperscript, span.footnote-mark a sup.textsuperscript{ font-size:80%; }
|
||||
div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em; }
|
||||
table.tabular td p{margin-top:0em;}
|
||||
table.tabular {margin-left: auto; margin-right: auto;}
|
||||
td p:first-child{ margin-top:0em; }
|
||||
td p:last-child{ margin-bottom:0em; }
|
||||
div.td00{ margin-left:0pt; margin-right:0pt; }
|
||||
div.td01{ margin-left:0pt; margin-right:5pt; }
|
||||
div.td10{ margin-left:5pt; margin-right:0pt; }
|
||||
div.td11{ margin-left:5pt; margin-right:5pt; }
|
||||
table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; }
|
||||
td.td00{ padding-left:0pt; padding-right:0pt; }
|
||||
td.td01{ padding-left:0pt; padding-right:5pt; }
|
||||
td.td10{ padding-left:5pt; padding-right:0pt; }
|
||||
td.td11{ padding-left:5pt; padding-right:5pt; }
|
||||
table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; }
|
||||
.hline hr, .cline hr{ height : 0px; margin:0px; }
|
||||
.hline td, .cline td{ padding: 0; }
|
||||
.hline hr, .cline hr{border:none;border-top:1px solid black;}
|
||||
.hline {border-top: 1px solid black;}
|
||||
.hline + .vspace:last-child{display:none;}
|
||||
.hline:first-child{border-bottom:1px solid black;border-top:none;}
|
||||
.tabbing-right {text-align:right;}
|
||||
div.float, div.figure {margin-left: auto; margin-right: auto;}
|
||||
div.float img {text-align:center;}
|
||||
div.figure img {text-align:center;}
|
||||
.marginpar,.reversemarginpar {width:20%; float:right; text-align:left; margin-left:auto; margin-top:0.5em; font-size:85%; text-decoration:underline;}
|
||||
.marginpar p,.reversemarginpar p{margin-top:0.4em; margin-bottom:0.4em;}
|
||||
.reversemarginpar{float:left;}
|
||||
table.equation {width:100%;}
|
||||
.equation td{text-align:center; }
|
||||
td.equation { margin-top:1em; margin-bottom:1em; }
|
||||
td.equation-label { width:5%; text-align:center; }
|
||||
td.eqnarray4 { width:5%; white-space: normal; }
|
||||
td.eqnarray2 { width:5%; }
|
||||
table.eqnarray-star, table.eqnarray {width:100%;}
|
||||
div.eqnarray{text-align:center;}
|
||||
div.array {text-align:center;}
|
||||
div.pmatrix {text-align:center;}
|
||||
table.pmatrix {width:100%;}
|
||||
span.pmatrix img{vertical-align:middle;}
|
||||
div.pmatrix {text-align:center;}
|
||||
table.pmatrix {width:100%;}
|
||||
span.bar-css {text-decoration:overline;}
|
||||
img.cdots{vertical-align:middle;}
|
||||
/* end css.sty */
|
||||
|
||||
38
preliminaryReport/tests/simpletable.html
Normal file
38
preliminaryReport/tests/simpletable.html
Normal file
@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html >
|
||||
<head><title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="generator" content="TeX4ht (https://tug.org/tex4ht/)">
|
||||
<meta name="originator" content="TeX4ht (https://tug.org/tex4ht/)">
|
||||
<!-- html -->
|
||||
<meta name="src" content="simpletable.tex">
|
||||
<link rel="stylesheet" type="text/css" href="simpletable.css">
|
||||
</head><body
|
||||
>
|
||||
<div class="tabular"> <table id="TBL-1" class="tabular"
|
||||
|
||||
><colgroup id="TBL-1-1g"><col
|
||||
id="TBL-1-1"><col
|
||||
id="TBL-1-2"><col
|
||||
id="TBL-1-3"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-1-1-"><td style="white-space:nowrap; text-align:left;" id="TBL-1-1-1"
|
||||
class="td11">1</td><td style="white-space:nowrap; text-align:center;" id="TBL-1-1-2"
|
||||
class="td11">2</td><td style="white-space:nowrap; text-align:right;" id="TBL-1-1-3"
|
||||
class="td11">3</td></tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-1-2-"><td style="white-space:nowrap; text-align:left;" id="TBL-1-2-1"
|
||||
class="td11">4 </td> <td style="white-space:nowrap; text-align:center;" id="TBL-1-2-2"
|
||||
class="td11">5</td> <td style="white-space:nowrap; text-align:right;" id="TBL-1-2-3"
|
||||
class="td11">6</td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-1-3-"><td style="white-space:nowrap; text-align:left;" id="TBL-1-3-1"
|
||||
class="td11">7 </td><td style="white-space:nowrap; text-align:center;" id="TBL-1-3-2"
|
||||
class="td11">8</td><td style="white-space:nowrap; text-align:right;" id="TBL-1-3-3"
|
||||
class="td11">9</td></tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-1-4-"><td style="white-space:nowrap; text-align:left;" id="TBL-1-4-1"
|
||||
class="td11"> </td> </tr></table> </div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
||||
|
||||
BIN
preliminaryReport/tests/simpletable.pdf
Normal file
BIN
preliminaryReport/tests/simpletable.pdf
Normal file
Binary file not shown.
8
preliminaryReport/tests/simpletable.tex
Normal file
8
preliminaryReport/tests/simpletable.tex
Normal file
@ -0,0 +1,8 @@
|
||||
\documentclass{article}
|
||||
\begin{document}
|
||||
\begin{tabular}{ l | c | r }
|
||||
test & 2 & test \\
|
||||
4 & 5 & 6 \\
|
||||
7 & 8 & 9 \\
|
||||
\end{tabular}
|
||||
\end{document}
|
||||
2
preliminaryReport/tests/simpletable.tmp
Normal file
2
preliminaryReport/tests/simpletable.tmp
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
/* css.sty */
|
||||
Loading…
Reference in New Issue
Block a user