You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
5.2 KiB

  1. <?php
  2. // Project: Web Reference Database (refbase) <http://www.refbase.net>
  3. // Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
  4. // original author(s).
  5. //
  6. // This code is distributed in the hope that it will be useful,
  7. // but WITHOUT ANY WARRANTY. Please see the GNU General Public
  8. // License for more details.
  9. //
  10. // File: ./includes/transtab_refbase_bibtex.inc.php
  11. // Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_refbase_bibtex.inc.php $
  12. // Author(s): Matthias Steffens <mailto:refbase@extracts.de>
  13. //
  14. // Created: 28-May-06, 17:01
  15. // Modified: $Date: 2008-07-30 15:23:57 +0000 (Wed, 30 Jul 2008) $
  16. // $Author: msteffens $
  17. // $Revision: 1184 $
  18. // Search & replace patterns for conversion from refbase markup to LaTeX/BibTeX markup & entities. Converts refbase fontshape markup (italic, bold) into
  19. // LaTeX commands of the 'textcomp' package, super- and subscript as well as greek letters get converted into the respective commands in math mode.
  20. // You may need to adopt the LaTeX markup to suit your individual needs.
  21. // Notes: - when exporting MODS XML with '$convertExportDataToUTF8' set to "yes" in 'ini.inc.php', we convert refbase character markup (such as greek letters)
  22. // to appropriate UTF-8 entities and let bibutils take care of the conversion to LaTeX markup; in this case, this conversion table only kicks in for
  23. // refbase markup that was NOT converted to UTF-8, i.e. fontshape markup and super- and subscript text that has no matching Unicode entities
  24. // - search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes
  25. $transtab_refbase_bibtex = array(
  26. "/\\\\_\\\\_(?!_)(.+?)\\\\_\\\\_/" => '\\1', // underline is currently removed; instead, you could use '\\ul{\\1}' which requires '\usepackage{soul}'; the pattern for underline (__...__) must come before the one for italic (_..._); see note below w.r.t. backslashes before substrings
  27. "/\\\\_(.+?)\\\\_/" => '\\textit{\\1}', // or use '\\it{\\1}' (the backslashes before the substrings were inserted by bibutils: '_word_' gets '\_word\_')
  28. "/\\*\\*(.+?)\\*\\*/" => '\\textbf{\\1}', // or use '\\bf{\\1}'
  29. "/\\[super:(.+?)\\]/i" => '$^{\\1}$', // or use '\\textsuperscript{\\1}'
  30. "/\\[sub:(.+?)\\]/i" => '$_{\\1}$', // or use '\\textsubscript{\\1}' if defined in your package
  31. "/\\[permil\\]/" => '{\\textperthousand}',
  32. "/\\[infinity\\]/" => '$\\infty$',
  33. "/\\[alpha\\]/" => '$\\alpha$',
  34. "/\\[beta\\]/" => '$\\beta$',
  35. "/\\[gamma\\]/" => '$\\gamma$',
  36. "/\\[delta\\]/" => '$\\delta$',
  37. "/\\[epsilon\\]/" => '$\\epsilon$',
  38. "/\\[zeta\\]/" => '$\\zeta$',
  39. "/\\[eta\\]/" => '$\\eta$',
  40. "/\\[theta\\]/" => '$\\theta$',
  41. "/\\[iota\\]/" => '$\\iota$',
  42. "/\\[kappa\\]/" => '$\\kappa$',
  43. "/\\[lambda\\]/" => '$\\lambda$',
  44. "/\\[mu\\]/" => '$\\mu$',
  45. "/\\[nu\\]/" => '$\\nu$',
  46. "/\\[xi\\]/" => '$\\xi$',
  47. "/\\[omicron\\]/" => '$o$',
  48. "/\\[pi\\]/" => '$\\pi$',
  49. "/\\[rho\\]/" => '$\\rho$',
  50. "/\\[sigmaf\\]/" => '$\\varsigma$',
  51. "/\\[sigma\\]/" => '$\\sigma$',
  52. "/\\[tau\\]/" => '$\\tau$',
  53. "/\\[upsilon\\]/" => '$\\upsilon$',
  54. "/\\[phi\\]/" => '$\\phi$',
  55. "/\\[chi\\]/" => '$\\chi$',
  56. "/\\[psi\\]/" => '$\\psi$',
  57. "/\\[omega\\]/" => '$\\omega$',
  58. "/\\[Alpha\\]/" => '$A$',
  59. "/\\[Beta\\]/" => '$B$',
  60. "/\\[Gamma\\]/" => '$\\Gamma$',
  61. "/\\[Delta\\]/" => '$\\Delta$',
  62. "/\\[Epsilon\\]/" => '$E$',
  63. "/\\[Zeta\\]/" => '$Z$',
  64. "/\\[Eta\\]/" => '$H$',
  65. "/\\[Theta\\]/" => '$\\Theta$',
  66. "/\\[Iota\\]/" => '$I$',
  67. "/\\[Kappa\\]/" => '$K$',
  68. "/\\[Lambda\\]/" => '$\\Lambda$',
  69. "/\\[Mu\\]/" => '$M$',
  70. "/\\[Nu\\]/" => '$N$',
  71. "/\\[Xi\\]/" => '$\\Xi$',
  72. "/\\[Omicron\\]/" => '$O$',
  73. "/\\[Pi\\]/" => '$\\Pi$',
  74. "/\\[Rho\\]/" => '$R$',
  75. "/\\[Sigma\\]/" => '$\\Sigma$',
  76. "/\\[Tau\\]/" => '$T$',
  77. "/\\[Upsilon\\]/" => '$\\Upsilon$',
  78. "/\\[Phi\\]/" => '$\\Phi$',
  79. "/\\[Chi\\]/" => '$X$',
  80. "/\\[Psi\\]/" => '$\\Psi$',
  81. "/\\[Omega\\]/" => '$\\Omega$',
  82. "/^(?=(URL|LOCATION|NOTE|KEYWORDS)=)/mi" => 'opt'
  83. );
  84. ?>