Generalspecial toprule and bottom rule of table

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
samisoma
Posts: 4
Joined: Mon Oct 22, 2007 1:20 pm

special toprule and bottom rule of table

Post by samisoma »

Hi all,
I need to have a table of the following shape:
corner2.jpg
corner2.jpg (14.73 KiB) Viewed 7928 times
Description
toprule
contents
bottomrule

where Description is left-aligned
toprule is a horzontal line with ends having angled-corners opposite to the ones in bottomrule
bottomrule is a horizontal line looks like (|_______________|) but connected (no spaces).

it is something like in the attached file. In fact I am not sure is it "box" or a "table".

thanks for help!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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 more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

special toprule and bottom rule of table

Post by localghost »

Maybe the arydshln package could be helpful.
samisoma
Posts: 4
Joined: Mon Oct 22, 2007 1:20 pm

special toprule and bottom rule of table

Post by samisoma »

localghost wrote: Maybe the arydshln package could be helpful.


thanx for the tip localghost. I was not aware of arydshln (good to know:-)). However, it does not help unless I do some workarounds like introducing table inside another..

Sami
samisoma
Posts: 4
Joined: Mon Oct 22, 2007 1:20 pm

special toprule and bottom rule of table

Post by samisoma »

In cae it is valuable for others. After try-and-error sessions, I got uncomplete solution:

Code: Select all

\par\noindent{\rule[-5pt]{0.4pt}{5pt}\leaders\hrule\hfill\rule[-5pt]{0.4pt}{5pt}}\newline

The contents

\vspace*{-5pt}\par\noindent\textcolor{inputcol}{\rule{0.4pt}{5pt}\leaders\hrule\hfill\rule{0.4pt}{5pt}} \newline

I need to put it in a new \newcommand, but the problem now is how to add \caption to it to be on top of the top-rule, lef-align and without vspace

any help?
samisoma
Posts: 4
Joined: Mon Oct 22, 2007 1:20 pm

special toprule and bottom rule of table

Post by samisoma »

The final solution:

Code: Select all

\documentclass[12pt,letterpaper]{report}
\begin{document}

\newcommand{\mytoprule}[1]{#1\vspace*{-12pt}\par\noindent{\rule[-5pt]{0.4pt}{5pt}\leaders\hrule\hfill\rule[-5pt]{0.4pt}{5pt}}\newline}

\newcommand{\mybottomrule}{\vspace*{-1pt}\par\noindent{\rule{0.4pt}{5pt}\leaders\hrule\hfill\rule{0.4pt}{5pt}}\newline}

\mytoprule{{\flushleft S{\footnotesize YNTAX}E{\footnotesize XTENSION}}}
  \begin{tabular}{ll}				
    $F\ ::=\ /\ |\ *\ |\ f $	&	\textit{Field Pattern} \\
  \end{tabular}
\mybottomrule
\end{document}
It will produce:
corner3.jpg
corner3.jpg (8.07 KiB) Viewed 7882 times
Thanx for your help!
Sami
Post Reply