pages tagged white_space http://meng6net.localhost/tag/white_space/ <p><small>Copyright © 2005-2020 by <code>Meng Lu &lt;lumeng3@gmail.com&gt;</code></small></p> Meng Lu's home page ikiwiki Tue, 16 May 2017 21:18:29 +0000 White space characters in Wolfram Language / Mathematica http://meng6net.localhost/blog/white_space_characters_in_wolfram_language/ http://meng6net.localhost/blog/white_space_characters_in_wolfram_language/ journal mathematica note to-do white space wolfram language Tue, 17 Mar 2015 06:50:27 +0000 2017-05-16T21:18:29Z <p>In Wolfram Language / Mathematica, there are the following escaped characters that end with <code>Space</code>:</p> <pre><code>$WhiteSpaceCharacters = { "\[AutoSpace]", "\[COMPATIBILITYKanjiSpace]", "\[InvisibleSpace]", "\[LetterSpace]", "\[MediumSpace]", "\[NegativeMediumSpace]", "\[NegativeThickSpace]", "\[NegativeThinSpace]", "\[NegativeVeryThinSpace]", "\[NonBreakingSpace]", "\[RawSpace]", "\[ThickSpace]", "\[ThinSpace]", "\[VeryThinSpace]" } </code></pre> <p>These can be found by evaluating <code>?\[*Space]</code> in a Mathematica notebook.</p> <p>To actually obtain these in copiable text was not straightforward for me as I did not find a programmable way to generate the above list. Instead, I copied the cell expression out (by selecting the output cell, pressing <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>E</kbd>, and copying out the text), and then run <code>ack</code> to extract any strings that start is sandwiched with <code>\[</code> and <code>]</code>:</p> <pre> <code>17:09:43 meng@meng2maclap:~/Temp$ ack -o "\\\\\\\\\[.*Space\]" cellexpr.txt | sort | uniq AutoSpace COMPATIBILITYKanjiSpace InvisibleSpace LetterSpace MediumSpace NegativeMediumSpace NegativeThickSpace NegativeThinSpace NegativeVeryThinSpace NonBreakingSpace RawSpace ThickSpace ThinSpace VeryThinSpace </code></pre> <p>Curiously, only <code>\[AutoSpace]</code>, <code>\[NonBreakingSpace]</code>, <code>\[RawSpace]</code> satisfy <code>StringMatchQ[#, RegularExpression["[[:whitespace:]]"]]&amp;</code>.</p> <p>See the <a href= "http://meng6net.localhost/tag/white_space/white_space_characters_in_wolfram_language.cdf">CDF file</a> for details.</p> /blog/white_space_characters_in_wolfram_language/#comments