I am a LaTeX newbie working on creating my first custom LaTeX class.
I would like to know if it's possible to define parameters for \includegraphics such as width, height, center/right align etc in the custom class, so that I don't have to retype all this for each of the image that I insert.
Asked
Active
Viewed 109 times
1
1 Answers
1
In an attempt to be consistent with your way of writing, consider following the approach in Consistent typography by wrapping your desired inputs in a macro. Something like:
\newcommand{\mygraphic}[2][,]{% \mygraphic[<opt args>]{<file>}
\includegraphics[width=\linewidth,height=50pt,#1]{#2}}%
To this you can add \centering or \raggedleft (for right alignment) or \raggedright (for left alignment), perhaps grouped, depending on the exact usage of \mygraphics.
In particular, the above definition \mygraphic[<opt args>]{<file>} takes an optional first argument where the default image width/height is \linewidth/50pt. Otherwise, you can override this with your own setting, or add other options.
\includegraphicsdoes not providecenterorright alignkeys. What are you referring to specifically regarding this horizontal alignment? This may be something to do with afigureenvironment? – Werner Feb 19 '13 at 07:02