 EXCJSCC                   = require './exceljs-spreadsheet-address-codec'
 jr                        = JSON.stringify
 IG                        = require 'intergrid'
+
+#-----------------------------------------------------------------------------------------------------------
+tex = ( source ) -> [ 'tex', source, ]
+
+#-----------------------------------------------------------------------------------------------------------
+texr = ( ref, source ) ->
+  source = if ref? then "#{source}% MKTSTBL #{ref}\n" else "#{source}%\n"
+  return tex source
 
 
 #===========================================================================================================

  unless @_should_debug me
    yield return
  #.........................................................................................................
  yield [ 'tex', "\\begin{scope}[on background layer]\n", ]
  #.........................................................................................................
  for designation, d of me.field_dimensions
    ### TAINT use fixed size like 1mm ###

  for designation, d of me.border_dimensions
    continue unless ( fieldborders = me.fieldborders[ designation ] )?
    if ( borderstyle = fieldborders[ 'left' ] )?
      yield texr '@1', "\\draw[#{borderstyle}] (#{d.left},#{d.top}) -- (#{d.left},#{d.bottom});"
    if ( borderstyle = fieldborders[ 'right' ] )?
      yield texr '@2', "\\draw[#{borderstyle}] (#{d.right},#{d.top}) -- (#{d.right},#{d.bottom});"
    if ( borderstyle = fieldborders[ 'top' ] )?
      yield texr '@4', "\\draw[#{borderstyle}] (#{d.left},#{d.top}) -- (#{d.right},#{d.top});"
    if ( borderstyle = fieldborders[ 'bottom' ] )?
      yield texr '@5', "\\draw[#{borderstyle}] (#{d.left},#{d.bottom}) -- (#{d.right},#{d.bottom});"
  #.........................................................................................................
  yield return

