2

I have this code, which I want to arrange in alphabetical order:

\section{Abbreviations} 
\doublespacing
\begin{tabular}{p{4cm}p{12cm}}
\textbf{AD}  & Alzheimer's disease \\
\textbf{FAD}  & Familial Alzheimer's disease \\
\textbf{LOAD}  & Late-onset Alzheimer's disease \\
\textbf{A\textbeta\ }  & Amyloid- \textbeta\  \\
\textbf{APP}  & Amyloid precursor protein \\
\textbf{GWAS}  & Genome-wide-association studies \\
\textbf{SNP}  & Single nucleotide polymorphisms \\
\textbf{CXCL10}  & C-X-C motif chemokine 10 \\
\textbf{OAS1}  & 2’-5’-oligoadenylate synthase 1\\
\textbf{TREM2}  & Triggering receptor expressed on myeloid cells 2 \\
\textbf{R47H KI}  & \textit{Trem2} R47H knock-in mice \\
\textbf{APP KI}  & \textit{APP\textsuperscript{NL-G-F}} knock-in mice \\
\textbf{WT}  & Wild type  \\
\textbf{HO}  & Homozygous \\
\textbf{HET}  & Heterozygous \\
\textbf{P1-P3}  & Postnatal day 1-3\\
\textbf{RT-qPCR}  & Real-time Quantitative PCR  \\
\textbf{CT}  & Cycle threshold \\
\textbf{IHC}  & Immunohistochemistry \\
\textbf{PBS}  & Phosphate-buffered saline \\
\textbf{PBST}  & Phosphate-buffered saline 0.3\% Triton \\
\textbf{TBS}  & Tris-buffered saline \\
\textbf{TBST}  & Tris-buffered saline 0.1\% Tween-20 \\
\end{tabular}

How can I do that? Help is hugely appreciated. Thanks!

Bernard
  • 271,350
Dimitra
  • 81
  • This question is a duplicate of this one: https://tex.stackexchange.com/q/372603/138900 do you agree with that? – AndréC Aug 11 '19 at 18:22

1 Answers1

4

First, remove all \textbf{}. Load array and use the command >{\bfseries} to make the first column boldface.

Thereafter, see if your text editor has a line sorting function, mark all the lines that you want to sort, and sort them. If not, copy the lines to a word processor or spreadsheet, or save the lines as a text file and pipe it through a the sort filter at your operating system command prompt (Windowds command line sort < tobesort.txt > sorted.txt), and sort.

You have to check the ISO sorting rules for you language to decide where to place the Greek letter. In Norwegian, the was sorted as the last line starting with A.

Unless you have tens of similar tabulars to sort, this approach is the simplest and fastest, if not someone provide a sorting algorithm that can sort according to your language requirements.

enter image description here

\documentclass{article}
\usepackage{array}

\begin{document}

\section{Abbreviations} 

\begin{tabular}{@{}>{\bfseries}p{4cm}p{12cm}@{}}
AD  & Alzheimer's disease \\
APP  & Amyloid precursor protein \\
APP KI  & \textit{APP\textsuperscript{NL-G-F}} knock-in mice \\
A\boldmath{$\beta$}\   & Amyloid-$\beta$\  \\
CT  & Cycle threshold \\
CXCL10  & C-X-C motif chemokine 10 \\
FAD  & Familial Alzheimer's disease \\
GWAS  & Genome-wide-association studies \\
HET  & Heterozygous \\
HO  & Homozygous \\
IHC  & Immunohistochemistry \\
LOAD  & Late-onset Alzheimer's disease \\
OAS1  & 2’-5’-oligoadenylate synthase 1\\
P1-P3  & Postnatal day 1-3\\
PBS  & Phosphate-buffered saline \\
PBST  & Phosphate-buffered saline 0.3\% Triton \\
R47H KI  & \textit{Trem2} R47H knock-in mice \\
RT-qPCR  & Real-time Quantitative PCR  \\
SNP  & Single nucleotide polymorphisms \\
TBS  & Tris-buffered saline \\
TBST  & Tris-buffered saline 0.1\% Tween-20 \\
TREM2  & Triggering receptor expressed on myeloid cells 2 \\
WT  & Wild type  \\

\end{tabular}

\end{document}
Sveinung
  • 20,355