Text FormattingHow to add a superposed diagonal line of text, on the title page only ?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

How to add a superposed diagonal line of text, on the title page only ?

Post by Cham »

I would like to add a grayed (light gray) huge warning line on the front page of a report (something like "Top Sercet" !). Here's a MWE example to work with :

Code: Select all

\documentclass[12pt,oneside]{article}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage{blindtext}
\usepackage{sectsty}
\sectionfont{\centering\sffamily}

\begin{document}

\begin{titlepage}
	\hfill {Some date 2017 \par}
	\medskip
	\hfill {Another date 2017}

	\vspace{0.2\textheight}

	\begin{center}
		{Some number \par}
		\vspace{0.5in}
		{\large A small dumb line \par}
		\bigskip
		{\LARGE\bfseries Laboratory title \par}
		\vspace{0.25in}
		Galileo Galilei \par
		\medskip
		Isaac Newton \par
	\end{center}
	\vfill\centering Some poor guy that need to read this crap \par
\end{titlepage}

\section*{First section}
\blindtext
\section*{Second section}
\blindtext
\subsection*{A sub-section}
\blindtext
\end{document}
The "Top Secret" line should be under the current text (for readability), and on the title page only. Any idea how to achieve this ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

How to add a superposed diagonal line of text, on the title page only ?

Post by Cham »

I found a nice package and a simple code to do the trick. However, how can I make the font used much fatter, I mean ultra-bold types for the "TOP SECRET" ?

Code: Select all

\documentclass[12pt,oneside]{article}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{blindtext}
\usepackage{sectsty}
\sectionfont{\centering\sffamily}
 
\usepackage[firstpage]{draftwatermark}
\SetWatermarkAngle{45}
\SetWatermarkScale{2}
\SetWatermarkLightness{0.85}
\SetWatermarkFontSize{42pt}
\SetWatermarkText{\bfseries\sffamily TOP SECRET}

\begin{document}
 
\begin{titlepage}
	\hfill {Some date 2017 \par}
	\medskip
	\hfill {Another date 2017}
 
	\vspace{0.2\textheight}
 
	\begin{center}
		{Some number \par}
		\vspace{0.5in}
		{\large A small dumb line \par}
		\bigskip
		{\LARGE\bfseries Laboratory title \par}
		\vspace{0.25in}
		Galileo Galilei \par
		\medskip
		Isaac Newton \par
	\end{center}
	\vfill\centering Some poor guy that need to read this crap \par
\end{titlepage}
 
\section*{First section}
\blindtext
\section*{Second section}
\blindtext
\subsection*{A sub-section}
\blindtext
\end{document}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to add a superposed diagonal line of text, on the title page only ?

Post by Johannes_B »

Code: Select all

\documentclass[12pt,oneside]{article}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{blindtext}
\usepackage{lmodern}
\usepackage{sectsty}
\sectionfont{\centering\sffamily}

\usepackage[firstpage]{draftwatermark}
\SetWatermarkAngle{45}
\SetWatermarkScale{2}
\SetWatermarkLightness{0.85}
\SetWatermarkFontSize{42pt}
\SetWatermarkText{\bfseries\sffamily TOP SECRET}

\begin{document}

\begin{titlepage}
	\hfill {Some date 2017 \par}
	\medskip
	\hfill {Another date 2017}

	\vspace{0.2\textheight}

	\begin{center}
		{Some number \par}
		\vspace{0.5in}
		{\large A small dumb line \par}
		\bigskip
		{\LARGE\bfseries Laboratory title \par}
		\vspace{0.25in}
		Galileo Galilei \par
		\medskip
		Isaac Newton \par
	\end{center}
	\vfill\centering Some poor guy that need to read this crap \par
\end{titlepage}

\section*{First section}
\blindtext
\section*{Second section}
\blindtext
\subsection*{A sub-section}
\blindtext
\end{document}
Another way:

Code: Select all

\documentclass[12pt,oneside]{article}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage{blindtext}
\usepackage{sectsty}
\usepackage{xwatermark}
\usepackage{xcolor}
\newwatermark[firstpage,color=black!30!white,angle=45,scale=3,xpos=0,ypos=0]{Top Secret}

\sectionfont{\centering\sffamily}

\begin{document}

\begin{titlepage}
	\hfill {Some date 2017 \par}
	\medskip
	\hfill {Another date 2017}

	\vspace{0.2\textheight}

	\begin{center}
		{Some number \par}
		\vspace{0.5in}
		{\large A small dumb line \par}
		\bigskip
		{\LARGE\bfseries Laboratory title \par}
		\vspace{0.25in}
		Galileo Galilei \par
		\medskip
		Isaac Newton \par
	\end{center}
	\vfill\centering Some poor guy that need to read this crap \par
\end{titlepage}

\section*{First section}
\blindtext
\section*{Second section}
\blindtext
\subsection*{A sub-section}
\blindtext[10]
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

How to add a superposed diagonal line of text, on the title page only ?

Post by Cham »

The first solution appears to fit better my needs. Thanks a lot !
Post Reply