Graphics, Figures & Tables ⇒ Separating Figures from Text with dotted Line
-
- Posts: 4
- Joined: Fri Apr 29, 2011 7:23 pm
Separating Figures from Text with dotted Line
I was wondering if anyone knows of a good way to separate Figures from the body of the document with a dotted line? I'm thinking a dotted line below the figure for those appearing at the top; one above for those appearing at the bottom; and one both above and below for those appearing inside the text on a given page.
I'm using fancyhdr as well so I'd prefer not to use a solid line to separate Figures as it would be too similar to the solid line at the top of each page already.
Any help would be much appreciated - thanks!
-sultan1919
P.S. - I'm sorry if this has been posted before, I couldn't find it in my search.
I'm using fancyhdr as well so I'd prefer not to use a solid line to separate Figures as it would be too similar to the solid line at the top of each page already.
Any help would be much appreciated - thanks!
-sultan1919
P.S. - I'm sorry if this has been posted before, I couldn't find it in my search.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and many kinds of documents
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Separating Figures from Text with dotted Line
LaTeX provides the two macros \topfigrule and \botfigrule for this purpose. Don't be irritated, the two commands apply in general to all floats and not only figures.
The only restriction to their content is that it mustn't occupy vertical space (or this must be compensable).
For floats appearing in the text you my need to do that manually. Perhaps packages like float or floatrow can help in restyling floats.
Thorsten
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{blindtext}
\def\topfigrule{\vskip1ex\noindent\dotfill}
\def\botfigrule{\noindent\dotfill\vskip1ex}
\begin{document}
\blindtext[4]
\begin{figure}[!ht]
\centering
\rule{\linewidth}{0.75\linewidth}
\caption{Dummy figure}\label{fig:dummy}
\end{figure}
\blindtext[3]
\end{document}
For floats appearing in the text you my need to do that manually. Perhaps packages like float or floatrow can help in restyling floats.
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10