git.iko.soy/typeable/pandoc
on source_date_epoch help sign in
typeable/pandoc/test/writers-lang-and-dir.latex
158 lines 4.4 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{amsmath,amssymb}
9\usepackage{lmodern}
10\usepackage{iftex}
11\ifPDFTeX
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 pdflang={en},
41 hidelinks,
42 pdfcreator={LaTeX via pandoc}}
43\urlstyle{same} % disable monospaced font for URLs
44\setlength{\emergencystretch}{3em} % prevent overfull lines
45\providecommand{\tightlist}{%
46 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
47\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
48\ifXeTeX
49 % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
50 \usepackage{polyglossia}
51 \setmainlanguage[]{english}
52 \setotherlanguage[]{german}
53 \setotherlanguage[variant=british]{english}
54 \setotherlanguage[variant=swiss]{german}
55 \setotherlanguage[]{spanish}
56 \setotherlanguage[]{french}
57\else
58 \usepackage[ngerman,british,nswissgerman,spanish,french,main=english]{babel}
59% get rid of language-specific shorthands (see #6817):
60\let\LanguageShortHands\languageshorthands
61\def\languageshorthands#1{}
62 \newcommand{\textgerman}[2][]{\foreignlanguage{ngerman}{#2}}
63 \newenvironment{german}[2][]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}}
64 \newcommand{\textenglish}[2][]{\foreignlanguage{british}{#2}}
65 \newenvironment{english}[2][]{\begin{otherlanguage}{british}}{\end{otherlanguage}}
66 \let\oritextspanish\textspanish
67 \AddBabelHook{spanish}{beforeextras}{\renewcommand{\textspanish}{\oritextspanish}}
68 \AddBabelHook{spanish}{afterextras}{\renewcommand{\textspanish}[2][]{\foreignlanguage{spanish}{##2}}}
69 \newcommand{\textfrench}[2][]{\foreignlanguage{french}{#2}}
70 \newenvironment{french}[2][]{\begin{otherlanguage}{french}}{\end{otherlanguage}}
71\fi
72\ifLuaTeX
73 \usepackage{selnolig} % disable illegal ligatures
74\fi
75\ifXeTeX
76 % Load bidi as late as possible as it modifies e.g. graphicx
77 \usepackage{bidi}
78\fi
79\ifPDFTeX
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\author{}
88\date{}
90\begin{document}
92\hypertarget{empty-divs-and-spans}{%
93\section{Empty Divs and Spans}\label{empty-divs-and-spans}}
95Some text and
97div contents
99and more text.
101Next paragraph with a {span} and a word-thatincludesa{span}right?
103\hypertarget{directionality}{%
104\section{Directionality}\label{directionality}}
106Some text and
108\begin{RTL}
109rtl div contents
110\end{RTL}
112and more text.
114\begin{LTR}
115and a ltr div. with a \RL{rtl span}.
116\end{LTR}
118Next paragraph with a \RL{rtl span} and a
119word-that-includesa\LR{ltrspan}right?
121\hypertarget{languages}{%
122\section{Languages}\label{languages}}
124Some text and
126\begin{german}
128German div contents
130\end{german}
132and more text.
134Next paragraph with a \textenglish[variant=british]{British span} and a
135word-that-includesa\textgerman[variant=swiss]{Swiss German span}right?
137Some \textspanish{Spanish text}.
139\hypertarget{combined}{%
140\section{Combined}\label{combined}}
142Some text and
144\begin{RTL}
145\begin{french}
147French rtl div contents
149\end{french}
150\end{RTL}
152and more text.
154Next paragraph with a \LR{\textenglish[variant=british]{British ltr
155span}} and a word-that-includesa\LR{\textgerman[variant=swiss]{Swiss
156German ltr span}}right?
158\end{document}