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

Commit 6b6f089

Browse files
committed
TeX rendering for unicode big delimiters
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.
1 parent 206b036 commit 6b6f089

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/doc/common/conf.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ def add(subdoc=''):
321321
\DeclareUnicodeCharacter{2510}{+}
322322
\DeclareUnicodeCharacter{2514}{+}
323323
\DeclareUnicodeCharacter{2518}{+}
324+
\DeclareUnicodeCharacter{253C}{+}
324325
325326
326327
\DeclareUnicodeCharacter{03B1}{\ensuremath{\alpha}}
@@ -383,6 +384,21 @@ def add(subdoc=''):
383384
\DeclareUnicodeCharacter{2308}{\lceil}
384385
\DeclareUnicodeCharacter{2309}{\rceil}
385386
387+
\newcommand{\sageMexSymbol}[1]
388+
{{\fontencoding{OMX}\fontfamily{cmex}\selectfont\raisebox{0.75em}{\symbol{#1}}}}
389+
\DeclareUnicodeCharacter{239B}{\sageMexSymbol{"30}} % parenlefttp
390+
\DeclareUnicodeCharacter{239C}{\sageMexSymbol{"42}} % parenleftex
391+
\DeclareUnicodeCharacter{239D}{\sageMexSymbol{"40}} % parenleftbt
392+
\DeclareUnicodeCharacter{239E}{\sageMexSymbol{"31}} % parenrighttp
393+
\DeclareUnicodeCharacter{239F}{\sageMexSymbol{"43}} % parenrightex
394+
\DeclareUnicodeCharacter{23A0}{\sageMexSymbol{"41}} % parenrightbt
395+
\DeclareUnicodeCharacter{23A1}{\sageMexSymbol{"32}} % bracketlefttp
396+
\DeclareUnicodeCharacter{23A2}{\sageMexSymbol{"36}} % bracketleftex
397+
\DeclareUnicodeCharacter{23A3}{\sageMexSymbol{"34}} % bracketleftbt
398+
\DeclareUnicodeCharacter{23A4}{\sageMexSymbol{"33}} % bracketrighttp
399+
\DeclareUnicodeCharacter{23A5}{\sageMexSymbol{"37}} % bracketrightex
400+
\DeclareUnicodeCharacter{23A6}{\sageMexSymbol{"35}} % bracketrightbt
401+
386402
\let\textLaTeX\LaTeX
387403
\renewcommand*{\LaTeX}{\hbox{\textLaTeX}}
388404
"""

0 commit comments

Comments
 (0)