0

I am trying to modify the template from this post Grey Sidebar with Article Class & Tikz but I have problems with the title and the blue area. I am not able to modify accordingly to make it shorter or place the title left or right aligned without modify at the same time the introduction paragraph and texts, as seen in the picture:

enter image description here

So everytime I modify the code by changing the top distance is a mess. I attache the code slightly modified from the previous post:

\documentclass[a4paper]{article}
\setcounter{secnumdepth}{0}
\usepackage[utf8]{inputenc}
\usepackage[math,light,condensed]{iwona}
\usepackage{xcolor}


 \title{\textcolor{white}{\textsc{\Huge{Report XXXXXX: XXXXXXXXXXxXXX}}}}
 \author{\textcolor{white}{\Large{Adrian Carter}}}
 \date{\textcolor{white}{\today}}
 \usepackage{titlesec}
 \usepackage{ulem}
 \usepackage{mdframed}
 \definecolor{myblue}{RGB}{13, 54, 145}
 \usepackage{tikz}
 \usetikzlibrary{calc}
 \usepackage{lipsum}
 \def\particulartemplate#1{
\thispagestyle{titlepage}
 \begin{tikzpicture}[overlay, remember picture]
\draw let \p1 = (current page.west), \p2 = (current page.east) in
  node[minimum width=\x2-\x1, minimum height=1in, draw, rectangle, fill=myblue, anchor=north west, align=left, text width=\x2-\x1] at ($(current page.north west)$) {\Large\bfseries \quad #1};
\end{tikzpicture}
}

\titleformat{\section}
 {\normalfont\Large\bfseries}{\thesection}{1em}{}[{\color{myblue}\titlerule[0.6pt]}]

 %%%%%%%%%%%%%%%% PAGE 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \usepackage{lastpage, fancyhdr, graphicx}
 \pagestyle{titlepage} %myheadings
 \pagestyle{fancy}
 \fancyhf{}
 \lhead{\date{February 8, 2017}}
 \usepackage[top=1.25in, left=.7in, footskip=1.10in]{geometry}

\fancypagestyle{contents} %%%%%%% PAGE 2 (CONTENTS) %%%%%%%%%%%
{
\newgeometry{top=1in, left=0.75in, right=1in, footskip=1.25in}
\renewcommand{\headrulewidth}{0pt}
\lhead{\date{February 1, 2017}}
\fancyhf{}
\rfoot{\thepage}
\fancyheadoffset[L]{0in}
\fancyfootoffset[L]{0in}
\lfoot{\copyright\ Adrian Carter}
\lhead{\date{04 August, 2017}}
\rhead{Germany}
 }
 %%%%%%%%%%%%%%%% PAGE 3 AND NEXT %%%%%%%%%%%%%%%%%
 \renewcommand{\headrulewidth}{0pt}
 \rfoot{\thepage}
 \fancyheadoffset[L]{1.75in}
 \fancyfootoffset[L]{1.75in}
 \lfoot{\copyright\ Adrian Carter}
\rhead{Germany}

\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist 

 \begin{document}

 \particulartemplate{\maketitle}
 \section{Introduction}

  \begin{minipage}[t]{4.5in} % Mini page taking up 30% of the actual page
   \subsubsection*{US economy will gain strength as 2013 progresses}
   The turbulent political environment that curtailed corporate risk-taking 
    in 2012 will end. Full fiscal cliff will be averted but taxes will rise   
   \newline
    \subsubsection*{Corporate fundamentals support continued profit cycle        expansion}
      We forecast S\&P 500 revenues rise by more than 4\% in 2013 and 2014,   margins hover at current levels (8.8\%-9.0\%), earnings climb by more than 6\% and the P/E multiple expands modestly from 13.2x to 13.8x at end 2013. 
     \newline
    \subsubsection*{Valuation: 12-month target of 1575 reflects 12\% potential   return}
     Our 3-month, 6-month, and 12-month forecasts are 1450, 1500, and 1575. We  use six valuation approaches including DDM, uncertainty-based P/E multiple,  cyclically-adjusted P/E multiple, price/book and ROE relationship. 
  \newline
  \subsubsection*{Strategies to capture growth: market, sectors, stocks}
   (1) Stocks will outperform Treasuries; (2) Equities will beat credit   returns, although not on a risk-adjusted basis; (3) Cyclical sectors will beat defensive sectors (Materials, Industrials, Information Technology will outperform Consumer Staples, Telecom, and Health Care); (4) Double Sharpe Ratio stocks offer both high risk-adjusted earnings growth and prospective returns (Bloomberg ticker: <GSTHEPSR>); and (6) Stocks with high BRICs sales exposure will beat domestic-facing firms (GSTHBRIC).
   \end{minipage} \hspace*{.25in}
     \begin{minipage}[t]{2.5in}
     \begin{mdframed}[style=sidebar,frametitle={ABDCDEF}] % Sidebar box
     sdfadfasdfasdfadsfasdfads
     \end{mdframed}
    \sidetemplate{\textcolor{blue}{Add notes; \copyright\ \ Adrian Carter, in a different color, light blue for instance}}  
    \end{minipage}
    \newpage
    \thispagestyle{contents}

     \tableofcontents

     %%%%%%%%%%%%%%%%%%%%%%%% FIRST SECTION %%%%%%%%%%%%%%%%%%%%%%
     \newgeometry{top=1in,left=2.5in,right=1in,footskip=0.75in}
     \newpage

    \begin{changemargin}{-1.75in}{0in}
    \section{First section}
    \end{changemargin}

    \subsection{Sub}


     This is the first section.

     Lorem  ipsum  dolor  sit  amet,  consectetuer  adipiscing  elit.   Etiam    lobortisfacilisis sem.  Nullam nec mi et  neque pharetra sollicitudin.  Praesent imperdietmi nec ante.  Donec ullamcorper, felis non sodales...

     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis    facilisissem.  Nullam nec mi et neque pharetra  sollicitudin.  Praesent imperdiet mi necante...

       \newpage
        %%%%%%%%%%%%%%%%%%%%%%%% SECOND SECTION %%%%%%%%%%%%%%%%%%%%%%
       \begin{changemargin}{-1.75in}{0in}
       \section{Second section}
       \end{changemargin}

       \subsection{Strategies}  Lorem ipsum dolor sit amet, consectetuer   adipiscing elit. Etiam lobortis facilisissem.  Nullam nec mi et neque pharetra 
   sollicitudin. Praesent imperdiet mi necante...

     \end{document}

Thanks in advance for your support!!!

  • You MWE is missing some definitions. A search of the packages I have loaded found pagestyle titlepage only in ltnews.cls and doc.sty. I couldn't find \particulartemplate or \sidetemplate at all. – John Kormylo Aug 4 '17 at 14:54
  • \particulartemplate is already defined in the code; I had to delete \sidetemplate because it gave problems when compile it. Doc.sty and ltnews.cls aren't needed. The code should work without additional packages. Give a try. – José Aug 4 '17 at 16:09
  • You don't define \particulartemplate in the code and your code still uses \sidetemplate, so your comment seems not to correspond to the reality of the code you posted. – cfr Aug 4 '17 at 16:16
  • In the original post (link above) you can see the full code \particulartemplate and \sidetemplate defined. I tried and it worked fine but I am not able to modify the title without modify at the same time the introduction paragraphs. I removed the \sidetemplate which allows me to delete the grey square on top and still worked fine, so I remain only with the blue box on top which is the part that gives me problems. – José Aug 4 '17 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.