如何制作一个带圆角的简单框架盒?

如何制作一个带圆角的简单框架盒?

我见过与此相关的问题,但自从我尝试以来,都没有成功。我只想制作一个带有圆角的框架框,里面有一个表格。

我已经尝试使用 mdframed 的这个简单示例(在本例中位于花式页脚内):

\documentclass{article}
\usepackage[paperheight=11in,paperwidth=8.5in,top=0.6in,bottom=1.5in,left=0.1in,right=0.1in,headheight=3.0in,footskip=0.1in,includehead]{geometry}
\usepackage{longtable}
\usepackage{graphicx}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage{booktabs}
\usepackage{framed}
\usepackage[xcolor]{mdframed}
\usepackage{ulem}
\pagestyle{fancy}
\usepackage[absolute]{textpos}
\renewcommand\headrulewidth{0pt}
\renewcommand{\rmdefault}{phv}
\renewcommand{\sfdefault}{phv}
\newmdenv[roundcorner=5pt]{myframe}

\fancyhf{}
\fancyhead[l]{

}
\fancyfoot[l]{
        \renewcommand\arraystretch{1.0}
        \small{
        \begin{textblock}{5}(0.5,15.8)
                \begin{tabular}{l}
                        \textbf{ All stocks received are subject to our final inspection. } \\
                        \textbf{ We reserve the right not to accept delivery should the } \\
                        \textbf{ above items do not meet our standards. }
                \end{tabular}
        \end{textblock}
        }
        \normalsize{
        \renewcommand\arraystretch{1.2}
        \begin{textblock}{4.0}(7.1,15.8)
                \begin{myframe}
                        \begin{tabular}{ p{1.85in} }
                                Prepared By: \\
                                \centering{ \textbf{ {.\prepared_by\} } }
                        \end{tabular}
                \end{myframe}
        \end{textblock}
        \begin{textblock}{4.1}(11.3,15.8)
                \begin{myframe}
                        \begin{tabular}{ p{1.85in} }
                                Approved By: \\
                                \centering{ \textbf{ {.\approver\} } }
                        \end{tabular}
                \end{myframe}
        \end{textblock}
        }
}

\begin{document}
\setlength\heavyrulewidth{1.5pt}
\renewcommand\arraystretch{1.5}
\normalsize{
\begin{longtable}[c]{ p{0.6in} p{0.75in} p{3.65in} p{0.8in} p{1.1in} }
        \toprule
        \centering{ \textbf{Qty} } & \textbf{Unit} & \centering{ \textbf{Description} } & \hfill\textbf{Unit Price} & \hfill\textbf{Total} \\
        \hline
        \endfirsthead
        \toprule
        \centering{ \textbf{Qty} } & \textbf{Unit} & \centering{ \textbf{Description} } & \hfill\textbf{Unit Price} & \hfill\textbf{Total} \\
        \hline
        \endhead
        \endfoot
        \endlastfoot
        {.while SELECT b.`description`, a.po_no, a.`item_id`, IF(a.`uom`=0, UPPER(if(a.qty>1,ifnull(c.plural_name,c.short),c.`short`)), UPPER(d.`name`)) AS du_name, a.`uom`, replace(a.qty,'.00','') as qty, a.`price` AS price, a.`total_amt` AS total, IFNULL(purchases.poRRQty(a.client, a.module_id, a.po_no, a.po_dtl_id,0), '0.00')  AS rr_qty, CONCAT(DATE_FORMAT(f.`need_date`, '%m/%d/%Y'), " ",f.`need_time`) AS delivery_date, purchases.`getLocation`(a.`loc_type`, a.`loc`) AS location, a.adj_amt, ifnull(a.remarks,'') as dtl_remarks
                FROM purchases.`purchase_details` a
                        LEFT JOIN items.`profile` b ON a.`item_id`=b.`item_id`
                        LEFT JOIN items.`uoms` c ON b.`uom`=c.`id`
                        LEFT JOIN items.`du` d ON a.`uom`=d.`id` AND a.`item_id`=d.`item_id`
                        LEFT JOIN purchases.`request_details` f ON a.`pr_no`=f.`pr_no` AND a.`pr_dtl_id`=f.`pr_dtl_id` AND f.module_id = a.module_id and f.client = a.client
                WHERE a.`po_no`=0@po_no  and  a.module_id = 0@MODULE_ID  and a.client = 0@T_CLIENT  order by delivery_date,b.description limit -1}
                \centering{ {.\qty\} } & {.\du_name\} & {.\description\} & \hfill{.x`p2:price} & \hfill{.x`p2:total}  \\
                {.if select '@dtl_remarks'!=''}
                        & & \centering{ \small{ {.\dtl_remarks\} } } & & \\
                {.endif}
        {.wend}

        %&&& \hfill PO Total: & \hfill\textbf{ {.x`p2:total_GT} } \\

\end{longtable}
\begin{textblock}{15}(0.5,13.8)
        \begin{tabular}{ p{5.5in} }
                \footnotesize{ \textbf{ {.\notes\} } } \\
        \end{tabular}
\end{textblock}
\begin{textblock}{13.5}(0.3,14.7)
        \begin{tabular}{ p{0.6in} p{0.75in} p{3.65in} p{0.8in} p{1.1in} }
                &&&&\\
                \hline
        \end{tabular}
\end{textblock}
\begin{textblock}{3}(11.1,15.1)
        \begin{tabular}{ p{0.7in} p{1.0in} }
                \underline{ PO Total } : &\textbf P \hfill\textbf{ {.x`p2:total_GT} }\\
        \end{tabular}
\end{textblock}
}
\end{document}

但它不起作用。有什么建议吗?

答案1

下面是一个示例,展示了由带有圆角的框架包围的表格材料形成的页脚:

\documentclass{article}
\usepackage[a6paper]{geometry}
\usepackage{fancyhdr}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{lipsum}

\newmdenv[
  linecolor=cyan,
  linewidth=2pt,
  roundcorner=5pt,
  innertopmargin=0pt,
  innerbottommargin=0pt,
]{myframe}

\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{%
  \begin{myframe}
  \begin{tabular}[t]{@{}l@{}}
  text1 \\
  text2
  \end{tabular}
  \end{myframe}%
}

\begin{document}
\lipsum[2]\lipsum[2]\lipsum[2]\lipsum[2]
\end{document}

enter image description here

一个不太理想的选择:

\documentclass{article}
\usepackage[a6paper]{geometry}
\usepackage{fancyhdr}
\usepackage{fancybox}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{%
  \Ovalbox{\parbox[t]{\dimexpr\linewidth-2\fboxsep-2\fboxrule\relax}{
  \begin{tabular}[t]{@{}l@{}}
  text1 \\
  text2
  \end{tabular}}}%
}

\begin{document}
\lipsum[2]\lipsum[2]\lipsum[2]\lipsum[2]
\end{document}

enter image description here

相关内容