So I need to write a programme on c++ that converts given latex file with tags etc., but it only contains text (no mathematical equations). It should create a txt file without any tags, only plain text. I see I should use the parser here, but I don't know how to write it and what to do next.How exactly do I write a parser for converting latex into plain text? Example of the tex file:
%% -*- coding: cp866 -*-
\documentclass[12pt,a4paper]{article}
\usepackage[cp866]{inputenc}
\usepackage[russian]{babel}
\usepackage{graphicx}
\usepackage{misccorr}
\usepackage{amsmath}
\usepackage{contour}
\begin{document}
\begin{center}
\large
RUSSIAN FEDERATION
\end{center}
\large
\textbf{Surname:}\hspace{0.25cm}\\
\LARGE
tit\\
\large
\textbf{Given names:}\hspace{0.25cm}\\
\LARGE
fgfg\\
\large
\textbf{Nationality:}\hspace{0.25cm}\\
\LARGE
gdh\\
\large
\textbf{Date of birth:}\hspace{0.25cm}\\
\LARGE
fghfh\\
\large
\textbf{Sex:}\hspace{0.25cm}\\
\LARGE
ghfghb\\
\large
\textbf{Place of birth:}\hspace{0.25cm}\\
\LARGE
hfgh
\end{document}
\documentclassand the appropriate packages that shows the type of file you want to convert to plain text. I have a feeling that a generalC++parser is going to be quite difficult. Probably much easier to get TeX to generate the plain text file, but without an example of such a document it is difficult to know where to start on this issue. – Peter Grill Oct 24 '18 at 18:55\end{document}' – Liz Oct 24 '18 at 19:12
\\and\largeevery other line? the markup is very strange. – David Carlisle Oct 24 '18 at 20:07