I've never done any coding in Latex than involves anything too complex (anything more than just writing and customizing a few stuff here and there), so I'm having troubles finding what I need to do this.
I need my project to compile in two size, a4paper and a5paper, passed as an option to the \documentclass[]{article} command.
I just select and option, produce a pdf, then change it to a5 and compile again. Now there are some parts of the document that should be different if it's on a5 or a4 mode, and I don't know how to do it.
How could I do so? Something like
\if @pagesize=a4paper
do stuff
\fi
that works?
Thank you in advance.
EDIT: I've read that the old PlainTeX conditionals can lead to unexpected behaviour in some cases, but what I would do inside would be really simple, like putting \hspaces and things like that, so if it's simple with those conditional, I'd like to use them. Obviously if it can be better done any other way, I would like to know it too.


\DeclareOption{a4paper}{\afourpapertrue\DeclareOption{a4paper}\PassOptionsToClass{a4paper}{article}}and\DeclareOption{a5paper}{\afourpaperfalse\DeclareOption{a5paper}\PassOptionsToClass{a5paper}{article}}as there may be other things that the document class does with the a4/a5 options. In fact, this doesn't seem to be the case with thearticleclass but it might be for other document classes. – Jun 01 '15 at 10:10articleclass in mind so far. – Jun 26 '15 at 11:04