1

I know there are many questions about the list of symbols and abbreviations already posted but I can not find one that solves my problem directly. I found one answer (https://tex.stackexchange.com/a/366282/211159)(method 4) which relates to my question but it requires loading external files. I am using Overleaf as my tex editor so I am not entirely sure how to do that.

I am thinking of either using the glossaries acro or nomencl packages. I think nomencl is the most straightforward.

What I want:

  1. To define all my symbols and/or abbreviations in a .aux or .bib master file (can be a separate file for symbols and one for abbreviations if necessary)
  2. When I type in my document and use for example \ac{NY} the abbreviation 'NY' appears in my text and the entry is taken from the .bib or .aux file and added to the List of Abbreviations.
  3. Use the code \input{ListofSymb} where I want the list to appear.

I do something similar with my preamble and my bibliography, whereby I have a master list that I have for all my projects and I just recall the files using \input.

MWE:

Preamble:

\usepackage{glossaries}

Main file

\documentclass [a4paper,12pt]{report}

\input{1.mypreamble}

\begin{document}

\input{ListofSymb}

This is a test paragraph where I will use some of the entries in the "ListofSymb" file. The entries I use are the only one I want to appear in the printed List of Symbols i.e. Not all symbols in the master list must appear the List of Symbols. I want symbols; $\gls{a}$, $\gls{t}$ and
$\gls{F}$ to appear. Additionally, they should appear in alphabetical order.

\end{document}

ListofSymb

@entry{x,
 name={\ensuremath{x}},
 description={position}
}
@entry{v,
 name={\ensuremath{v}},
 description={velocity}
}
@entry{a,
 name={\ensuremath{a}},
 description={acceleration}
}
@entry{t,
 name={\ensuremath{t}},
 description={time}
}
@entry{F,
 name={\ensuremath{F}},
 description={force}
}

Output:

enter image description here

I'm not sure if the packages and code used in this example is correct but its the closest I could get. I have taken examples from many different answers so it may be slightly jumbled.

  • Please clarify what you mean by "a .aux or .bib master file". Do you literally mean to write to a file such as \jobname.aux that gets overwritten each and every time a LaTeX file is compiled? Pleas clarify. – Mico Jul 19 at 15:17
  • I'm not sure what type of file would be best to use. .tex might work best instead. I just want the file to be a personal database that stores all the symbols I use in my main document. Instead of having all the details of each entry in the main file, I want to have the entry details in a secondary file where i can then use \input – Aaron Rhodes Jul 19 at 15:32
  • I think it's a good idea to avoid file name extensions -- such as log, aux, blg, bbl, bib, and a few others -- that have special meaning to TeX, LaTeX, and friends. .tex is probably safe, though. – Mico Jul 19 at 16:56
  • Okay, so using a .tex file, do you have any idea how i would go about this? Best packages, best syntax etc. – Aaron Rhodes Jul 19 at 16:59
  • I want to try remove excess clutter from my source code, so I want the code for abbreviations in a separate file. Does this make sense? – Aaron Rhodes Jul 19 at 17:50
0

After some searching I found a suitable answer. It is not exactly what I was hoping for in terms of a master list but I am happy with the results I have for now, so I am posting this answer for anyone that has the same problems.

I made use of the standalone package along with the nomenclpackage.

I added the following to my preamble:

\usepackage{standalone}
\usepackage{nomencl}
\makenomenclature

\renewcommand{\nomname}{List of Abbreviations and Symbols}

\renewcommand{\nomgroup}[1]{\bigskip
\ifthenelse{\equal{#1}{S}}{\item[\textbf{\large{Symbols}}]}{%
\ifthenelse{\equal{#1}{A}}{\item[\textbf{\large{Abbreviations}}]}{}}}

Then I created a .tex file called abb.tex with following code:

\documentclass[preview]{standalone}
\usepackage{nomencl}
\makenomenclature
\renewcommand{\nomname}{List of Abbreviations and Symbols}

\renewcommand{\nomgroup}[1]{\bigskip
\ifthenelse{\equal{#1}{S}}{\item[\textbf{\large{Symbols}}]}{%
\ifthenelse{\equal{#1}{A}}{\item[\textbf{\large{Abbreviations}}]}{}}}

\begin{document}
\printnomenclature[3cm]
\nomenclature[A]{ABAQUS/CAE}{Complete Abaqus Environment}
\nomenclature[A]{ASTM}{American Society for Testing and Materials}
\nomenclature[A]{CDM}{Continuum Damage Mechanics}
\nomenclature[A]{CLT}{Cross-Laminated Timber}
\nomenclature[A]{FRP}{Fibre Reinforced Polymer}
\nomenclature[A]{FEM}{Finite Element Modelling}
\nomenclature[A]{FEA}{Finite Element Analysis}
\nomenclature[A]{Glulam}{Glue-Laminated Timber}
\nomenclature[A]{MoR}{Modulus of Rupture}
\nomenclature[A]{MoE}{Modulus of Elasticity}
\nomenclature[A]{NDT}{Non-destructive Tests}
\nomenclature[A]{SA}{South Africa(n)}
\nomenclature[A]{UMAT}{User-defined material model}
\nomenclature[A]{USDFLD}{User-defined field}
\nomenclature[S]{$G$}{Modulus of Rigidity}
\nomenclature[S]{$I_k$}{Moment of inertia of all knots within 15cm of the critical cross section}
\nomenclature[S]{$I_g$}{Gross moment of inertia}

\end{document}

The {standalone} and [preview] allow the abb.tex file to be compiled on its own and then when using an \input{abb} command in the main text file the preamble of the abb.tex file is ignored and does not clash with the existing preamble in the main document.

Therefore my main document MWE is as follows:

\documentclass [a4paper,12pt]{report}
\input{1.mypreamble}
\begin{document}

Some text

\newpage
\input{abb}
\newpage

Some text 

\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.