TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I'm looking to do is caption a graph with something like

"It can be seen from x (solid line) and y (dashed line)"

Where "solid line" and "dashed line" are replaced by two solid and dashed lines centered vertically inline with the text of the caption.



Gives a solid line, but it is not centered with respect to the height of the text.

Is this possible?

share|improve this question
up vote 10 down vote accepted

The rule command has a "raise" optional argument:


You can define


and then use

It can be seen from x (\solidrule) and y (\protect\dashedrule)
share|improve this answer

shift the rule with the optional argument:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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