0

My document was originally composed with monospace unicode output from a Python terminal. The original layout used blank spaces to align results into columns. I specified the width (in characters) of the columns, if a result was longer than that width, the result would get its own line. Long results include the rows called Mode Info, Mode Jazz, Qualities in the included image.enter image description here

I decided to wrap the book in LaTeX, and have been making progress on replicating my old layout. Here is the part that is working fairly much like what I want.

enter image description here

It uses the following tabular:

\noindent
\begin{tabular}{l| l|l| l| l| l| l| l}
\\
\hline
Jazz & \cellcolor{C}{1} & \cellcolor{D}{2} & \cellcolor{E}{3} & \cellcolor{F}{4} & \cellcolor{G}{5} & \cellcolor{A}{6} & \cellcolor{B}{7}\\
    Chord & \cellcolor{C}{ma7} & \cellcolor{D}{mi7} & \cellcolor{E}{mi7} & \cellcolor{F}{ma7} & \cellcolor{G}{7} & \cellcolor{A}{mi7} & \cellcolor{B}{⌀7}\\
    Classical & \cellcolor{C}{Ⅰ} & \cellcolor{D}{ⅱ} & \cellcolor{E}{ⅲ} & \cellcolor{F}{Ⅳ} & \cellcolor{G}{Ⅴ} & \cellcolor{A}{ⅵ} & \cellcolor{B}{ⅶ}\\
    Solfege & \cellcolor{C}{Do} & \cellcolor{D}{Re} & \cellcolor{E}{Mi} & \cellcolor{F}{Fa} & \cellcolor{G}{Sol} & \cellcolor{A}{La} & \cellcolor{B}{Ti}\\
    Set & \cellcolor{C}{0} & \cellcolor{D}{2} & \cellcolor{E}{4} & \cellcolor{F}{5} & \cellcolor{G}{7} & \cellcolor{A}{9} & \cellcolor{B}{11}\\
    Notation & \cellcolor{C}{S} & \cellcolor{D}{R2} & \cellcolor{E}{G3} & \cellcolor{F}{M1} & \cellcolor{G}{P} & \cellcolor{A}{D2} & \cellcolor{B}{N3}\\
    Mneumonic & \cellcolor{C}{Sa} & \cellcolor{D}{Ri} & \cellcolor{E}{Gu} & \cellcolor{F}{Ma} & \cellcolor{G}{Pa} & \cellcolor{A}{Di} & \cellcolor{B}{Nu}\\
    Key Of B♯ & \cellcolor{C}{B♯} & \cellcolor{D}{C♯♯} & \cellcolor{E}{D♯♯} & \cellcolor{F}{E♯} & \cellcolor{G}{F♯♯} & \cellcolor{A}{G♯♯} & \cellcolor{B}{A♯♯}\\
    Key Of C & \cellcolor{C}{C} & \cellcolor{D}{D} & \cellcolor{E}{E} & \cellcolor{F}{F} & \cellcolor{G}{G} & \cellcolor{A}{A} & \cellcolor{B}{B}\\
    Key Of C♯ & \cellcolor{Db}{C♯} & \cellcolor{Eb}{D♯} & \cellcolor{F}{E♯} & \cellcolor{Gb}{F♯} & \cellcolor{Ab}{G♯} & \cellcolor{Bb}{A♯} & \cellcolor{C}{B♯}\\
    Key Of D♭ & \cellcolor{Db}{D♭} & \cellcolor{Eb}{E♭} & \cellcolor{F}{F} & \cellcolor{Gb}{G♭} & \cellcolor{Ab}{A♭} & \cellcolor{Bb}{B♭} & \cellcolor{C}{C}\\
    Key Of D & \cellcolor{D}{D} & \cellcolor{E}{E} & \cellcolor{Gb}{F♯} & \cellcolor{G}{G} & \cellcolor{A}{A} & \cellcolor{B}{B} & \cellcolor{Db}{C♯}\\
    Key Of D♯ & \cellcolor{Eb}{D♯} & \cellcolor{F}{E♯} & \cellcolor{G}{F♯♯} & \cellcolor{Ab}{G♯} & \cellcolor{Bb}{A♯} & \cellcolor{C}{B♯} & \cellcolor{D}{C♯♯}\\
    Key Of E♭ & \cellcolor{Eb}{E♭} & \cellcolor{F}{F} & \cellcolor{G}{G} & \cellcolor{Ab}{A♭} & \cellcolor{Bb}{B♭} & \cellcolor{C}{C} & \cellcolor{D}{D}\\
    Key Of E & \cellcolor{E}{E} & \cellcolor{Gb}{F♯} & \cellcolor{Ab}{G♯} & \cellcolor{A}{A} & \cellcolor{B}{B} & \cellcolor{Db}{C♯} & \cellcolor{Eb}{D♯}\\'
    Key Of F♭ & \cellcolor{E}{F♭} & \cellcolor{Gb}{G♭} & \cellcolor{Ab}{A♭} & \cellcolor{A}{B♭♭} & \cellcolor{B}{C♭} & \cellcolor{Db}{D♭} & \cellcolor{Eb}{E♭}\\
    Key Of E♯ & \cellcolor{F}{E♯} & \cellcolor{G}{F♯♯} & \cellcolor{A}{G♯♯} & \cellcolor{Bb}{A♯} & \cellcolor{C}{B♯} & \cellcolor{D}{C♯♯} & \cellcolor{E}{D♯♯}\\
    Key Of F & \cellcolor{F}{F} & \cellcolor{G}{G} & \cellcolor{A}{A} & \cellcolor{Bb}{B♭} & \cellcolor{C}{C} & \cellcolor{D}{D} & \cellcolor{E}{E}\\
    Key Of F♯ & \cellcolor{Gb}{F♯} & \cellcolor{Ab}{G♯} & \cellcolor{Bb}{A♯} & \cellcolor{B}{B} & \cellcolor{Db}{C♯} & \cellcolor{Eb}{D♯} & \cellcolor{F}{E♯}\\
    Key Of G♭ & \cellcolor{Gb}{G♭} & \cellcolor{Ab}{A♭} & \cellcolor{Bb}{B♭} & \cellcolor{B}{C♭} & \cellcolor{Db}{D♭} & \cellcolor{Eb}{E♭} & \cellcolor{F}{F}\\
    Key Of G & \cellcolor{G}{G} & \cellcolor{A}{A} & \cellcolor{B}{B} & \cellcolor{C}{C} & \cellcolor{D}{D} & \cellcolor{E}{E} & \cellcolor{Gb}{F♯}\\
    Key Of G♯ & \cellcolor{Ab}{G♯} & \cellcolor{Bb}{A♯} & \cellcolor{C}{B♯} & \cellcolor{Db}{C♯} & \cellcolor{Eb}{D♯} & \cellcolor{F}{E♯} & \cellcolor{G}{F♯♯}\\
    Key Of A♭ & \cellcolor{Ab}{A♭} & \cellcolor{Bb}{B♭} & \cellcolor{C}{C} & \cellcolor{Db}{D♭} & \cellcolor{Eb}{E♭} & \cellcolor{F}{F} & \cellcolor{G}{G}\\
    Key Of A & \cellcolor{A}{A} & \cellcolor{B}{B} & \cellcolor{Db}{C♯} & \cellcolor{D}{D} & \cellcolor{E}{E} & \cellcolor{Gb}{F♯} & \cellcolor{Ab}{G♯}\\
    Key Of A♯ & \cellcolor{Bb}{A♯} & \cellcolor{C}{B♯} & \cellcolor{D}{C♯♯} & \cellcolor{Eb}{D♯} & \cellcolor{F}{E♯} & \cellcolor{G}{F♯♯} & \cellcolor{A}{G♯♯}\\
    Key Of B♭ & \cellcolor{Bb}{B♭} & \cellcolor{C}{C} & \cellcolor{D}{D} & \cellcolor{Eb}{E♭} & \cellcolor{F}{F} & \cellcolor{G}{G} & \cellcolor{A}{A}\\
    Key Of B & \cellcolor{B}{B} & \cellcolor{Db}{C♯} & \cellcolor{Eb}{D♯} & \cellcolor{E}{E} & \cellcolor{Gb}{F♯} & \cellcolor{Ab}{G♯} & \cellcolor{Bb}{A♯}\\
    Key Of C♭ & \cellcolor{B}{C♭} & \cellcolor{Db}{D♭} & \cellcolor{Eb}{E♭} & \cellcolor{E}{F♭} & \cellcolor{Gb}{G♭} & \cellcolor{Ab}{A♭} & \cellcolor{Bb}{B♭}\\
    Chord 🗌 & \cellcolor{C}{🗌191} & \cellcolor{D}{🗌169} & \cellcolor{E}{🗌169} & \cellcolor{F}{🗌191} & \cellcolor{G}{🗌190} & \cellcolor{A}{🗌169} & \cellcolor{B}{🗌165}\\

Step & 2 & 2 & 1 & 2 & 2 & 2 & 1\\
Rhythm & ♩ & ♩ & ♪ & ♩ & ♩ & ♩ & ♪\\

However if I include rows with longer results, the table becomes wider than the page (real quick). Is there a way to check the width of the result and then add more rows?

Thanks ahead of time for any insight into this.

  • 2
    Welcome to TeX.SE! Please make your code snippet -- as usual here -- compilable! – Mensch Jan 14 at 1:10
  • In particular, please do tell us how the cell colors "C", "D", etc are defined. – Mico Jan 14 at 1:20
  • Please clarify what you mean by "Is there a way to check the width of the result and then add more rows?" Are you maybe asking about how to allow automatic line wrapping in a cell? – Mico Jan 14 at 1:50
  • 1
    your question is not at all clear, you have specified no line breaking in each cell (l) you could have cells which linebreak (p{1cm} or you could allow page breaking between rows (longtable) but how does one cell having too much data get translated into having more rows? – David Carlisle Jan 14 at 7:53

Your Answer

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

Browse other questions tagged or ask your own question.