5

I was referring the psvectorian package for attractive borders and styles. I came across this:

enter image description here

I badly know how to do this.The documentation doesn't show much on how to achieve this.Please help me.

marczellm
  • 11,809
subham soni
  • 9,673

1 Answers1

9

I have defined two macros:

%% A macro with two arguments to change ornaments and colors easily
%% Syntax -- \sectionlinetwo{<color>}{<ornament>}
\newcommand{\sectionline}[2]{%
  \nointerlineskip \vspace{.5\baselineskip}\hspace{\fill}
  {\resizebox{0.5\linewidth}{1.2ex}
    {\pgfornament[color = #1]{#2}
    }}%
    \hspace{\fill}
    \par\nointerlineskip \vspace{.5\baselineskip}
  }

Refer: This answer. This will draw the ornaments between the paragraphs. The other one is versatile and can be used elsewhere:

\newcommand\myornament[3][black]{%
    \resizebox{#2}{!}{\pgfornament[color = #1]{#3}%
}%
}
%% syntax 
%% \myornament[<color|optional, default is black>]{<width>}{<ornament number>}    

Now the full code:

\PassOptionsToPackage{svgnames}{xcolor}
\documentclass[11pt]{article}
\usepackage[object=vectorian]{pgfornament} %%  http://altermundus.com/pages/tkz/ornament/index.html
\usepackage{lipsum,tikz}

%% A macro with two arguments to change ornaments and colors easily %% Syntax -- \sectionlinetwo{<color>}{<ornament>} \newcommand{\sectionline}[2]{% \nointerlineskip \vspace{.5\baselineskip}\hspace{\fill} {\resizebox{0.5\linewidth}{1.2ex} {\pgfornament[color = #1]{#2} }}% \hspace{\fill} \par\nointerlineskip \vspace{.5\baselineskip} } \newcommand\myornament[3][black]{% \resizebox{#2}{!}{\pgfornament[color = #1]{#3}% }% }

\begin{document} \noindent \myornament[DarkRed]{0.3\linewidth}{72} \hfill% \LARGE Motifs d'ornaments \hfill% \myornament[DarkRed]{0.3\linewidth}{73}% \par \begin{center} \myornament[DarkRed]{0.7\linewidth}{85} \end{center} \lipsum[2]

\sectionline{magenta}{84}

\lipsum[3]

\sectionline{DarkGreen}{88} \par\noindent \myornament[DarkRed]{\linewidth}{60} \end{document}

enter image description here

How do you know which number represents which ornaments? I peeked in to the pgfornaments manual (pages 17-20). You can download pgfornament from here.

pgfornament is compatible with pdflatex.