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
Fonts & Character Sets ⇒ top half of an integral sign
top half of an integral sign
Last edited by manwyddan on Wed Feb 16, 2011 10:32 am, edited 1 time in total.
top half of an integral sign
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:
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.
The unicode-math package even defines \inttop and \intbottom for you (for math mode):
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}
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}
Code: Select all
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\defaultfontfeatures{Mapping=tex-text}
\setmathfont{XITS Math}
\begin{document}
$\inttop$
$\intbottom$
\end{document}
Re: top half of an integral sign
many thanks, much appreciated - I'm using tikz for a number of figures in the book so it works well.
- localghost
- Site Moderator
- Posts: 9201
- Joined: Fri Feb 02, 2007 12:06 pm
top half of an integral sign
Then please mark the topic accordingly as written in Section 3 of the Board Rules (to be read before posting).manwyddan wrote:[…] I'm using tikz for a number of figures in the book so it works well.
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
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1