I'm going to write an article. It will have math equations, images, and tables. My article frequently contains repeated content with slight modifications. For instance my article may have
If the legs of a right triangle are 3 and 4, then the hypotenuse is 5.
If the legs of a right triangle are 3 and 5, then the hypotenuse is 5.83.
If the legs of a right triangle are 3 and 6, then the hypotenuse is 6.71.
If the legs of a right triangle are 3 and 7, then the hypotenuse is 7.62.
If the legs of a right triangle are 3 and 8, then the hypotenuse is 8.54.
I must publish it in my web blog so that everyone can access it easily. In addition, I must print out my article in hard copy.
If I write in HTML, then print to pdf?
<!-- language: html --> <div v-for="x in range(4,8)"> <RightTriangle leg1="3" v-bind:leg2="x"/> </div>
VueJS will automatically generate the 5 paragraphs, looping x from 4 to 8, and calculate the value of hypotenuse.
If I write in Latex?
Even if I wrote out the article in Latex, I may use latex2html or pandoc to convert it to HTML. I'm not sure the quality of the result especially if I use latex for-loop or calculation syntax.
Can I write once, and publish to HTML and PDF(hard copy), with Latex floating support, Latex Equation support, and automatic content generation with possible complicated logic?