In latex how to show different types of line, in symbol form as ---- and other forms, in text line.

enter image description here

  • \tikz\draw[...] ...;? – Henri Menke Nov 30 '15 at 8:16

With TikZ you can define your own dash and dot patterns and embed the picture inline using \tikz. As none of the macros in TikZ is e-TeX protected you have to take care of that by yourself by using \protected\def or in this case \DeclareRobustCommand.

  \tikz\draw[#1] (0,0) (0,\the\dimexpr\fontdimen22\textfont2\relax)
  -- (2em,\the\dimexpr\fontdimen22\textfont2\relax);%
  \caption{One-dimensional Fourier spectra for Case A ($M =
    1.5$) at (\emph{a}, \emph{c}) near the wall, $1 - \lvert y \rvert =
    0.04$, and (\emph{b}, \emph{d}) at the centerline:
    \sampleline{}, $\rho$;
    \sampleline{dashed}, $u$;
    \sampleline{dotted}, $v$;
    \sampleline{dash pattern=on .7em off .2em on .2em off .2em}, $w$;
    \sampleline{dash pattern=on .7em off .2em on .05em off .2em}, $T$.
    (\emph{a}, \emph{b}) Streamwise;
    (\emph{c}, \emph{d}) spanwise.}

enter image description here

| improve this answer | |

You can play around with some \rules:

enter image description here



One-dimensional Fourier spectra for Case~A ($M = 1.5$) at $(a,c)$ near the wall,
$1 - |y| = 0.04$, and $(b,d)$ at the centerline:
$(a,b)$ Streamwise;
$(c,d)$ spanwise.


Note that \leaders and \rules have problems surviving \captions, so you may be forced to use the optional argument if you want alternative content to migrate successfully to the LoF/LoT.

| improve this answer | |
  • I think the line corresponding to u should be dashed, rather than loosely dotted. Also a,b,c, and d are presumably labels for subfigures, i.e. no math variables. – Henri Menke Nov 30 '15 at 8:37

Your Answer

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

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