GeneralApplication of Category Codes

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
loesung
Posts: 2
Joined: Fri Jun 17, 2011 5:25 pm

Application of Category Codes

Post by loesung »

I want to write fractions using different syntax, instead of using \frac{ab}{cd}, I would prefer to write something like \frac{ab⌂cd} where the Unicode is the }{.

My understanding of TeX is limited, but I think I can use \catcode to do this, My understanding is that:
  • \catcode `@=2 is equivalent to }
  • \catcode `@=1 is equivalent to {
However just writing the following doesn't work.

Code: Select all

\catcode`\⌂=\active
\def ⌂{ \catcode `@=2 \catcode `@=1 }
Any ideas?

Thanks in advance!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Application of Category Codes

Post by localghost »

Just for information to other users for awareness of possibly already existing solutions. The question has also been posted to {TeX} SX (with an accepted answer).

In the view of the occasion I refer to our Board Rules. Crosspostings have to be mentioned with a direct link to the question at the other place. This is the second time that you do so despite the admonition for your first crossposting.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

Re: Application of Category Codes

Post by Stefan Kottwitz »

You spent some time for good formatting of the question, great. Simply add links to cross-posts, to avoid making people upset because they wasted time.

Yes, without Thorstens link I would have wasted my free time on this problem, which is obviously solved, but you did not give readers a chance to see this.

Next time please add a link. That's also important on other sites, to see parallel discussions and existing solutions, so also on TeX.SE.

Stefan
LaTeX.org admin
Post Reply