1

As part of my document, I'm typing something like $A(.....)$ very often. For the benefits of typography, I would much prefer to have typed \mathcal{A}(...) instead, just so it looks a bit more professional. Like with the little hack for automatically changing the inversion of speech and quotation marks, is there a method to globally swap every instance of a capital A inside an equation to \mathcal{A} instead?

Brad
  • 155
  • Do you have A in any other context as part of math elsewhere? – Werner Mar 11 '19 at 20:40
  • I'd be very surprised if so; if I did, then I would just have to bite the bullet and manually change every instance, which wouldn't be the end of the world, but just a test of my eyesight! As long as it only applies to capital A, then I should be okay. – Brad Mar 11 '19 at 20:41
  • Update, I have just found a case where it's defined in the subscript or superscript of a different function... – Brad Mar 11 '19 at 20:43
  • It would be better to use a regular expression to change all instances of A(...) into something like \Amacro{...} where you define \Amacro to take a single argument and output \mathcal{A}(#1), say, promoting consistent typography. – Werner Mar 11 '19 at 20:52
  • @Werner that would be the ideal suggestion; however, my experience with in-depth LaTeX use is limited. Would I be able to ask you for a suggestion on how to implement this, or a link to some useful literature? Every case that I'm looking to change has an amplitude written as A(*some stuff*). – Brad Mar 11 '19 at 21:04
  • I'm not that familiar enough with grepping stuff. There's fart on Windows, otherwise most Unix-related systems provides grep out-of-the-box to physically change content within a file. – Werner Mar 11 '19 at 21:08
  • @Werner I think you mean sed not grep, grep just has search not search and replace, but Brad they are command line tools, you could do the replacement just as easily inside whatever editor you are using to write the file. – David Carlisle Mar 11 '19 at 21:27

1 Answers1

3
\documentclass{article}

\DeclareMathSymbol{A}{\mathalpha}{symbols}{`A}

\begin{document}

$ABC+BCA$

\end{document}

enter image description here

David Carlisle
  • 757,742