In C#, we can specify certain properties of a class to be private, read only, etc. I want to apply this methodology in writing LaTeX document class if it is possible.
I can find articles pertaining to it neither on the internet nor in a book.
The following is my simplified document class.
\ProvidesClass{pst-xport}[a cute document class for my own purpose.]
% .... others ....
\RequirePackage{pstricks}
\newcommand\Left{-1}
\newcommand\Right{1}
\newlength\LeftPadding\setlength{\LeftPadding}{1cm}
\newlength\RightPadding\setlength{\RightPadding}{1cm}
% it must be private
\newlength\PictureWidth
\AtBeginDocument
{
\setlength{\PictureWidth}{\dimexpr\Right\psxunit-\Left\psxunit\relax}
\paperwidth=\dimexpr\PictureWidth+\RightPadding+\LeftPadding\relax
% .... others ....
}
% .... others ....
% it must be private
\parindent=0pt
%%%%%%%%%%%%%%%%%%%%
%%%% INTERFACES %%%%
%%%%%%%%%%%%%%%%%%%%
\newcommand\SetPicture[2]
{
\renewcommand\Left{#1}
\renewcommand\Right{#3}
}
\newcommand\SetPadding[2]
{
\setlength{\LeftPadding}{#1}
\setlength{\RightPadding}{#3}
}
\newcommand\GetPaperWidth{\PictureWidth}
\endinput
We use this document class as follows.
\documentclass{pst-xport}
\SetPicture{-2}{2}
\SetPadding{0.5cm}{0.5cm}
% \parindent must not be accessible in this input file.
\parindent=10pt
% \PictureWidth must not be accessible in this input file.
\setlength{\PictureWidth}{10cm}
\begin{document}
\parbox{\GetPictureWidth}
{
I can find a tool to convert
PDF to EPS in my neither
bathroom nor kitchen.
}
\end{document}
Questions
If it is possible, how to make certain macros defined in a document class inaccessible from outside?