Typography on LaTeX2Web
Fran?ois Chaplais, PhD
Founder of WebMagic | Bring LaTeX to the Web | Spread knowledge | Promote STEM
Text Size
Text-size can be specify inside of a style sheet (CSS file). To obtain good results, the text size should be specified in rem. Rem stands for "Relative EM", which means that this the default size of an "m" for the target device.
On the LaTeX2Web site, the paragraph font size is set to 1rem, on mobile. This does not render well on tablet, however; this is why, on devices which are more than 700 px wide, the paragraph size is set to 1.2rem. On computers, specifically devices larger than 1100px, the paragraph size is set to 1.3rem.
This is the result of a trial and error process executed by testing the web pages on actual devices. This targets the Expo Serif font, which is used to render documents. The sans serif font (Poppins) that I use on the other pages (for instance the landing page) has a small ascender, which makes is appear to be larger than it is. It is not very elegant, but I use this outside of document pages because it is very clear.
Also, the larger the device, the more distant the reader is from the screen. This motivates the use of larger font size on larger devices.
Margins
On small devices, this makes no sense to use margins. Suppressing them gives more flexibility on the size of the font, regarding the text readability and the number of words per line.
By contrast, this latter consideration justifies blocking the line width on computer devices, to prevent from having too many words per line. To achieve that, the width of the text content is be blocked to a maximum value beyond a certain device width.