File: polyglossia.tex

package info (click to toggle)
latex2html 2019-debian1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,896 kB
  • sloc: perl: 33,323; makefile: 447
file content (113 lines) | stat: -rw-r--r-- 4,436 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
%% Test of mathematics images generation by LuaLaTeX
%% and language switching in Polyglossia.
%% =================================================
%% If translated with latex2html by default, no mathematical formula is
%% produced because plain latex cannot translate lualatex documents.
%% -------------------------------------------------
%% This file must be translated as follows:
%% latex2html -use_luatex polyglossia.tex
%% Of course, other options are allowed, for example this will also work:
%% latex2html -use_luatex -use_dvipng polyglossia.tex
%% =================================================
\documentclass[12pt]{amsart}
\usepackage{fontspec}
\setmainfont{CMU Serif Roman}[Ligatures=TeX,
BoldFont=CMU Serif Bold Extended Roman,
ItalicFont=CMU Serif Italic,
BoldItalicFont=CMU Serif Bold Extended Italic,
SlantedFont=CMU Serif Roman Slanted,
BoldSlantedFont=CMU Serif Bold Extended Slanted Roman
]
\setsansfont{CMU Sans Serif}[Ligatures=TeX,
BoldFont=CMU Sans Serif Bold Extended,
ItalicFont=CMU Sans Serif Oblique,
BoldItalicFont=CMU Sans Serif Bold Extended Oblique
]
\setmonofont{CMU Typewriter Text Regular}[WordSpace={1,0,0},HyphenChar=None,PunctuationSpace=WordSpace,
BoldFont=CMU Typewriter Text Bold,
ItalicFont=CMU Typewriter Text Italic,
BoldItalicFont=CMU Typewriter Text Bold Italic
]
\usepackage{polyglossia}
\setdefaultlanguage{russian}
\setotherlanguages{english,german}
\usepackage{amsfonts,amssymb,amscd}
\usepackage{latexsym}
\usepackage{mathrsfs}
\usepackage{textcomp}
\title{The trap for \LaTeX\ convertors}
\author{Sergej V. Znamenskij}
\begin {document}
\maketitle

\section{Проверка поддержки русского языка в Polyglossia}
Кавычки: "прямые", <<елочки>>, ``английские'', и
`одинарные'.
Тире: Длинное --- или короткое --.

Включаем немецкий язык: \textgerman{\seename{}: heute ist \today}.
Теперь английский: \textenglish{\seename{}: now is \today}.
Снова русский: \textrussian{\seename{}: сегодня \today}

Проверяем environment.

\begin{german}
Deutsches Umgebung:
\seename{} \today
\end{german}

\begin{english}
English environment:
\seename{} \today
\end{english}

\begin{russian}
Русское окружение:
\seename{} \today
\end{russian}

Снова русский.

Номер
№  \textnumero

Теперь английский.

\begin{english}

This file contains absolutely legal and ordinary
mathematical constructions in \LaTeX\ text to facilitate visual
detection of image alignment algorithm flaws in \LaTeX\ to HTML conversion.

\section {Line alignment problem}
The problem comes with the large height and (or) depth formulae. 
Usually such a formula as $x_s^{\int\limits_a^{N^1}\, dx}$ for example has
larger height than depth. As a corollary, the convertor may add improper large gap (vskip) before the next
line. The case of equal height and width $\left(x_s^{\int\limits_a^{N^1}\, dx}\right)$ is more controlable, 
as far as we do not try to get images scaled together with text changing.
The most rare and difficult situation is a formula with a large depth, but a very small height: 
$y=1-\dfrac{\alpha}{1-\dfrac{2}{3-\dfrac{4}{5-x}}}$.
I will appreciate any idea to keep proper interline distance in such a case without 
additional vskip over this formula though I suppose it to be impossible: I failed to find a hint in html 
specifications how to force browser to leave a proper place lower image without extra gap over it. 

\section {Inline alignment problems}All dots in the line are to be exactly aligned for any browser and selected text size.

.$.\sum\limits^n1.$.$.\prod\limits_n2.$.$.\dfrac{\alpha\otimes\mu}{\gamma}.$.$.1.$.$.\dfrac {\rightharpoonup}{A\otimes B}.$.

The simple convertion algorithm can fail due to the following reasons:
\begin {itemize} 
\item HTML lacks opportunity to reproduce \LaTeX\ layout directly;
\item Some kind of HTML markup has different visual representation in different browser versions;  
\item Usable image conversion libraries and tools do not care reference point position in the image while cropping;
\item \LaTeX\ box dimensions (width, height and depth) \textbf{usually differs} from its visual width, height, or depth. 
\end {itemize}

Test of Figure environment:
\begin{figure}
\[ a = \int exp{x} \,\mathrm{d}x \]
\end{figure}

\end{english}

\end {document}