From 9a9f4e74c04e27b611005abecaf76ebcdb0a4bc3 Mon Sep 17 00:00:00 2001 From: Chris Grandin Date: Mon, 23 Sep 2024 21:54:26 -0700 Subject: [PATCH] Fix previous commit so it is backwards compatible. See the comments in the code changed * Add SR isbn_french and isbn_cat_no * Finally figured out how to do an if statement for existence of a YAML tag in the Latex tex template --- inst/csas-tex/res-doc-french.tex | 6 ++++-- inst/csas-tex/sr-french.tex | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/inst/csas-tex/res-doc-french.tex b/inst/csas-tex/res-doc-french.tex index 3accbc26..bd40368e 100644 --- a/inst/csas-tex/res-doc-french.tex +++ b/inst/csas-tex/res-doc-french.tex @@ -39,8 +39,10 @@ % Title \newcommand{\rdTitle}{$title$} -\newcommand{\rdISBN}{$isbn_french$} -\newcommand{\rdCatNo}{$cat_no_french$} +% Use isbn_french and cat_no_french if they exist, if they don't use isbn and cat_no +% This preserves backwards compatibility for those without the french tags +\newcommand{\rdISBN}{\ifx&$isbn_french$& $isbn$ \else $isbn_french$ \fi} +\newcommand{\rdCatNo}{\ifx&$cat_no_french$& $cat_no$ \else $cat_no_french$ \fi} % Author names separated by commas and ', and' for the last author in the format 'M.H. Grinnell' (use \textsuperscript{n} for addresses) \newcommand{\rdAuth}{$author$} diff --git a/inst/csas-tex/sr-french.tex b/inst/csas-tex/sr-french.tex index 88ac4b58..d595a5cd 100644 --- a/inst/csas-tex/sr-french.tex +++ b/inst/csas-tex/sr-french.tex @@ -58,8 +58,10 @@ % Region \newcommand{\rdRegion}{$region$} -\newcommand{\rdISBN}{$isbn$} -\newcommand{\rdCatNo}{$cat_no$} +% Use isbn_french and cat_no_french if they exist, if they don't use isbn and cat_no +% This preserves backwards compatibility for those without the french tags +\newcommand{\rdISBN}{\ifx&$isbn_french$& $isbn$ \else $isbn_french$ \fi} +\newcommand{\rdCatNo}{\ifx&$cat_no_french$& $cat_no$ \else $cat_no_french$ \fi} %%%% End of title page commands %%%%%