Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
TeX rendering for unicode big delimiters
Browse files Browse the repository at this point in the history
This prevents LaTeX from balking at the unicode symbols which represent
(parts of) big delimiters.  The symbols are rendered using their equivalent
from the computer modern math extensions font.  So the symbols themselves
look right, even though the spacing is very wrong.  Nevertheless, this
should convey the idea of what gets printed, and should suffice until we
switch to XeTeX or luaTeX with hopefully better Unicode support.

The codes for the characters were found in texmext.enc.  The corresponding
character names were found in the PostScript output of a small test file,
along with CMEX10 as the font, indicating the use of \fontfamily{cmex}.  The
\fontencoding{OMX} to go with that was found in amsmath.sty.  The argument
to \raisebox was a bit of trial and error, and pretty much a rough hack to
at least line up some of the delimiters with their corresponding matrix
rows.

Turning U+253C into + makes it fit in with the surrounding - and | used for
the horizontal and vertical lines.
  • Loading branch information
gagern committed May 5, 2015
1 parent 206b036 commit 6b6f089
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/doc/common/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ def add(subdoc=''):
\DeclareUnicodeCharacter{2510}{+}
\DeclareUnicodeCharacter{2514}{+}
\DeclareUnicodeCharacter{2518}{+}
\DeclareUnicodeCharacter{253C}{+}
\DeclareUnicodeCharacter{03B1}{\ensuremath{\alpha}}
Expand Down Expand Up @@ -383,6 +384,21 @@ def add(subdoc=''):
\DeclareUnicodeCharacter{2308}{\lceil}
\DeclareUnicodeCharacter{2309}{\rceil}
\newcommand{\sageMexSymbol}[1]
{{\fontencoding{OMX}\fontfamily{cmex}\selectfont\raisebox{0.75em}{\symbol{#1}}}}
\DeclareUnicodeCharacter{239B}{\sageMexSymbol{"30}} % parenlefttp
\DeclareUnicodeCharacter{239C}{\sageMexSymbol{"42}} % parenleftex
\DeclareUnicodeCharacter{239D}{\sageMexSymbol{"40}} % parenleftbt
\DeclareUnicodeCharacter{239E}{\sageMexSymbol{"31}} % parenrighttp
\DeclareUnicodeCharacter{239F}{\sageMexSymbol{"43}} % parenrightex
\DeclareUnicodeCharacter{23A0}{\sageMexSymbol{"41}} % parenrightbt
\DeclareUnicodeCharacter{23A1}{\sageMexSymbol{"32}} % bracketlefttp
\DeclareUnicodeCharacter{23A2}{\sageMexSymbol{"36}} % bracketleftex
\DeclareUnicodeCharacter{23A3}{\sageMexSymbol{"34}} % bracketleftbt
\DeclareUnicodeCharacter{23A4}{\sageMexSymbol{"33}} % bracketrighttp
\DeclareUnicodeCharacter{23A5}{\sageMexSymbol{"37}} % bracketrightex
\DeclareUnicodeCharacter{23A6}{\sageMexSymbol{"35}} % bracketrightbt
\let\textLaTeX\LaTeX
\renewcommand*{\LaTeX}{\hbox{\textLaTeX}}
"""
Expand Down

0 comments on commit 6b6f089

Please sign in to comment.