I have extracted subtitle text in .srt format.
It is essentially text with some keywords that indicate which type of formating to apply to different parts.
Formatting is derived from HTML tags for bold, italic, underline and color:
Bold – <b> ... </b> or {b} ... {/b}
Italic – <i> ... </i> or {i} ... {/i}
Underline – <u> ... </u> or {u} ... {/u}
Font color – <font color="color name or #code"> ... </font> (as in HTML)
Now, I would like to convert it to LaTeX format. Does anyone know how to do this?
Thanks.
EDIT: Here is a sample data:
37
00:03:28,544 --> 00:03:32,544
Maintenant une équation linéaire à deux inconnues
38
00:03:32,544 --> 00:03:36,544
est de la forme :
<i>c·aᵢ₁(α₁ - β₁) + c·aᵢ₂(α₂ - β₂) + ... + c·aₙ₁(αₙ - βₙ)) = 0.</i>,
39
00:03:37,841 --> 00:03:44,091
je nomme cette fois les inconnues <i>x</i> et <i>y</i>, où <i>a</i>, <i>b</i> et <i>c</i> sont des nombres réels.
I extract the text using pysub2
Maintenant une équation linéaire à deux inconnues est de la forme :
<i>c·aᵢ₁(α₁ - β₁) + c·aᵢ₂(α₂ - β₂) + ... + c·aₙ₁(αₙ - βₙ)) = 0.</i>,
je nomme cette fois les inconnues <i>x</i> et <i>y</i>, où <i>a</i>,
<i>b</i> et <i>c</i> sont des nombres réels.
I would like to have exactly the same text in Latex form, but of course, without the formatting tags (i.e. etc.) but with Latex formatting (for instance: \textit{c} instead of <i>c</i>
verbatimorlistingsare not ok for you, then explain your question further and show what you want. – Mar 03 '19 at 07:16β₂is not the way LaTeX writes this character. LaTeX writes this$\beta_2$. So, you need to find a way to convert the characters encoded in this way to LaTeX code. There are specialists in coding and fonts, perhaps they can explain how to proceed. Ask a new question. – AndréC Mar 03 '19 at 20:00{<i>}replace with{\textit{}{8}and replace{</i>}with{}}{1} replacing{β₂}with {$\beta_2$}{9) is easy but the large number of variations would be time consuming It may be as said easier to use a dedicated string replacement program to do the conversion then simply \include that output – Mar 03 '19 at 20:26