0

I am trying to assign a variable with a floating point scale value and set this equal to the scale for a number of figures. Collecting some information online I came up with the following syntax:

Figures .... depict the variations for the one-dimensional problem.
\newcommand{\SketchScale)}{0.5}
\begin{figure}[H]
\begin{center}
\subfloat{
\includegraphics[scale = {\SketchScale},trim={0 0 0 0},clip]{SchematicConstantLoadRigidBC}}
\subfloat{
\includegraphics[scale = {\SketchScale},trim={0 0 0 0},clip]{SchematicConstantLoadViscousBC}}
\subfloat{
\includegraphics[scale = {\SketchScale},trim={0 0 0 0},clip]{SchematicPeriodicLoadRigidBC}}
\subfloat{
\includegraphics[scale = {\SketchScale},trim={0 0 0 0},clip]{SchematicPeriodicLoadRigidBC}}
\end{center}
\end{figure}

Running this however causes a number of errors on the lines where the variable occurs. I am not sure what I am doing wrong. Would anyone please provide some assistance? Thank you.

2
\newcommand{\SketchScale)}{0.5}

will generate syntax error because of the ) it should be

\newcommand{\SketchScale}{0.5}

and

scale = {\SketchScale},trim={0 0 0 0},clip

The {} are spurious here, it should be

scale = \SketchScale,trim=0 0 0 0,clip

or more simply

scale = \SketchScale

since the trim and clip keys are doing nothing useful in this context.

  • True but I would like to rectify: {SketchScale} does not generate any errors. Indeed the extra parentheses does, however. – user32882 May 31 '17 at 14:26
  • @user32882 actually you got lucky there and the braces are being dropped, they shouldn't be there though. (I'll edit answer to correct) – David Carlisle May 31 '17 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.