5

I have the following code:

Main.tex:

\documentclass[11pt]{article}
\usepackage{techdoc}
\title{Lorem Ipsum is simply dummy text}
\subtitle{Lorem Ipsum is simply dummy text}
\department{R\&D}
\filepath{//path/to/file}

\begin{document}
\maketitle
\clearpage
\end{document}

techdoc.sty:

\ProvidesPackage{techdoc}

\RequirePackage[a4paper, hmargin=2.5cm, vmargin=1cm, includeheadfoot, headheight=3cm]{geometry}
\RequirePackage{fancyhdr}
\RequirePackage{array}
\RequirePackage{tabularx}
\RequirePackage[table]{xcolor}
\RequirePackage{xspace}
\RequirePackage{lastpage}
\RequirePackage[bookmarks, bookmarksopen,pdfstartview={FitH},colorlinks,linkcolor={black},citecolor={black}, urlcolor={black}]{hyperref}
\RequirePackage{nameref}
\RequirePackage{titlesec}
\RequirePackage{multirow}
\RequirePackage{wrapfig}
\RequirePackage{tikz}
\RequirePackage{tabu}
\RequirePackage{tocvsec2}
\RequirePackage{colortbl}
\RequirePackage[absolute]{textpos}
\RequirePackage{rotating}
\RequirePackage{url}
\RequirePackage[small, labelfont=bf]{caption}
\RequirePackage{calc}
\RequirePackage{makecell}

% fix some bug
\renewcommand{\nobreakspace}{\nobreak\ }

% make foot notes looks nice
\RequirePackage[hang]{footmisc}
\setlength{\footnotemargin}{7pt}

% Document information commands
\newcommand{\@confidentialitynotice}{Internal and Confidential Document}
\newcommand{\confidentialitynotice}[1]{\renewcommand{\@confidentialitynotice}{#1}}
\newcommand{\@subtitle}{}
\newcommand{\subtitle}[1]{\renewcommand{\@subtitle}{#1}}
\newcommand{\@department}{}
\newcommand{\department}[1]{\renewcommand{\@department}{#1}}
\newcommand{\@filepath}{}
\newcommand{\filepath}[1]{\renewcommand{\@filepath}{#1}}
\newcommand{\@version}{}


% Tables
\definecolor{arrayrule}{rgb}{0.5, 0.5, 0.5}
\setlength{\arrayrulewidth}{0.5pt}
\arrayrulecolor{arrayrule}
\newenvironment{nicetable}{\begin{table}[h!t]\renewcommand{\arraystretch}{1.4}\addtolength{\tabcolsep}{3pt}\addtolength{\belowcaptionskip}{4pt}}{\end{table}}
\renewcommand{\arraystretch}{1.4}

% Title page
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}
\renewcommand{\maketitle}{%
    \newgeometry{headheight=0pt, headsep=0pt, hmargin=2.5cm, vmargin=2cm}
    \begin{titlepage}
    \begin{tabularx}{\columnwidth}{|>{\centering\arraybackslash}p{3cm}|>{\centering\arraybackslash}m{\columnwidth-6cm-4\tabcolsep-3\arrayrulewidth}|>{\centering\arraybackslash}p{3cm}|}
        \hline
        \multirow{2}{*}{\includegraphics[width=2.7cm, height=2.0cm]{icon_caution}} & {\bf \@confidentialitynotice } & {\includegraphics[width=2.7cm, height=2.7cm]{icon_goal}} \\[0.3cm] \cline{2-2}
        & \multirow{2}{*}{\bf  \@title}\\[.6cm] \cline{1-1}
        \@department & \\ \hline
    \end{tabularx}


    \vfill

    \begin{center}

    {\Huge \bf \@title}

    \rule{\columnwidth}{2pt}
    \vspace{0.1cm}

    {\LARGE \@subtitle}
    \end{center}

    \vspace{3cm}
    \vfill

    \end{titlepage}
    \setcounter{page}{2} % titlepage messes with my page counter!
    \restoregeometry
}

Which results in the following:
Existing table

I would like to delete the last row, and instead create a new column on the right with only one case that would be the symmetric of the icon plus R&D.

I have tried the following:

\begin{tabularx}{\columnwidth}{|>{\centering\arraybackslash}p{3cm}|>{\centering\arraybackslash}m{\columnwidth-6cm-4\tabcolsep-3\arrayrulewidth}|>{\centering\arraybackslash}p{3cm}|}
    \hline
    \multirow{2}{*}{\includegraphics[width=2.7cm, height=2.0cm]{icon_caution}} & {\bf \@confidentialitynotice } & {\includegraphics[width=2.7cm, height=2.7cm]{icon_goal}} \\[0.3cm] \cline{2-2}
    & \multirow{2}{*}{\bf  \@title}\\[.6cm] \cline{1-1}
    \@department & \\ \hline
\end{tabularx}

Which results in this:

Current table

How can I improve it to make it look good?

Edit: The icons, as asked in the comments: enter image description here enter image description here

  • Can we get the icons? – Bernard Dec 23 '15 at 17:53
  • @Bernard They are just placeholders, but I have added them. – Leherenn Dec 23 '15 at 18:29
  • What's your document class? Some two column class like ieee? – Bernard Dec 23 '15 at 18:32
  • article, I edited the code to add everything in the title page section. – Leherenn Dec 23 '15 at 18:41
  • Your code, even completed with some obviously necessary packages produces no output whatsoever. Could you post a minimal, fully compilable code, staring with \document class and ending with \end{document}? – Bernard Dec 23 '15 at 18:57
4

Something like this:

enter image description here

For above picture I make own MWE, since I'm lost in yours. I believe, that you will easily adopt it to your needs:

\documentclass{article}
    \usepackage[margin=25mm,showframe]{geometry}
    \usepackage{graphicx}
    \usepackage{multirow,tabularx}

\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
    \begin{document}

{    \renewcommand{\arraystretch}{1.5}
\noindent%
\begin{tabularx}{\textwidth}{|P{3cm}|>{\centering\arraybackslash\bfseries}X|P{3cm}|}
    \hline
\multirow{3}*[2pt]{%
    \includegraphics[width=2.7cm,height=2cm]{example-image-a}}\smallskip~
    &   \rule[-3mm]{0pt}{9mm}
        Internal and Confidential Document\@confidentialitynotice 
        &   \multirow{2}*[2pt]{%
            \includegraphics[width=2.7cm,height=2cm]{example-image-b}}  
                        \\  \cline{2-2}
    &                                       
        &               \\
    &   Lorem Ipsum is simply dummy text%\@title     
        &               \\  \cline{1-1}
R\&D        &       &   \\  \hline
\end{tabularx}
}
    \end{document}
3

Here another solution, with a simpler code. I simplified a bit your package, removing packages which are alreay called by other packages, such as colortbl which is called by the table option of xcolor. Also, it is better to load hyperref after all other packages (there are some exceptions such as cleveref).

\ProvidesPackage{techdoc}

\RequirePackage[a4paper, hmargin=2.5cm, vmargin=1cm, includeheadfoot, headheight=3cm]{geometry}
\RequirePackage{fancyhdr}
%\RequirePackage{array}
\RequirePackage{tabularx}
\RequirePackage[table]{xcolor}
\RequirePackage{xspace}
\RequirePackage{lastpage}
\RequirePackage{nameref}
\RequirePackage{titlesec}
\RequirePackage{multirow}
\RequirePackage{wrapfig}
\RequirePackage{tikz}
\RequirePackage{tabu}
\RequirePackage{tocvsec2}
%\RequirePackage{colortbl}
\RequirePackage[absolute]{textpos}
\RequirePackage{rotating}
\RequirePackage{url}
\RequirePackage[small, labelfont=bf]{caption}
\RequirePackage{calc}
\RequirePackage{makecell}
\RequirePackage[bookmarks, bookmarksopen,pdfstartview={FitH},colorlinks,linkcolor={black},citecolor={black},
urlcolor={black}]{hyperref}
\RequirePackage{cellspace}
\setlength\cellspacetoplimit{6pt}
\setlength\cellspacebottomlimit{6pt}
% fix some bug
\renewcommand{\nobreakspace}{\nobreak\ }

% make foot notes looks nice
\RequirePackage[hang]{footmisc}
\setlength{\footnotemargin}{7pt}

% Document information commands
\newcommand{\@confidentialitynotice}{Internal and Confidential Document}
\newcommand{\confidentialitynotice}[1]{\renewcommand{\@confidentialitynotice}{#1}}
\newcommand{\@subtitle}{}
\newcommand{\subtitle}[1]{\renewcommand{\@subtitle}{#1}}
\newcommand{\@department}{}
\newcommand{\department}[1]{\renewcommand{\@department}{#1}}
\newcommand{\@filepath}{}
\newcommand{\filepath}[1]{\renewcommand{\@filepath}{#1}}
\newcommand{\@version}{}


% Tables
\definecolor{arrayrule}{rgb}{0.5, 0.5, 0.5}
\setlength{\arrayrulewidth}{0.5pt}
\arrayrulecolor{arrayrule}
\newenvironment{nicetable}{\begin{table}[h!t]\renewcommand{\arraystretch}{1.4}\addtolength{\tabcolsep}{3pt}\addtolength{\belowcaptionskip}{4pt}}{\end{table}}
\renewcommand{\arraystretch}{1.4}

% Title page
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}

\renewcommand{\maketitle}{%
    \newgeometry{headheight=0pt, headsep=0pt, hmargin=2.5cm, vmargin=2cm}
    \sffamily
    \begin{titlepage}
       \centering\large
     \begin{tabularx}{\columnwidth}{|>{\centering\arraybackslash}Sc|@{}>{\centering\arraybackslash}X%
 @{}|>{\centering\arraybackslash}Sc|}
        \hline
       \raisebox{-0.6\height}{\includegraphics[width=2.7cm]{icon_caution}} &% \multirow{2}{*}{%
       \parbox{\linewidth}{\centering\bfseries\@confidentialitynotice\\[0.6cm]
       \hrule\vskip0.5cm\Large\@title}%}
        & \raisebox{-0.6\height}{\includegraphics[width=2.7cm]{icon_goal}}  \\
        \cline{1-1}\cline{3-3}
       \textit{\bfseries \@department}  &  &  \\
       \hline
    \end{tabularx}


    \vfill

    \begin{center}

    {\Huge \bfseries \@title}

    \rule{\columnwidth}{2pt}
    \vspace{0.1cm}

    {\LARGE \@subtitle}
    \end{center}

    \vspace{3cm}
    \vfill

    \end{titlepage}
    \setcounter{page}{2} % titlepage messes with my page counter!
    \restoregeometry
}

The main file: I loaded lmodern, instead of the default cm, in order to have italic boldface sans fonts.

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{techdoc}
\title{Lorem Ipsum is simply dummy text}
\subtitle{Lorem Ipsum is simply dummy text}
\department{R\,\&\,D}
\filepath{//path/to/file}

\begin{document}
\maketitle
\clearpage
\end{document} 

enter image description here

  • Thanks for that, I ended up using yours since it was easier to understand. Just as a note, there's an added } after hyperref and it was complaining about the S option in the column specification; I removed the S and it seems to work. – Leherenn Dec 29 '15 at 8:57
  • @Leherenn: Thanks for pointing the typo (I found another one on checking). For the S,it's a pre-qualifier, added in front of c, l,r, &c.. Its aim is to give some vertical padding to a cell if necessary. It is defined by the cellspace package, and should be replaced by C if you also load siunitx (which defines a Scolumn type). Does it complain with this very code, or inserted in another file? – Bernard Dec 29 '15 at 9:58
  • With this very code. – Leherenn Dec 29 '15 at 10:32
  • @Leherenn: I had loaded a old version of the modified techdoc.sty, without cellspace.Sorry for that error. Please see if it compiles with the updated version. – Bernard Dec 29 '15 at 12:07
  • Compiles fine thanks, I had already made the change based on your previous comment. Thanks a lot for your time. – Leherenn Dec 29 '15 at 12:31

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.