4

I am producing maps using OSGB references. However, I am using a 500m square grid, not 1km square. I would like to show the grid reference in a 3 digit format, the final digit being in a smaller font than the first two digits, e.g. the Easting 63 showing as 630, with the 0 showing as a smaller font, the next Easting is 635 with the 5 in a smaller font, the next Easting as 640 and so on. I am clueless on scripts. Sorry. I have searched on this site and on Youtube but can't find what I'm looking for in a format I can understand. I have found a piece of code I can utilise to produce a three digit format, left(right(@grid_number,5),2)but can't work out how to make the last digit smaller.

4

You can change the 3rd number to a subscript.

The ascii codes for sub-scripted numbers range from 8320 to 8329, so we can extract the 3rd number, add 8320 to it and transform this new value to a character.

Create a grid, edit its properties, show the coordinates using a custom format. Click the epsilon button beside it.

Enter the following function

left(@grid_number,2) || char(8320 + substr(@grid_number,3,1) )

It takes the grid coordinates and keeps the first 2 numbers, then it concatenates (||) the subscript.

The subscript is constructed by extracting 1 character from the 3rd position, adding 8320 to it and transforming this value in the a character.

enter image description here

4
  • To have more control over the sizing, one can also draw 2 grids. The first one would show the first 2 digits and the second one would be drawn with an offset, with no pen (i.e. no grid line) and a smaller font. It is a pain to align the sides and top/bottom though... – JGH Apr 26 at 17:18
  • Nice answer. May I ask why did you paste a comment under your answer instead of extending the answer itself? – Taras Apr 26 at 18:23
  • @Taras because the ratio effort / community gain isn't worth it for this alternative solution, so a comment is enough – JGH Apr 26 at 18:44
  • I modified this slightly to give me the numbering I wanted: left(right(@grid_number,5),2) || char(8320 + substr(@grid_number,4,1) ) – Chris Pendlebury Apr 30 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.