git.iko.soy/typeable/pandoc
on 2.2.3 help sign in
typeable/pandoc/test/writers-lang-and-dir.latex
157 lines 4.4 kB history raw
1\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
2\PassOptionsToPackage{hyphens}{url}
3%
4\documentclass[english,]{article}
5\usepackage{lmodern}
6\usepackage{amssymb,amsmath}
7\usepackage{ifxetex,ifluatex}
8\usepackage{fixltx2e} % provides \textsubscript
9\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
10 \usepackage[T1]{fontenc}
11 \usepackage[utf8]{inputenc}
12 \usepackage{textcomp} % provides euro and other symbols
13\else % if luatex or xelatex
14 \usepackage{unicode-math}
15 \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
16\fi
17% use upquote if available, for straight quotes in verbatim environments
18\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
19% use microtype if available
20\IfFileExists{microtype.sty}{%
21\usepackage[]{microtype}
22\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
23}{}
24\IfFileExists{parskip.sty}{%
25\usepackage{parskip}
26}{% else
27\setlength{\parindent}{0pt}
28\setlength{\parskip}{6pt plus 2pt minus 1pt}
30\usepackage{hyperref}
31\hypersetup{
32 pdfborder={0 0 0},
33 breaklinks=true}
34\urlstyle{same} % don't use monospace font for urls
35\setlength{\emergencystretch}{3em} % prevent overfull lines
36\providecommand{\tightlist}{%
37 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
38\setcounter{secnumdepth}{0}
39% Redefines (sub)paragraphs to behave more like sections
40\ifx\paragraph\undefined\else
41\let\oldparagraph\paragraph
42\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
43\fi
44\ifx\subparagraph\undefined\else
45\let\oldsubparagraph\subparagraph
46\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
47\fi
49% set default figure placement to htbp
50\makeatletter
51\def\fps@figure{htbp}
52\makeatother
54\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
55 \usepackage[shorthands=off,ngerman,british,nswissgerman,spanish,french,main=english]{babel}
56 \newcommand{\textgerman}[2][]{\foreignlanguage{ngerman}{#2}}
57 \newenvironment{german}[2][]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}}
58 \newcommand{\textenglish}[2][]{\foreignlanguage{british}{#2}}
59 \newenvironment{english}[2][]{\begin{otherlanguage}{british}}{\end{otherlanguage}}
60 \let\oritextspanish\textspanish
61 \AddBabelHook{spanish}{beforeextras}{\renewcommand{\textspanish}{\oritextspanish}}
62 \AddBabelHook{spanish}{afterextras}{\renewcommand{\textspanish}[2][]{\foreignlanguage{spanish}{##2}}}
63 \newcommand{\textfrench}[2][]{\foreignlanguage{french}{#2}}
64 \newenvironment{french}[2][]{\begin{otherlanguage}{french}}{\end{otherlanguage}}
65\else
66 % load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic)
67 \usepackage{polyglossia}
68 \setmainlanguage[]{english}
69 \setotherlanguage[]{german}
70 \setotherlanguage[variant=british]{english}
71 \setotherlanguage[variant=swiss]{german}
72 \setotherlanguage[]{spanish}
73 \setotherlanguage[]{french}
74\fi
75\ifxetex
76 % load bidi as late as possible as it modifies e.g. graphicx
77 \usepackage{bidi}
78\fi
79\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
80 \TeXXeTstate=1
81 \newcommand{\RL}[1]{\beginR #1\endR}
82 \newcommand{\LR}[1]{\beginL #1\endL}
83 \newenvironment{RTL}{\beginR}{\endR}
84 \newenvironment{LTR}{\beginL}{\endL}
85\fi
87\date{}
89\begin{document}
91\hypertarget{empty-divs-and-spans}{%
92\section{Empty Divs and Spans}\label{empty-divs-and-spans}}
94Some text and
96div contents
98and more text.
100Next paragraph with a {span} and a word-thatincludesa{span}right?
102\hypertarget{directionality}{%
103\section{Directionality}\label{directionality}}
105Some text and
107\begin{RTL}
108rtl div contents
109\end{RTL}
111and more text.
113\begin{LTR}
114and a ltr div. with a \RL{rtl span}.
115\end{LTR}
117Next paragraph with a \RL{rtl span} and a
118word-that-includesa\LR{ltrspan}right?
120\hypertarget{languages}{%
121\section{Languages}\label{languages}}
123Some text and
125\begin{german}
127German div contents
129\end{german}
131and more text.
133Next paragraph with a \textenglish[variant=british]{British span} and a
134word-that-includesa\textgerman[variant=swiss]{Swiss German span}right?
136Some \textspanish{Spanish text}.
138\hypertarget{combined}{%
139\section{Combined}\label{combined}}
141Some text and
143\begin{RTL}
144\begin{french}
146French rtl div contents
148\end{french}
149\end{RTL}
151and more text.
153Next paragraph with a \LR{\textenglish[variant=british]{British ltr
154span}} and a word-that-includesa\LR{\textgerman[variant=swiss]{Swiss
155German ltr span}}right?
157\end{document}