git.iko.soy/typeable/pandoc
on 2.7.2 help sign in
typeable/pandoc/test/writers-lang-and-dir.latex
150 lines 4.2 kB history raw
1% Options for packages loaded elsewhere
2\PassOptionsToPackage{unicode}{hyperref}
3\PassOptionsToPackage{hyphens}{url}
4%
5\documentclass[
6 english,
7]{article}
8\usepackage{lmodern}
9\usepackage{amssymb,amsmath}
10\usepackage{ifxetex,ifluatex}
11\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
12 \usepackage[T1]{fontenc}
13 \usepackage[utf8]{inputenc}
14 \usepackage{textcomp} % provide euro and other symbols
15\else % if luatex or xetex
16 \usepackage{unicode-math}
17 \defaultfontfeatures{Scale=MatchLowercase}
18 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
19\fi
20% Use upquote if available, for straight quotes in verbatim environments
21\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
22\IfFileExists{microtype.sty}{% use microtype if available
23 \usepackage[]{microtype}
24 \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
25}{}
26\makeatletter
27\@ifundefined{KOMAClassName}{% if non-KOMA class
28 \IfFileExists{parskip.sty}{%
29 \usepackage{parskip}
30 }{% else
31 \setlength{\parindent}{0pt}
32 \setlength{\parskip}{6pt plus 2pt minus 1pt}}
33}{% if KOMA class
34 \KOMAoptions{parskip=half}}
35\makeatother
36\usepackage{xcolor}
37\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
38\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
39\hypersetup{
40 hidelinks,
41 pdfcreator={LaTeX via pandoc}}
42\urlstyle{same} % disable monospaced font for URLs
43\setlength{\emergencystretch}{3em} % prevent overfull lines
44\providecommand{\tightlist}{%
45 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
46\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
47\ifxetex
48 % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
49 \usepackage{polyglossia}
50 \setmainlanguage[]{english}
51 \setotherlanguage[]{german}
52 \setotherlanguage[variant=british]{english}
53 \setotherlanguage[variant=swiss]{german}
54 \setotherlanguage[]{spanish}
55 \setotherlanguage[]{french}
56\else
57 \usepackage[shorthands=off,ngerman,british,nswissgerman,spanish,french,main=english]{babel}
58 \newcommand{\textgerman}[2][]{\foreignlanguage{ngerman}{#2}}
59 \newenvironment{german}[2][]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}}
60 \newcommand{\textenglish}[2][]{\foreignlanguage{british}{#2}}
61 \newenvironment{english}[2][]{\begin{otherlanguage}{british}}{\end{otherlanguage}}
62 \let\oritextspanish\textspanish
63 \AddBabelHook{spanish}{beforeextras}{\renewcommand{\textspanish}{\oritextspanish}}
64 \AddBabelHook{spanish}{afterextras}{\renewcommand{\textspanish}[2][]{\foreignlanguage{spanish}{##2}}}
65 \newcommand{\textfrench}[2][]{\foreignlanguage{french}{#2}}
66 \newenvironment{french}[2][]{\begin{otherlanguage}{french}}{\end{otherlanguage}}
67\fi
68\ifxetex
69 % Load bidi as late as possible as it modifies e.g. graphicx
70 \usepackage{bidi}
71\fi
72\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
73 \TeXXeTstate=1
74 \newcommand{\RL}[1]{\beginR #1\endR}
75 \newcommand{\LR}[1]{\beginL #1\endL}
76 \newenvironment{RTL}{\beginR}{\endR}
77 \newenvironment{LTR}{\beginL}{\endL}
78\fi
80\date{}
82\begin{document}
84\hypertarget{empty-divs-and-spans}{%
85\section{Empty Divs and Spans}\label{empty-divs-and-spans}}
87Some text and
89div contents
91and more text.
93Next paragraph with a {span} and a word-thatincludesa{span}right?
95\hypertarget{directionality}{%
96\section{Directionality}\label{directionality}}
98Some text and
100\begin{RTL}
101rtl div contents
102\end{RTL}
104and more text.
106\begin{LTR}
107and a ltr div. with a \RL{rtl span}.
108\end{LTR}
110Next paragraph with a \RL{rtl span} and a
111word-that-includesa\LR{ltrspan}right?
113\hypertarget{languages}{%
114\section{Languages}\label{languages}}
116Some text and
118\begin{german}
120German div contents
122\end{german}
124and more text.
126Next paragraph with a \textenglish[variant=british]{British span} and a
127word-that-includesa\textgerman[variant=swiss]{Swiss German span}right?
129Some \textspanish{Spanish text}.
131\hypertarget{combined}{%
132\section{Combined}\label{combined}}
134Some text and
136\begin{RTL}
137\begin{french}
139French rtl div contents
141\end{french}
142\end{RTL}
144and more text.
146Next paragraph with a \LR{\textenglish[variant=british]{British ltr
147span}} and a word-that-includesa\LR{\textgerman[variant=swiss]{Swiss
148German ltr span}}right?
150\end{document}