Idea is to design a Question bank with answers and solutions for math and science subjects, for a web application (Designed in Laravel(php). Typesetting of questions is done in LaTeX.
\documentclass{memoir}
\usepackage{amsthm,amsfonts,amssymb,amsmath}
\usepackage{fourier}
\theoremstyle{definition}
\newtheorem{ex}{Exercise}
\usepackage{answers}
\Newassociation{sol}{Solution}{ans}
\renewcommand{\Solutionlabel}[1]{\textbf{Answer #1.}}
\begin{document}
\chapter{Exercises}
\Opensolutionfile{ans}[ans1]
\begin{ex}
This is a question.
\begin{sol}
This is an answer.
\end{sol}
\end{ex}
\begin{ex}
This is second Question
\begin{sol}
This is second answer
\end{sol}
\end{ex}
\Closesolutionfile{ans}
\section{Answer}
\input{ans1}
\end{document}
Question 1. Now I am able to pull out questions with their answers wrapped in {ex} environment into mysql table. Laravel web application can call these questions and present them to a view. Is there any way to show them in HTML.
Question 2. Generally a big math Book typeset in LaTeX does contain so many style conventions and abbreviations stacked up in an .sty file. But how to enclose all of them when such {ex} snippets alone are sent to html view.
I tried pdf2htmlEX by coolwanglu, it was excellent in document translation from pdf to html. But my main requirement is randomly popping a question from mysql db, so this way is not useful.
Can somebody suggest me any workflow how to achieve this.
pdf2htmlEXutility. – epR8GaYuh Aug 17 '18 at 07:38