Consider the following minimal but working example.
\documentclass[landscape]{article} \usepackage[a3paper, textwidth=7.5cm, margin=1cm,landscape]{geometry} \usepackage{titlesec} \usepackage{xcolor} \newcommand{\mytitle}[1]{\colorbox{gray!40}{\makebox[\dimexpr\columnwidth- 2\fboxsep\relax]{\filcenter #1\strut}}} \titleformat{\paragraph} {\normalfont\normalsize\bfseries}{\theparagraph}{1em}{\mytitle} \titlespacing*{\paragraph} {0pt}{3.25ex plus 1ex minus .2ex}{1em} \begin{document} \thispagestyle{empty} \paragraph{Cheat Sheet Number Theory (1/2) - X.005 --/12-'15} \end{document} I have a question about the custom \paragraph command. I would like to change this to the following format.
\paragraph{Left aligned text}{Centered heading}{Right aligned text} When the first and third arguments are empty like so
\paragraph{}{Centered headingB}{} the command should workproduce the gray line with B centered just as it does now.
Also
\paragraph{Left AlignedA}{Centered headingB}{} should produce the gray line with A left aligned and B centered.
and
\paragraph{}{Centered headingB}{Right alignedC} should work as intuitively expectedproduce the gray line with B centered and C right aligned.
Is this possible by modifying the preamble as listed above? If so, then please advise on how I should implement this.