Add "Confidential" mark to a LaTeX footer

Publication Date 2019-04-07
Modified Date 2019-04-07
160 words 1 min read

Let’ add “Confidential” mark to a LaTeX footer.

Define ConfidentialLevel variable

First, we define tha variable ConfidentialLevel to show this

Code Snippet 1: Define ConfidentialLevel (latex)
\global\let\@ConfidentialLevel\@empty
\def\ConfidentialLevel#1{\gdef\@ConfidentialLevel{#1}}

Define this variable in a LaTeX document preamble like this:

(latex)
\ConfidentialLevel{Confidential}

In a Org-mode document, define like this:

(org)
#+LATEX_HEADER: \ConfidentialLevel{Confidential}

Chagen it to anything you like. If not defined, it will not be displayed.

Next, to change a LaTeX fotter, we use fancyhdr package and tcolorbox package:

Code Snippet 2: Change a LaTeX header and footer (latex)
\usepackage{tcolorbox}
\tcbuselibrary{breakable,skins,raster,listings}
\tcbuselibrary{external}
\setlength{\footskip}{10truemm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{\rightmark}{}
\rhead{}{\leftmark}
\rfoot{
    \ifx\@ConfidentialLevel\@empty
    \else
      \tcbox[colback=white,colframe=red,size=small,on line]{
        \textcolor{red}{\sffamily \bfseries {\@ConfidentialLevel}}
    }\fi%
  }
\cfoot{\thepage}% print the page number in tha center of the footer

In a LaTeX documet, this will be typeset:

Figure 1: Sample of LaTeX

Figure 1: Sample of LaTeX

the centre of a footer
a page numer
the right side of a footer
“Confidential” mark

Tags: LaTeX

Related Articles:


We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it