LuXurY LaTeX
Stuff that make LaTeX definitely worth it, but that I have to look up every single time:
- Compilers
- Macros
- Resizing stuff to text/column width
- Adding a full-page segment to a two-column paper
- Adjusting margins
- Glossed linguistic examples
- Ge`ez and Latin script in the same document
Compilers
| if | then |
|---|---|
| Multiple scripts in the same document | XeLaTeX |
| Springer Nature template | pdfLaTeX |
Macros
Example macro with two arguments that creates a clean version of an unwieldy URL whilst retaining all the https://s and encoded mess in its clickable version:
\newcommand{\cleanurl}[2]{\href{#1}{\nolinkurl{#2}}}
% usage: \cleanurl{https://www.unwieldy.nope}{unwieldy.nope}
Resizing stuff to text/column width
Essentially
\resizebox{\textwidth}{!}{whatever}
% replace \textwidth with \columnwidth as needed
% prepend 0.N to \xxxwidth if the content should be resized to a fraction of the given width
but for tables, the box should be around the tabular and not wrap the entire table environment.
Adding a full-page segment to a two-column paper
\onecolumn
Adjusting margins
\usepackage[margin=Xin]{geometry}
Glossed linguistic examples
Add
\usepackage{covington}
and optionally
\setglossoptions{
fspreamble=\scshape\small, % style of the pre-gloss text
fsi=\itshape, % style of the main text
fsii=\normalfont} % style of the gloss
(there is also a bunch of other options, described in the awfully long incredibly thorough covington package docs; these are the ones I most commonly use)
Use as:
\begin{example}
\label{utbildning}
\digloss[preamble=Swedish]
{En bra mening behöver inte vara en bra exempelmening .}
{a good sentence need.PRES not be a good example.sentence .}
{A good sentence is not necessarily a good example sentence. }
\end{example}
which will render as

\triglosses are also possible.
Ge`ez and Latin script in the same document
\usepackage{polyglossia}
\usepackage{microtype, newunicodechar}
\usepackage[sf, bf, big]{titlesec}
\defaultfontfeatures{Scale=MatchUppercase}
\setmainfont{Abyssinica SIL}[Scale=1]
\setsansfont{Libertinus Sans}
\setmainlanguage{english}
\setotherlanguage{amharic}
\newunicodechar{፡}{፡\ }
\newunicodechar{።}{\@{።} }
\newunicodechar{፣}{፣ }
\newunicodechar{፤}{፤ }
\newunicodechar{፥}{፥ }
\newunicodechar{፦}{፦ }
\newunicodechar{፧}{\@{፧} }
\newunicodechar{፨}{\@{፨} }
\newunicodechar{፠}{\@{፠} }
\newfontfamily{\amharicfont}{Abyssinica SIL}[
Script=Ethiopic,
Ligatures=Common,
WordSpace = {0.1,30.0,1.0}]