📚 The CoCalc Library - books, templates and other resources
cocalc-examples / martinthoma-latex-examples / documents / bachelor-proposal-latex-writing-recognition / mystyle.sty
132934 viewsLicense: OTHER
12%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%3% conditional for xetex or luatex4\newif\ifxetexorluatex5\ifxetex6\xetexorluatextrue7\else8\ifluatex9\xetexorluatextrue10\else11\xetexorluatexfalse12\fi13\fi14%15\ifxetexorluatex%16\usepackage{fontspec}17\usepackage{libertine} % or use \setmainfont to choose any font on your system18\newfontfamily\quotefont[Ligatures=TeX]{Linux Libertine O} % selects Libertine as the quote font19\else20\usepackage[utf8]{inputenc}21\usepackage[T1]{fontenc}22\usepackage{libertine} % or any other font package23\newcommand*\quotefont{\fontfamily{LinuxLibertineT-LF}} % selects Libertine as the quote font24\fi2526\newcommand*\quotesize{60} % if quote size changes, need a way to make shifts relative27% Make commands for the quotes28\newcommand*{\openquote}29{\tikz[remember picture,overlay,xshift=-4ex,yshift=-2.5ex]30\node (OQ) {\quotefont\fontsize{\quotesize}{\quotesize}\selectfont``};\kern0pt}3132\newcommand*{\closequote}[1]33{\tikz[remember picture,overlay,xshift=4ex,yshift={#1}]34\node (CQ) {\quotefont\fontsize{\quotesize}{\quotesize}\selectfont''};}3536% select a colour for the shading37\colorlet{shadecolor}{white}3839\newcommand*\shadedauthorformat{\emph} % define format for the author argument4041% Now a command to allow left, right and centre alignment of the author42\newcommand*\authoralign[1]{%43\if#1l44\def\authorfill{}\def\quotefill{\hfill}45\else46\if#1r47\def\authorfill{\hfill}\def\quotefill{}48\else49\if#1c50\gdef\authorfill{\hfill}\def\quotefill{\hfill}51\else\typeout{Invalid option}52\fi53\fi54\fi}55% wrap everything in its own environment which takes one argument (author) and one optional argument56% specifying the alignment [l, r or c]57%58\newenvironment{shadequote}[2][l]%59{\authoralign{#1}60\ifblank{#2}61{\def\shadequoteauthor{}\def\yshift{-2ex}\def\quotefill{\hfill}}62{\def\shadequoteauthor{\par\authorfill\shadedauthorformat{#2}}\def\yshift{2ex}}63\begin{snugshade}\begin{quote}\openquote}64{\shadequoteauthor\quotefill\closequote{\yshift}\end{quote}\end{snugshade}}656667