• No results found

The ncccomma package

N/A
N/A
Protected

Academic year: 2021

Share "The ncccomma package"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

The ncccomma package

Alexander I. Rozhenko

rozhenko@oapmg.sscc.ru

2005/02/10

The package implements the smart comma in math mode. Let us compare this solution with the concurrent solution from the icomma package by Walter Schmidt: • In icomma, a comma in math works as the punctuation mark if a space goes

after it. Otherwise, it work as an ordinary character;

• In ncccomma, a comma in math works as an ordinary character if a decimal character goes after it. Otherwise, it works as a punctuation mark.

The solution used in this package is more expansive because we compare the next character with up to ten decimal chars. But this solution needs less number of spaces to be inserted into original document (the space is only necessary in the place of a comma delimiting something and a decimal number).

The original math comma is saved in the \mathcomma macro. This macro is

\mathcomma

useful together with the dcolumn package. If a comma should be printed as the decimal separator in a column of type D, it must be specified as {\mathcomma}, rather than {,}, since the latter leads to an error. For example:

\begin{tabular}{D{,}{\mathcomma}{-1}}

The list of decimal characters is saved in the \ordcommalist. It initial

defini-\ordcommalist

tion is

\newcommand\ordcommalist{0123456789} You can redefine it if necessary.

1

The Implementation

We save the original comma in \mathcomma and then specify the comma to be an active char in math.

1h∗packagei

2\mathchardef\mathcomma\mathcode‘\,

3\mathcode‘\,="8000

This file has version number v1.0, last revised 2005/02/10.

(2)

No we define the meaning of comma using the well-known trick with upper case. 4\bgroup 5 \uccode‘\~‘\,% 6 \uppercase{% 7\egroup 8 \def~}{\futurelet\@let@token\NCC@comma}

The smart comma compares the next char with a character of the \ordcommalist in cycle. This cycle is a bit expansive, but it is the payment for smartness.

Referenties

GERELATEERDE DOCUMENTEN

The smart-eqn package aims to provide an automatic and customizable approach for math symbol styling, which eliminates the need to enter style commands repeatedly..

However, remember that texsurgery is a python project whose main focus is on evaluating code inside a jupyter kernel, and this is only achieved by installing the python package

textualicomma is based on the icomma package and intended as a solution for cases where the comma character used in horizontal (i.e. text) mode discerns from the one used in math

After loading of the package, the comma will be typeset as a punctuation character, if the next input character is a space; otherwise the comma is treated as a decimal separator..

The decision to write patches for existing macro packages should not be made lightly: monkey patching done by somebody different from the original package author ties the

For example, the code point U+006E (the Latin lowercase ”n”) followed by U+0303 (the combining tilde) is defined by Unicode to be canonically equivalent to the single code point

The default values for the items in the \paperref environment are the following command punctation begin commands end commands.. \by ,

The EASYBMAT package is a macro package for supporting block matri- ces having equal column widths or equal rows heights or both, and support- ing various kinds of rules (lines)