Skip to content

Use the newcommand{} feature #3

@czargab18

Description

@czargab18

Use \newcommand{} as an alternate so you don't create multiple .tex files for each piece of data.

\newcommand{\formulaz}[1][display]{
  \ifthenelse{\equal{#1}{inline}}{
    $\sum_{i=1}^{n} f(x,y) \cdot g(x,y)$
  }{
    $$
      \sum_{i=1}^{n} f(x,y) \cdot g(x,y)
    $$
  }
}

Example:

\subsubsection{Escolhendo o tipo de exibição da Formula: inline ou}

Text before inline formula: 
\formulaz[inline] 
text after inline formula.

Text before the formula display - no parameter [display] :
\formulaz
Text after the display formula.

Text before the formula display - with [display] parameter:
\formulaz[display]
Text after the display formula.

Graph:

\newcommand{\nomeGraficox}{
\begin{figure}[H]
    \centering
    \begin{tikzpicture}
    \begin{axis}[
        title={Example Plot 1},
        xlabel={X-axis label},
        ylabel={Y-axis label},
        xmin=0, xmax=10,
        ymin=0, xmax=10,
        xtick={0,2,4,6,8,10},
        ytick={0,2,4,6,8,10},
        legend pos=north west,
        ymajorgrids=true,
        grid style=dashed,
    ]
    \addplot[
        color=blue,
        mark=square,
    ]
    coordinates {
        (0,0) (1,1) (2,4) (3,9) (4,16) (5,25)
        (6,36) (7,49) (8,64) (9,81) (10,100)
    };
    \legend{Data}
    \end{axis}
    \end{tikzpicture}
    \caption{Example Plot 1}
    \label{fig:example1}
\end{figure}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions