Condition for if the page is one sided

double-sidedifthenelsesingle-sided

I want to do something like below

\documentclass[a4paper, 12pt, oneside]{article}
\begin{documnet}
\if@twoside
The page is doublesided. All good.
\else
\textbf{{\Huge The page is not double sided! change!}}
\fi

\end{document}

To make sure that I haven't forget to make onesided mode to double sided mode before printing out a book.

I'm using oneside when I'm writing just because the computer screen is single sided.

How can I achieve this?

Best Answer

Just change from

\if@twoside
The page is doublesided. All good.
\else
\textbf{{\Huge The page is not double sided! change!}}
\fi

to

\makeatletter
\if@twoside
The page is doublesided. All good.
\else
\textbf{{\Huge The page is not double sided! change!}}
\fi
\makeatother

by embracing the condition with \makeatletter and \makeatother. So that latex reads the variable @twoside correctly (\makeatother reverts the compiler to read @ symbols in a default way (I think).