Last active
September 3, 2022 12:55
-
-
Save iverasp/fd39eabc7a779672721fc3654acfd861 to your computer and use it in GitHub Desktop.
LaTeX automatically sorted list of abbreviations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\section{List of abbreviations} | |
\DTLnewdb{acronyms} | |
\addacronym{sps}{Samples Per Second} | |
\addacronym{IMU}{Inertial Measurement Unit} | |
\addacronym{SoC}{System on Chip} | |
\addacronym{DMP}{Digital Motion Processor} | |
\addacronym{DSP}{Digital Signal Processor} | |
\addacronym{QFN}{Quad Flat No-leads} | |
\addacronym{LED}{Light-Emitting Diode} | |
\addacronym{GPIO}{General Purpose Input/Output} | |
\addacronym{MEMS}{Microelectromechanical system} | |
\addacronym{DoF}{Degrees of Freedom} | |
\addacronym{CPU}{Central Processing Unit} | |
\addacronym{FBX}{Filmbox (file format)} | |
\addacronym{IoT}{Internet of Things} | |
\addacronym{SDK}{Software Development Kit} | |
\addacronym{HAL}{Hardware Abstraction Layer} | |
\addacronym{UUID}{Universally Unique Identifier} | |
\addacronym{OS}{Operating System} | |
\addacronym{IDE}{Integrated Development Environment} | |
\addacronym{TI}{Texas Instruments} | |
\addacronym{HID}{Human Interface Device} | |
% Sort the database | |
\DTLsort*{Acronym}{acronyms} | |
% Display the contents of the database | |
\begin{abbreviations} | |
\DTLforeach*{acronyms}{\thisAcronym=Acronym,\thisDesc=Description}% | |
{\item[\thisAcronym] \thisDesc}% | |
\end{abbreviations} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% formatting taken from http://tex.stackexchange.com/questions/149708/simple-list-of-abbreviations-manually | |
% sorting taken from http://www.latex-community.org/forum/viewtopic.php?f=44&t=16419 | |
\usepackage{datatool} | |
% Define a convenient command to add a line | |
% to the database | |
\newcommand*{\addacronym}[2]{% | |
\DTLnewrow{acronyms}% | |
\DTLnewdbentry{acronyms}{Acronym}{#1}% | |
\DTLnewdbentry{acronyms}{Description}{#2}% | |
} | |
% formatting | |
\newcommand{\tocfill}{\cleaders\hbox{$\m@th \mkern\@dotsep mu . \mkern\@dotsep mu$}\hfill} | |
\newcommand{\abbrlabel}[1]{\makebox[3cm][l]{\textbf{#1}\ \tocfill}} | |
\newenvironment{abbreviations}{\begin{list}{}{\renewcommand{\makelabel}{\abbrlabel}% | |
\setlength{\labelwidth}{3cm}\setlength{\leftmargin}{\labelwidth+\labelsep}% | |
\setlength{\itemsep}{0pt}}}{\end{list}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Jenna-Lam
Some issues (such as "@" ones) can come from inserting the code directly into the tex files. Converting abbreviations.tex into a .sty file (latex package) solves them.