helpers.sty 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. \ProvidesPackage{helpers}[2019/11/15 Common/Personal Utility
  2. Commands]
  3. \RequirePackage{ifdraft}
  4. \RequirePackage{setspace}
  5. \RequirePackage{ifmtarg}
  6. \newcommand\mycommon@font{\textit}
  7. \newcommand\foreign[1]{\mycommon@font{#1}}
  8. \ProcessOptions\relax
  9. \ifdraft{\RequirePackage{background}\backgroundsetup{contents={DRAFT}}}
  10. \ifdraft{\RequirePackage[color]{showkeys}}
  11. \ifdraft{\RequirePackage{setspace}\AtBeginDocument{\doublespace}}
  12. \newcommand\@ensurecomma{\@ifnextchar,{}{\PackageWarning{helpers}{
  13. You appear to have forgotten a necessary comma}}}
  14. \newcommand\@ensuresingleperiod{\@ifnextchar.{}{.\@\PackageWarning{helpers}{
  15. You appear to have forgotten a necessary period}}}
  16. \newcommand\commaabbrev[2]{\newcommand#1{\mycommon@font{#2}\@ensurecomma}}
  17. \newcommand\spaceabbrev[2]{\newcommand#1{\mycommon@font{#2}\ }}
  18. \newcommand\periodabbrev[2]{\newcommand#1{\mycommon@font{#2}\@ensuresingleperiod}}
  19. \commaabbrev{\eg}{e.g.}
  20. \commaabbrev{\Eg}{E.g.}
  21. \commaabbrev{\ie}{i.e.}
  22. \commaabbrev{\Ie}{I.e.}
  23. \commaabbrev{\viz}{viz.}
  24. \commaabbrev{\Viz}{Viz.}
  25. \commaabbrev{\ibid}{ibid.}
  26. \commaabbrev{\Ibid}{Ibid.}
  27. \commaabbrev{\ia}{i.a.}
  28. \commaabbrev{\Ia}{I.a.}
  29. \spaceabbrev{\cf}{cf.}
  30. \spaceabbrev{\Cf}{Cf.}
  31. \periodabbrev{\etal}{et al}
  32. \periodabbrev{\Etal}{Et al}
  33. \periodabbrev{\etc}{\&c}
  34. \periodabbrev{\Etc}{\&c}
  35. \periodabbrev{\etseq}{et seq}
  36. \periodabbrev{\Etseq}{Et seq}
  37. \periodabbrev{\Sic}{Sic}
  38. \endinput