LaTeX reader: handle otherlanguage environment...

...and language-name environments like
`\begin{french}...\end{french}`.
Closes #9202.
This commit is contained in:
John MacFarlane
2023-11-29 21:22:03 -08:00
parent 2e8ecb3fba
commit 80ea048bb2
2 changed files with 81 additions and 1 deletions
+62
View File
@@ -0,0 +1,62 @@
```
% pandoc -f latex -t native
\begin{otherlanguage}{french}
Bonjour.
\end{otherlanguage}
^D
[ Div
( "" , [] , [ ( "lang" , "fr" ) ] )
[ Para [ Str "Bonjour." ] ]
]
```
```
% pandoc -f latex -t native
\begin{otherlanguage*}{french}
Bonjour.
\end{otherlanguage*}
^D
[ Div
( "" , [ "otherlanguage*" ] , [] )
[ Para
[ Span ( "" , [] , [] ) [ Str "french" ]
, SoftBreak
, Str "Bonjour."
]
]
]
```
```
% pandoc -f latex -t native
\textfrench{Bonjour}
^D
[ Para
[ Span ( "" , [] , [ ( "lang" , "fr" ) ] ) [ Str "Bonjour" ]
]
]
```
```
% pandoc -f latex -t native
\foreignlanguage{swissgerman}{Guten tag}
^D
[ Para
[ Span
( "" , [] , [ ( "lang" , "de-CH-1901" ) ] )
[ Str "Guten" , Space , Str "tag" ]
]
]
```
```
% pandoc -f latex -t native
\begin{french}
Bonjour.
\end{french}
^D
[ Div
( "" , [] , [ ( "lang" , "fr" ) ] )
[ Para [ Str "Bonjour." ] ]
]
```