-1

Hi I'm editing a sty document and I am trying to get print the author's name (that was declared in the preamble like this

\titulo{Title}
\autor{First mid. last name}

and I am using the command \imprimirautor to print the author's name like it is declared in the preamble. but how do I print it in the format of last name, first name?

this is the portion of the sty that I am trying to get this to work

\newcommand{\insereFichaCatalografica}{ 
 \begin{fichacatalografica}%\color{blue}

 \IfFileExists{metadados/FichaC.pdf}
    {\includepdf[pages=-]{metadados/FichaC}}
    {
    \vspace*{\fill}                 % Posição vertical
    %\hrule                         % Linha horizontal
    \begin{center}
        Ficha catalográfica elaborada automaticamente com os dados fornecidos \\
        pelo(a) autor(a) através do Módulo de Biblioteca do \\
        Sistema GURI (Gestão Unificada de Recursos Institucionais) . 

    \end{center}
    \vspace{-15 mm}
    \begin{center}                  % Minipage Centralizado
    \begin{minipage}[c]{10cm}       % Largura

    \end{minipage}
    \end{center}

    \vspace{0cm}
    \fbox{
    \begin{center}                  % Minipage Centralizado
    \begin{minipage}[c]{12.5cm}     % Largura

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%% here is suposed to be last name, first name %%%%%%%%%%%
   \imprimirautor 

    \hspace{0.5cm} \imprimirtitulo  / \imprimirautor. --
    \imprimirlocal, \imprimirdata-

    \hspace{0.5cm} \pageref{LastPage} p. : il. (algumas color.) ; 30 cm.\\

    \hspace{0.5cm} 
    \ifthenelse{\equal{\imprimirorientador}{}}
            {\imprimirorientadoraRotulo~\imprimirorientadora}
            {\imprimirorientadorRotulo~\imprimirorientador}
    \\

    \hspace{5mm}
    \parbox[t]{\textwidth}{\imprimirtipotrabalho~--~\imprimirinstituicao,
    \imprimirdata.}\\

      \hspace{5mm}
       \begin{minipage}{.80\textwidth}
            1. \PalavraschaveTexto

            I.  \ifthenelse{\equal{\imprimirorientador}{}}
            {\imprimirorientadoraRotulo~\imprimirorientadora}
            {\imprimirorientadorRotulo~\imprimirorientador}.

           II. \imprimirinstituicao

          III. \imprimirCurso

           IV. \imprimirtitulo\\ 


      \end{minipage}
    \end{minipage}
    \end{center}
    }
    %\hrule
 }
 \end{fichacatalografica}
}
  • I guess you could just write down the author's name (how many times do you use it, anyway?). It would save you all the hassle. – Joseph Aug 28 at 23:49
0

Based on How do I split a string? this works, and might be what you're looking for:

\def\testnameswap#1{\nameswap#1\relax}
\def\nameswap#1 #2\relax{#2, #1}
\testnameswap{Firstname Lastname}

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.