4de9edb8e8
Load the iftex package directly rather than via the ifxetex and ifluatex compatibility
wrappers, which have been merged into a single package that is part of the LaTeX core.
The capitalization of the commands has been changed for compatibility with older
versions of TeX Live that have the version of iftex by the Persian TeX Group. This had
been removed in
<2845794c0c
>
for compatibility with BasicTeX, but that is no longer an issue.
158 lines
4.3 KiB
Text
158 lines
4.3 KiB
Text
% Options for packages loaded elsewhere
|
|
\PassOptionsToPackage{unicode}{hyperref}
|
|
\PassOptionsToPackage{hyphens}{url}
|
|
%
|
|
\documentclass[
|
|
english,
|
|
]{article}
|
|
\usepackage{amsmath,amssymb}
|
|
\usepackage{lmodern}
|
|
\usepackage{iftex}
|
|
\ifPDFTeX
|
|
\usepackage[T1]{fontenc}
|
|
\usepackage[utf8]{inputenc}
|
|
\usepackage{textcomp} % provide euro and other symbols
|
|
\else % if luatex or xetex
|
|
\usepackage{unicode-math}
|
|
\defaultfontfeatures{Scale=MatchLowercase}
|
|
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
|
|
\fi
|
|
% Use upquote if available, for straight quotes in verbatim environments
|
|
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
|
|
\IfFileExists{microtype.sty}{% use microtype if available
|
|
\usepackage[]{microtype}
|
|
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
|
|
}{}
|
|
\makeatletter
|
|
\@ifundefined{KOMAClassName}{% if non-KOMA class
|
|
\IfFileExists{parskip.sty}{%
|
|
\usepackage{parskip}
|
|
}{% else
|
|
\setlength{\parindent}{0pt}
|
|
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
|
|
}{% if KOMA class
|
|
\KOMAoptions{parskip=half}}
|
|
\makeatother
|
|
\usepackage{xcolor}
|
|
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
|
|
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
|
|
\hypersetup{
|
|
pdflang={en},
|
|
hidelinks,
|
|
pdfcreator={LaTeX via pandoc}}
|
|
\urlstyle{same} % disable monospaced font for URLs
|
|
\setlength{\emergencystretch}{3em} % prevent overfull lines
|
|
\providecommand{\tightlist}{%
|
|
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
|
|
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
|
|
\ifXeTeX
|
|
% Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
|
|
\usepackage{polyglossia}
|
|
\setmainlanguage[]{english}
|
|
\setotherlanguage[]{german}
|
|
\setotherlanguage[variant=british]{english}
|
|
\setotherlanguage[variant=swiss]{german}
|
|
\setotherlanguage[]{spanish}
|
|
\setotherlanguage[]{french}
|
|
\else
|
|
\usepackage[ngerman,british,nswissgerman,spanish,french,main=english]{babel}
|
|
% get rid of language-specific shorthands (see #6817):
|
|
\let\LanguageShortHands\languageshorthands
|
|
\def\languageshorthands#1{}
|
|
\newcommand{\textgerman}[2][]{\foreignlanguage{ngerman}{#2}}
|
|
\newenvironment{german}[2][]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}}
|
|
\newcommand{\textenglish}[2][]{\foreignlanguage{british}{#2}}
|
|
\newenvironment{english}[2][]{\begin{otherlanguage}{british}}{\end{otherlanguage}}
|
|
\let\oritextspanish\textspanish
|
|
\AddBabelHook{spanish}{beforeextras}{\renewcommand{\textspanish}{\oritextspanish}}
|
|
\AddBabelHook{spanish}{afterextras}{\renewcommand{\textspanish}[2][]{\foreignlanguage{spanish}{##2}}}
|
|
\newcommand{\textfrench}[2][]{\foreignlanguage{french}{#2}}
|
|
\newenvironment{french}[2][]{\begin{otherlanguage}{french}}{\end{otherlanguage}}
|
|
\fi
|
|
\ifLuaTeX
|
|
\usepackage{selnolig} % disable illegal ligatures
|
|
\fi
|
|
\ifXeTeX
|
|
% Load bidi as late as possible as it modifies e.g. graphicx
|
|
\usepackage{bidi}
|
|
\fi
|
|
\ifPDFTeX
|
|
\TeXXeTstate=1
|
|
\newcommand{\RL}[1]{\beginR #1\endR}
|
|
\newcommand{\LR}[1]{\beginL #1\endL}
|
|
\newenvironment{RTL}{\beginR}{\endR}
|
|
\newenvironment{LTR}{\beginL}{\endL}
|
|
\fi
|
|
|
|
\author{}
|
|
\date{}
|
|
|
|
\begin{document}
|
|
|
|
\hypertarget{empty-divs-and-spans}{%
|
|
\section{Empty Divs and Spans}\label{empty-divs-and-spans}}
|
|
|
|
Some text and
|
|
|
|
div contents
|
|
|
|
and more text.
|
|
|
|
Next paragraph with a {span} and a word-thatincludesa{span}right?
|
|
|
|
\hypertarget{directionality}{%
|
|
\section{Directionality}\label{directionality}}
|
|
|
|
Some text and
|
|
|
|
\begin{RTL}
|
|
rtl div contents
|
|
\end{RTL}
|
|
|
|
and more text.
|
|
|
|
\begin{LTR}
|
|
and a ltr div. with a \RL{rtl span}.
|
|
\end{LTR}
|
|
|
|
Next paragraph with a \RL{rtl span} and a
|
|
word-that-includesa\LR{ltrspan}right?
|
|
|
|
\hypertarget{languages}{%
|
|
\section{Languages}\label{languages}}
|
|
|
|
Some text and
|
|
|
|
\begin{german}
|
|
|
|
German div contents
|
|
|
|
\end{german}
|
|
|
|
and more text.
|
|
|
|
Next paragraph with a \textenglish[variant=british]{British span} and a
|
|
word-that-includesa\textgerman[variant=swiss]{Swiss German span}right?
|
|
|
|
Some \textspanish{Spanish text}.
|
|
|
|
\hypertarget{combined}{%
|
|
\section{Combined}\label{combined}}
|
|
|
|
Some text and
|
|
|
|
\begin{RTL}
|
|
\begin{french}
|
|
|
|
French rtl div contents
|
|
|
|
\end{french}
|
|
\end{RTL}
|
|
|
|
and more text.
|
|
|
|
Next paragraph with a \LR{\textenglish[variant=british]{British ltr
|
|
span}} and a word-that-includesa\LR{\textgerman[variant=swiss]{Swiss
|
|
German ltr span}}right?
|
|
|
|
\end{document}
|