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

\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


    \vspace*{\fill}                 % Posição vertical
    %\hrule                         % Linha horizontal
        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) . 

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


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

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

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

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



            1. \PalavraschaveTexto

            I.  \ifthenelse{\equal{\imprimirorientador}{}}

           II. \imprimirinstituicao

          III. \imprimirCurso

           IV. \imprimirtitulo\\ 

  • 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

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

\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.