2pi / karnaugh-map

LaTeX package for drawing karnaugh maps with up to 6 variables
https://www.ctan.org/pkg/karnaugh-map
55 stars 12 forks source link

FeatureRequest: Support showing indices #10

Open jasonf20 opened 6 years ago

jasonf20 commented 6 years ago

allowing printing the indices of the cells would be nice.

If you ever come back to this project and make improvements this could be cool

abondis commented 5 years ago

I don't know if it would be of any use to anybody but I did this to add indices. I'm really new to LaTeX so I did with what I know ... I'm just dropping that here in case anybody in my situation wants something similar: https://github.com/abondis/karnaugh-map/commit/da0bf5e2a7d9443093ef4544bd130d066c942dfc

2pi commented 2 years ago

I've tried a few versions of this. But I'm not really happy with the look of any of them. Taking this off v2.0 for now but leaving this open.

ukanuk commented 2 months ago

For reference, here are three examples I found online which I think look fine. I notice a few tricks they use to improve the look:

  1. Bigger cell margins / smaller text. The increased margins leave space between cell label, index, and implicant edges with less overlapping and crowding. I think it is ok for some indices to overlap with edges, as the pattern will typically be clear anyway from adjacent cells.
  2. Indices in different color; maybe grey if table is in greyscale.
  3. Implicant edges very close to cell edges; i.e. implicant edges may go either inside index or outside index. Either one works to reduce crowding.

https://ctan.math.washington.edu/tex-archive/graphics/pgf/contrib/tikz-karnaugh/doc/tikz-karnaugh-doc.pdf image

https://www.techtarget.com/whatis/definition/Karnaugh-map-K-map image

https://bid.meetbirmingham.com/la/mapa-de-karnaugh-3-variaveis.html image

2pi commented 2 months ago

Thanks for the suggestions! That is quite similar to one option that I tried before and wasn't happy about. Therefore I'm currently more in favor of

Maybe an API exposing positions of different parts of the map would be better.

from #5 and let users add the numbering however they like.