Fonts & Character Setstop half of an integral sign

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
manwyddan
Posts: 2
Joined: Wed Feb 09, 2011 3:53 pm

top half of an integral sign

Post by manwyddan »

Hi, I'm writing a book on computer science and I'm intending to include a copy of an ASCII table of the old extended character set which included characters for the upper and lower half of an integral sign. There's no obvious symbol, but the the characters are U+2320 and U+2321. I've tried using inputenc/utf8x and declaring the new symbols but I get the message 'Undefined control sequence'.

The relevant lines are ...
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{textcomp}

\DeclareUnicodeCharacter{"2320}{\integraltp}
\DeclareUnicodeCharacter{"2321}{\integralbt}

and then later
148 & 94 & \"{o} & 180 & B4 & \textSFix & 212 & D4 & \textSFl & 244 & F4 & \integraltp \\

where I try to use the character (and get the error message).

I'm new to Latex and clearly there's something I don't understand going on here - if anyone would like to chip in with a suggestion as to how I might sort this out, that would be great.

cheers
-manwyddan
Last edited by manwyddan on Wed Feb 16, 2011 10:32 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

top half of an integral sign

Post by frabjous »

The default LaTeX fonts aren't Unicode-compliant and don't have all the Unicode spots filled. The only way I can think of making half an integral sign in regular LaTeX would be to clip a regular integral sign with, e.g., TikZ, e.g., something like this:

Code: Select all

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\clip (0,0) rectangle (1,1);
\draw (0,0) node {\Huge$\int$};
\end{tikzpicture}
\end{document}
No doubt you'd need to tweak that according to your needs.

An alternative, however, would be to switch to XeLaTeX and use a Unicode math font with the fontspec/unicode-math packages. That actually would be fairly easy.

Code: Select all

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\newcommand{\integraltp}{{\fontspec{XITS Math}\char"2320}}
\newcommand{\integralbt}{{\fontspec{XITS Math}\char"2321}}
\begin{document}
\integraltp 
\integralbt
\end{document}
The unicode-math package even defines \inttop and \intbottom for you (for math mode):

Code: Select all

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\defaultfontfeatures{Mapping=tex-text}
\setmathfont{XITS Math}
\begin{document}
$\inttop$
$\intbottom$
\end{document}
manwyddan
Posts: 2
Joined: Wed Feb 09, 2011 3:53 pm

Re: top half of an integral sign

Post by manwyddan »

many thanks, much appreciated - I'm using tikz for a number of figures in the book so it works well.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

top half of an integral sign

Post by localghost »

manwyddan wrote:[…] I'm using tikz for a number of figures in the book so it works well.
Then please mark the topic accordingly as written in Section 3 of the Board Rules (to be read before posting).


Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply