Posts

Showing posts from December 3, 2018

ruler line not in the middle of color bars

Image
up vote 3 down vote favorite Below code use positioning packet to put ruler line between two color lines. But the result not as expected! documentclass[border=1pt,varwidth=5cm]{standalone} usepackage{tikz} usetikzlibrary{positioning} begin{document} newcommandcolorrulemix[1]{textcolor{#1!40!gray}{rule{0.5cm}{0.5cm}} } newcommandcolorrule[1]{textcolor{#1}{rule{0.5cm}{0.5cm}} } begin{tikzpicture}[node distance=0] foreach name [count=i] in {{red},{orange},{yellow},{green},{cyan},{blue},{purple}} { node (Pi) at (i*0.6cm,0) {colorrule{name}}; } node[below=0.1 of P4] {rule{4.5cm}{1pt}}; foreach name [count=i] in {{red},{orange},{yellow},{green},{cyan},{blue},{purple}} { node [below=0.2 of Pi] (Qi) {colorrulemix{name}}; } end{tikzpicture} end{document}