BibTeX, biblatex and biberMultiple references in bibtex

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
renefks
Posts: 5
Joined: Tue Jan 11, 2011 2:45 pm

Multiple references in bibtex

Post by renefks »

Hi guys. I am using lyx and it works great. But I'm having some trouble with bibtex when I try to reference more than three papers, and they are in following. For example, in some part of the text I have to cite the papers 3,4,5,6,7 and 8. When I generate the pdf it looks like:

"...Text text text (3,4,5,6,7,8) text text text..."

But I want it to looks like

"...Text text text (3-8) text text text..."

Is there a package or an option in latex to do it?

Thanks
Last edited by renefks on Wed Jan 19, 2011 7:13 pm, edited 3 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Multiple references in bibtex

Post by frabjous »

Try editing the LaTeX preamble if you can and add

Code: Select all

\usepackage{cite}
renefks
Posts: 5
Joined: Tue Jan 11, 2011 2:45 pm

Multiple references in bibtex

Post by renefks »

Thanks, it works for latex, but I realised now that I am using a cls that can't use the cite package. It uses a file called abntcite.sty The code us here

Code: Select all

%% $Id: abntcite.sty,v 1.30 2006/04/25 15:57:42 gweber Exp $
%% name of this file abntcite.sty
%% Copyright 2001-2006 by the abnTeX group at http://abntex.codigolivre.org.br
%%
%% This file is distributed under the LaTeX-Project Public License (LPPL)
%%            http://www.latex-project.org/lppl.html
%% You are free to modify this file under the LPPL.
%%

\NeedsTeXFormat{LaTeX2e}
\input{cvs-id.def}
\CVSExtract$Id: abntcite.sty,v 1.30 2006/04/25 15:57:42 gweber Exp $
\CVSPackage{abntcite}{\space Chamadas de referencias no texto (NBR10520, NBR10522)} %substitui \ProvidesPackage (replaces \ProvidesPackage)

%Packages from standard LaTeX
\RequirePackage{ifthen}
\RequirePackage{calc}

%Pages from the abnTeX project
\RequirePackage{abntex-abrev}
\RequirePackage{abntex-text}
\RequirePackage{abntex-default-design}

%%%%%%  Options Declaration  %%%%%%


%----------------------------------------------------------------
%    Extracted from substr.sty (2000-06-15) 
%----------------------------------------------------------------
% Copyright 2000 Harald Harders <h.harders@tu-bs.de>
% Look at www.ctan.org for original package
%
% Commands:
%
% \IfSubStringInString{substring}{string}{true part}{false part}
% This command searches <substring> in <string> and executes the 
% <true part> if it is and else the <else part>

% expands the first and second argument with
% \protected@edef and calls #3 with them:
\newcommand{\su@ExpandTwoArgs}[3]{%
  \protected@edef\su@SubString{#1}%
  \protected@edef\su@String{#2}%
  \expandafter\expandafter\expandafter#3%
  \expandafter\expandafter\expandafter{%
    \expandafter\su@SubString\expandafter
  }\expandafter{\su@String}%
}
%%
%% tests if #1 in #2. If yes execute #3, else #4
\newcommand*{\IfSubStringInString}[2]{%
  \su@ExpandTwoArgs{#1}{#2}\su@IfSubStringInString
}
%%
\newcommand*{\su@IfSubStringInString}[2]{%
  \def\su@compare##1#1##2\@nil{%
    \def\su@param{##2}%
    \ifx\su@param\@empty
      \expandafter\@secondoftwo
    \else
      \expandafter\@firstoftwo
    \fi
  }%
  \su@compare#2#1\@nil
}

% To grab 6 letters.
\newcommand{\grabsix}[6]{}

% To grab 7 letters.
\newcommand{\grabseven}[7]{}

%----------------------------------------------------------------

%Commands set by options
\newcommand{\citebrackets}[2]{\def\citeopen{#1}\def\citeclose{#2}}
\newcommand{\setcitebrackets}{\citebrackets()}
% A LaTeX list is a command containing a comma separated list of
% itens. The list is processed by command \@for, as in \citeoption.
\def\citeoptionlist{}
% This command adds a string to the list.
\newcommand{\addtociteoptionlist}[1]{
  \ifthenelse{\equal{\citeoptionlist}{}}
    {\edef\citeoptionlist{#1}}
    {\edef\citeoptionlist{\citeoptionlist,#1}}
}

% Booleans set by options
\newboolean{ABCItextondemand}
\newboolean{ABCIfoot}
\newboolean{ABCIcompoldalf}
\newboolean{ABCIbibjustif}
\newboolean{ABCIbiblabelonmargin}
\newboolean{ABCIauto-abntoptions}
\newboolean{ABNTovercite}
\newboolean{ABNTstrictnumformat}

\provideboolean{ABNThyperref}
\@ifpackageloaded{hyperref}{\addtociteoptionlist{abnt-url-package=hyperref}
\setboolean{ABNThyperref}{true}}{\setboolean{ABNThyperref}{false}}


%Lengths set by options
\setlength{\bibindent}{0em}
% used for \@biblabel in num
\newlength{\minimumbiblabelwidth}
\newlength{\ABCIauxlen}

%Counters used in options
% auxiliar counters used in `sort and group' mechanism
\newcounter{ABCIaux}
\newcounter{ABCImax}


%main options
\DeclareOption{call=authordate}{\def\AbntCallType{authordate}\setboolean{ABCItextondemand}{true}}
\DeclareOption{call=numeric}{\def\AbntCallType{numeric}}
\DeclareOption{order=alphabetic}{\def\AbntOrderType{alphabetic}}
\DeclareOption{order=citation}{\def\AbntOrderType{citation}}

% references on page foot
\DeclareOption{foot}{\setboolean{ABCIfoot}{true}\setboolean{ABCItextondemand}{false}}
\DeclareOption{not-foot}{\setboolean{ABCIfoot}{false}\setboolean{ABCItextondemand}{true}}

% cite text on demand (defaults depends on foot or not-foot)
%  (also recall that options are executed in order of definition at
%    \ProcessOptions) 
\DeclareOption{load-text-on-demand}{\setboolean{ABCItextondemand}{true}}
\DeclareOption{load-text}{\setboolean{ABCItextondemand}{false}}

% biblabel-on-margin
\DeclareOption{rightalign=yes}{\setboolean{ABCIbibjustif}{true}}
\DeclareOption{rightalign=no}{\setboolean{ABCIbibjustif}{false}}

% biblabel-on-margin
\DeclareOption{biblabel-on-margin}{\setboolean{ABCIbiblabelonmargin}{true}}
\DeclareOption{biblabel-not-on-margin}{\setboolean{ABCIbiblabelonmargin}{false}}

% \bibliography includes abnt-options automatically unless next option is used
\DeclareOption{optionfile=abnt-options.bib}{\setboolean{ABCIauto-abntoptions}{true}}
\DeclareOption{optionfile=none}{\setboolean{ABCIauto-abntoptions}{false}}

% recuo : compatibility with old norms
\DeclareOption{indent}{\setlength{\bibindent}{1.8em}}

% 10520:2002 now defines only two numerical styles
\DeclareOption{citepos=over}{\setboolean{ABNTovercite}{true}}
\DeclareOption{citepos=inline}{\setboolean{ABNTovercite}{false}}

%Options specific to the several versions of 10520
\DeclareOption{nbr10520=1988}{\input{nbr10520-1988.def}}
\DeclareOption{nbr10520=2001}{\input{nbr10520-2001.def}}
\DeclareOption{nbr10520=2002}{\input{nbr10520-2002.def}}

\DeclareOption{abnt-substyle=COPPE}
  {\newcommand{\bibtextitlecommand}[2]{``#2''}%
   \addtociteoptionlist{abnt-substyle=COPPE}}

% suporting options in a keyval style
% recuo=<length> gives indentation of \bibitem
% other options: passed thought \citeoption (stored now in \citeoptionlist
%   and after (in \AtBeginDocument hook) \citeoption will act on it)

\DeclareOption*{
  \IfSubStringInString{recuo=}{\CurrentOption}
     {\setlength{\bibindent}{\expandafter\grabsix\CurrentOption}}
     {\IfSubStringInString{indent=}{\CurrentOption}
        {\setlength{\bibindent}{\expandafter\grabseven\CurrentOption}}
        {\addtociteoptionlist{\CurrentOption}}}
}

%deprecated options, maintained for backward compatibility
\DeclareOption{alf}{\ExecuteOptions{call=authordate,order=alphabetic}}
\DeclareOption{num}{\ExecuteOptions{call=numeric,order=citation}}
\DeclareOption{bibjustif}{\ExecuteOptions{rightalign=yes}}
\DeclareOption{bibleftalign}{\ExecuteOptions{rightalign=yes}} %left/right mixed
\DeclareOption{abnt-option-file}{\ExecuteOptions{optionfile=abnt-options.bib}}
\DeclareOption{no-abnt-option-file}{\ExecuteOptions{optionfile=none}}
\DeclareOption{overcite}{\ExecuteOptions{citepos=over}}
\DeclareOption{inlinecite}{\ExecuteOptions{citepos=inline}}
\DeclareOption{nbr10520-2001}{\ExecuteOptions{nbr10520=2001}}
\DeclareOption{nbr10520-2002}{\ExecuteOptions{nbr10520=2002}}
\DeclareOption{recuo}{ExecuteOptions{indent}}
% compatibility with old abnt-alf.bst
\DeclareOption{alfantigo}{\setboolean{ABCIcompoldalf}{true}}
\DeclareOption{experimental}{\setboolean{ABCIcompoldalf}{false}}
%end of depecated options

%Options controlling version-dependent behavior
\DeclareOption{abntex=0.8}
  {
  %non-norm dependent default options
  \ExecuteOptions{biblabel-not-on-margin}
  \ExecuteOptions{call=authordate,order=alphabetic}
  \ExecuteOptions{optionfile=abnt-options.bib}
  \ExecuteOptions{experimental}
  \ExecuteOptions{not-foot}
  %norm-dependent default options
  \ExecuteOptions{nbr10520=2002}
  \renewcommand{\authorcapstyle}{\smaller}
  }

\DeclareOption{abntex=0.9}
  {
  %non-norm dependent default options
  \ExecuteOptions{biblabel-not-on-margin}
  \ExecuteOptions{call=authordate,order=alphabetic}
  \ExecuteOptions{optionfile=abnt-options.bib}
  \ExecuteOptions{experimental}
  \ExecuteOptions{not-foot}
  %norm-dependent default options
  \ExecuteOptions{nbr10520=2002}
  }
  
%default for this version
\ExecuteOptions{abntex=0.9}
\ProcessOptions

% really foot?
\ifthenelse{\boolean{ABCIfoot}\and\equal{\AbntCallType}{numeric}}
  {\setboolean{ABCIfoot}{true}}
  {\setboolean{ABCIfoot}{false}}

% Now, after all options are processed, \citeoption process the list of
% options given as package options.
%
\ifthenelse{\equal{\citeoptionlist}{}}
  {}
  {\AtBeginDocument{\citeoption{\citeoptionlist}}}


% \citeoption - equal to \nocite  (I copied source from \nocite)
%               but not complains about this option be obviously undefined
\newboolean{ABCIciteoptionwasused}
\setboolean{ABCIciteoptionwasused}{false}
\def\citeoption#1{\@bsphack
  \@for\@citekey:=#1\do{%
    % next line eliminates white space before citation name
    \edef\@citekey{\expandafter\@firstofone\@citekey}%
    \if@filesw\immediate\write\@auxout{\string\citation{\@citekey}}\fi
  }%
  \@esphack%
  \setboolean{ABCIciteoptionwasused}{true}%
}


%
% \bibliography{list of files .bib to be processed by bibTeX}
%
%   I had to redefine this command such that abnt-options.bib is
%   automatically used in case that some \citeoption was given as package
%   option. An entry
%      \bibliography{abnt-options,abnt-options,..}
%   produces an error in bibTeX. So I had to check if user already
%   includes abnt-options by (him/her)self.
%
%   implementation:
%
%     \citeoption was used?
%     If YES, (abnt-options must be given to bibtex!)
%       checks for abnt-options into parameter given to \bibliography
%       if present
%          user have included, so I don't add it once more
%       not present
%          I add necessary abnt-options
%     If NO
%       no changes to \bibliography

\def\bibliography#1{%
   
  \ifthenelse{\boolean{ABCIciteoptionwasused}
               \and\boolean{ABCIauto-abntoptions}}
   {
   % this system of checking is not good...
    \IfSubStringInString{abnt-options}{#1}
      {\if@filesw\immediate\write\@auxout{\string\bibdata{#1}}\fi}
      {\if@filesw\immediate\write\@auxout{\string\bibdata{abnt-options,#1}}\fi}
   }
   {
    \if@filesw
       \immediate\write\@auxout{\string\bibdata{#1}}%
    \fi
   }
 \@input@{\jobname.bbl}}


%
% The next piece of code looks if bibtexstyle is used or not, and if not,
% includes the respective style from the abntcite mode (alf or num)

\newboolean{ABCIbibtexstyleused}
\setboolean{ABCIbibtexstyleused}{false}

%
\def\bibliographystyle#1{%
  \ifx\@begindocumenthook\@undefined\else
    \expandafter\AtBeginDocument
  \fi
    {\if@filesw
       \immediate\write\@auxout{\string\bibstyle{#1}}%
     \fi}
  \setboolean{ABCIbibtexstyleused}{true}
  }

% \AtEndDocument is the last chace for include bibliography style..
\AtEndDocument{
  \ifthenelse{\not\boolean{ABCIbibtexstyleused}}
    {\ifthenelse{\equal{\AbntOrderType}{citation}}{\bibliographystyle{abnt-num}}{}
     \ifthenelse{\equal{\AbntOrderType}{alphabetic}}{\bibliographystyle{abnt-alf}}{}}
    {}
}


%%%%%%%%%%%%%% Style %%%%%%%%%%%%%%%%%


\newlength{\biblabelsep}
\setlength{\biblabelsep}{1ex}

%%%%%%%%%%%%%%%%%%%%%  Implementation  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% automatic care for commas inside references
\providecommand{\ABCIccomma}{}
\newcommand{\ABCIcitecommadefault}{,\penalty\@m\ }
\newcommand{\ABCIcitecomma}{\ABCIccomma\let\ABCIccomma\ABCIcitecommadefault}
\newcommand{\ABCIinitcitecomma}{\def\ABCIccomma{}}
\newcommand{\ABCIcitecolondefault}{; }%{;\penalty\@m\ }


% How \bibitem works?
%   definition of \bibitem
%   \def\bibitem{\@ifnextchar\@lbibitem\@bibitem}

\ifthenelse{\boolean{ABCIcompoldalf}\and\equal{\AbntCallType}{authordate}}
{

% In the old mplementation on abnt-alf, the command \bibitem should be
%   \bibitem[{explicit}{implicit}{year}]{key}

  % if \bibitem has optional parameter, uses it (three pieces of data
  % stored into .aux file)

  \def\@lbibitem[#1#2#3]#4{
    \gdef\abntnextkey{#4}
    \item[\@biblabel{#1}\hfill]%
    \if@filesw
       {
        \let\protect\noexpand
        \immediate\write\@auxout{\string\bibcite{#4++EXPL}{#1}}
        \immediate\write\@auxout{\string\bibcite{#4++IMPL}{#2}}
        \immediate\write\@auxout{\string\bibcite{#4++YEAR}{#3}}
       }
    \fi%
    \ignorespaces
  }

  % if no optional is used, uses a list counter (stores its value into .aux)
  \def\@bibitem#1{
    \gdef\abntnextkey{#1}
    \item%
    \if@filesw
       {\immediate\write\@auxout{\string\bibcite{#1}{\the\value{\@listctr}}}}
    \fi%
    \ignorespaces
  }

}
{ %if normal mode (non-compatible with old alf)

 \ifthenelse{\boolean{ABCIfoot}}
  {
    % foot-num mode

    \def\@lbibitem[#1]#2{\gdef\abntnextkey{#2}}

    \def\@bibitem#1{\gdef\abntnextkey{#1}}

  }
  {
    \def\@lbibitem[#1]#2{
      \gdef\abntnextkey{#2}
      \item[\@biblabel{#1}\hfill]%
      \ifthenelse{\boolean{ABNThyperref}}{%
        \hyper@anchorstart{cite.#2}\relax\hyper@anchorend}{}%
      \if@filesw
         {
          \let\protect\noexpand
          \immediate\write\@auxout{\string\bibcite{#2}{#1}}
         }
      \fi%
      \ignorespaces
    }
  
    \def\@bibitem#1{
      \gdef\abntnextkey{#1}
  %    \ifthenelse{}{\item}{\item}
      \item%
      \ifthenelse{\boolean{ABNThyperref}}{%
        \hyper@anchorstart{cite.#1}\relax\hyper@anchorend}{}%
      \if@filesw
         {\immediate\write\@auxout{\string\bibcite{#1}{\the\value{\@listctr}}}}
      \fi%
      \ignorespaces
    }
  }
}

\newcommand{\hiddenbibitem}[2][]{\gdef\abntnextkey{#2}}

\newcommand{\ABCIgetcitetext}[1]{
  \if@filesw
    {\let\protect\noexpand
     \immediate\write\@auxout{\string\bibcite{\abntnextkey++TEXT}{#1}}}%
  \fi}

\newcommand{\ABCIgetcitetextecho}[1]{\ABCIgetcitetext{#1}#1}

%we are repeating \bibcite command as defined in hyperref.sty
%so that we have it all together at one place.
\ifthenelse{\boolean{ABNThyperref}}{%
\renewcommand{\bibcite}[2]{%
 \@newl@bel{b}{#1}{\hyper@@link[cite]{}{cite.#1}{#2}}}%
\newcommand{\bibciteEXPL}[2]{%
 \@newl@bel{b}{#1++EXPL}{\hyper@@link[cite]{}{cite.#1}{#2}}}%
\newcommand{\bibciteIMPL}[2]{%
 \@newl@bel{b}{#1++IMPL}{\hyper@@link[cite]{}{cite.#1}{#2}}}%
\newcommand{\bibciteYEAR}[2]{%
 \@newl@bel{b}{#1++YEAR}{\hyper@@link[cite]{}{cite.#1}{#2}}}%
}{}

\newcommand{\abntrefinfo}[3]{%
  \if@filesw
    {%
     \let\protect\noexpand
     \ifthenelse{\boolean{ABNThyperref}}{%
     \immediate\write\@auxout{\string\bibciteEXPL{\abntnextkey}{#1}}%
     \immediate\write\@auxout{\string\bibciteIMPL{\abntnextkey}{#2}}%
     \immediate\write\@auxout{\string\bibciteYEAR{\abntnextkey}{#3}}}{%
     \immediate\write\@auxout{\string\bibcite{\abntnextkey++EXPL}{#1}}%
     \immediate\write\@auxout{\string\bibcite{\abntnextkey++IMPL}{#2}}%
     \immediate\write\@auxout{\string\bibcite{\abntnextkey++YEAR}{#3}}}%
   }%
  \fi
  \ifthenelse{\boolean{ABCIfoot}}
     {\ifthenelse{\boolean{ABCItextondemand}}
        {\@ifundefined{ABCIdemand@\abntnextkey}
          {\let\ABCIprocesscitetext\@gobble}
          {\let\ABCIprocesscitetext\ABCIgetcitetext}}
        {\let\ABCIprocesscitetext\ABCIgetcitetext}}
     {\ifthenelse{\boolean{ABCItextondemand}}
        {\@ifundefined{ABCIdemand@\abntnextkey}
          {\let\ABCIprocesscitetext\relax}
          {\let\ABCIprocesscitetext\ABCIgetcitetextecho}}
        {\let\ABCIprocesscitetext\ABCIgetcitetextecho}}%
  \ABCIprocesscitetext
}


\newcommand{\ABCIdemand}[1]{\expandafter\gdef\csname ABCIdemand@#1\endcsname{}}


\def\AbntCallTypeALF{authordate}

\let\ABCInewblock\newblock
\DeclareRobustCommand{\newblock}{\ABCInewblock}


%%%%%%%%%%%%%%%%%%%%  abnt-alf  %%%%%%%%%%%%%%%%%%%%%%%

% the next line was before \ifthenelse{\equal{\AbntCallType}{alf}}

\setcitebrackets

\ifx\AbntCallType\AbntCallTypeALF % if alf

  \renewcommand{\@biblabel}[1]{}
  

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  %               \cite[optional]{list of keys}
  %
  %  Implicit citation - author in capital letters and year; 
  %                       mechanism to deal with repeated names;
  %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  \renewcommand{\@cite}[2]%
    {\citeopen{#1\ifthenelse{\equal{#2}{}}{}{,
          {\optionaltextstyle#2}}}\citeclose}
  
  \DeclareRobustCommand{\cite}[2][]{%
  %
    \leavevmode
    \let\@citeprevious\@empty%
    \@cite{%
      \@for\@citekey:=#2\do%  \@citekey contains the key
        {%
         \edef\@citekey{\expandafter\@firstofone\@citekey\@empty}%
         %
         % here, a tricky \let\@citename\"b@\@citekey++IMPL"
         \expandafter\let\expandafter\@citename%
             \csname b@\@citekey++IMPL\endcsname%
         \expandafter\let\expandafter\@citeyear%
             \csname b@\@citekey++YEAR\endcsname%
         \ifx\@citeprevious\@empty%
         \else%
           \ifx\@citename\@citeprevious%
              \ABCIcitecommadefault% echoing ", "
           \else%
              \ABCIcitecolondefault% echoing "; "
           \fi%
         \fi%
         % writing on aux file
         \if@filesw\immediate\write\@auxout{\string\citation{\@citekey}}\fi%
         % if undefined bibitem
         \@ifundefined{b@\@citekey++IMPL}%
           {% if undefined
               {\bfseries??}% echoing ?
            \G@refundefinedtrue%
            \@latex@warning%
              {Citation `\@citekey' on page \thepage \space undefined}%
           }%
           {% if already defined
             \ifx\@citename\@citeprevious%
               {\yearstyle\@citeyear\@}\@%
             \else%
               {\authorcapstyle\@citename}, %
               {\yearstyle\@citeyear\@}%
             \fi%
             \let\@citeprevious\@citename%
           }%
        }% end for
    }{#1}%
  }
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %
  %             \citeonline[optional]{list of keys}
  %
  %  Inline (explicit) citation - author in "inline style" and year; 
  %                               mechanism to deal with repeated names;
  %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  \newcommand{\@citeonline}[2]%
    {{#1\ifthenelse{\equal{#2}{}}{}{, {\optionaltextstyle#2}}}\citeclose}
  
  \DeclareRobustCommand{\citeonline}[2][]{%
  %
    \leavevmode
    \let\@citeprevious\@empty%
    \@citeonline{%
      \@for\@citekey:=#2\do%\@citekey contains the key
        {%
         \edef\@citekey{\expandafter\@firstofone\@citekey\@empty}%
         %
         % here, a tricky \let\@citename\"b@\@citekey++UP" :-)
         \expandafter\let\expandafter\@citename%
             \csname b@\@citekey++EXPL\endcsname%
         \expandafter\let\expandafter\@citeyear%
             \csname b@\@citekey++YEAR\endcsname%
         \ifx\@citeprevious\@empty%
         \else%
           \ifx\@citename\@citeprevious%       
             \ABCIcitecommadefault% echoing ", "
           \else%
             \citeclose, % echoing "), "
           \fi%   
         \fi%
         % writing in aux file
         \if@filesw\immediate\write\@auxout{\string\citation{\@citekey}}\fi%
         \@ifundefined{b@\@citekey++EXPL}%
           {% if undefined
            {\bfseries??}% echoing ?
            \G@refundefinedtrue%
            \@latex@warning%
              {Citation `\@citekey' on page \thepage \space undefined}%
           }%
           {% if really defined
            \ifx\@citename\@citeprevious%
            \else%
               {\authorstyle\@citename\@{}} \citeopen%
            \fi%
            {\yearstyle\@citeyear\@}%
            \let\@citeprevious\@citename%
           }%
        }% end for
    }{#1}%
  }
  
  % "overcite" compatibility
  \let\citen\citeonline
  \let\citenum\citeonline

% end alf
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%  abnt-num  %%%%%%%%%%%%%%%%%%%%%%%%%%
%
%

\else % if not alf,

  \ifABCIfoot

     \renewenvironment{thebibliography}[1]{}{}

     \citebrackets{}{}

     \let\ABCIscriptfont\scriptsize
     \renewcommand{\newblock}{}

     \def\ABCI@cite#1#2{\raisebox{.8ex}%
         {\ABCIscriptfont\citeopen{#1\if@tempswa, #2\fi}\citeclose}}

     \def\ABCI@citeonline#1#2{{#1\if@tempswa, #2\fi}}

     \DeclareRobustCommand\cite{%
        \let\@cite\ABCI@cite%
        \@ifnextchar[{\@tempswatrue\@citex}{\@tempswafalse\@citex[]}}

     \DeclareRobustCommand\citeonline{%
        \leavevmode\let\@cite\ABCI@citeonline%
        \@ifnextchar[{\@tempswatrue\@citex}{\@tempswafalse\@citex[]}}

     \def\@citex[#1]#2{%
       \def\@safe@activesfalse{}%
       \ABCIinitcitecomma%
       \def\ABCIcitelist{}%
       \def\ABCIaftercitex{}% to put the footnotes
       \@cite{%
         \@for\@citeb:=#2\do%
            {%
             \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
             \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi%
             \@ifundefined{b@\@citeb++IMPL}%
                {%
                 {\bfseries??}%
                 \G@refundefinedtrue%
                 \@latex@warning%
                   {Citation `\@citeb' on page \thepage \space undefined}%
                }%
                {%
                 \@ifundefined{b@\@citeb}
                   {%
                    \stepcounter{footnote}%
                    \expandafter\xdef\csname b@\@citeb\endcsname{\thefootnote}%
                    \ABCItoken=\expandafter{\ABCIaftercitex}%
                    \xdef\ABCIaftercitex%
                       {\the\ABCItoken\noexpand\footnotetext%
                             {\noexpand\citetext{\@citeb}}}%
                   }
                   {}%
                 \expandafter\let\expandafter\ABCIcitation%
                               \csname b@\@citeb\endcsname%
                 % test for positive number
                 \ifcat _\ifnum\z@<0\ABCIcitation _\else A\fi
                    \ABCIaddtocitelist{\ABCIcitation}%
                 \else% else \ifcat
                    \ABCIcitecomma\hbox{\ABCIcitation}%
                 \fi% end \ifcat
                }%
            }%
         \ABCIoutputgroupedcitelist%
       }{#1}%
       \ABCIaftercitex%
     }

   \newcommand{\citeifnotcited}[1]{%
     \def\ABCIcitelist{}%
     \@for\@citeb:=#1\do%
        {%     
         \@ifundefined{b@\@citeb}
           {\ABCIaddtocitelist{\@citeb}}
           {}%
        }%
     \expandafter\cite\expandafter{\ABCIcitelist}%
   }     

   \newcommand{\citeonlineifnotcited}[1]{%
     \def\ABCIcitelist{}%
     \@for\@citeb:=#1\do%
        {%     
         \@ifundefined{b@\@citeb}
           {\ABCIaddtocitelist{\@citeb}}
           {}%
        }%
     \expandafter\citeonline\expandafter{\ABCIcitelist}%
   }     

   \newcommand{\ABCIaddtocitelist}[1]{%
     \ifthenelse{\equal{\ABCIcitelist}{}}%
       {\edef\ABCIcitelist{#1}}
       {\edef\ABCIcitelist{\ABCIcitelist,#1}}%
   }%

   \newcommand{\ifcited}[3]{\@ifundefined{b@#1}{#3}{#2}}

  \else % if num and NOT foot

     % this only works with proper settings in \ABCIthebibliformat
     \ifthenelse{\boolean{ABCIbiblabelonmargin}}
     {
     \renewcommand{\@biblabel}[1]%
        {\ifthenelse{\equal{#1}{}}{}{{\citenumstyle #1\hspace{\biblabelsep}}}}
     }
     {
     \renewcommand{\@biblabel}[1]%
        {%
         \ifthenelse{\equal{#1}{}}
           {}
           {%
            \def\biblabeltext{{\citenumstyle #1\hspace{\biblabelsep}}}%
            \settowidth{\ABCIauxlen}{\biblabeltext}%
            \ifthenelse{\lengthtest{\ABCIauxlen<\minimumbiblabelwidth}}
               {\setlength{\ABCIauxlen}{\minimumbiblabelwidth-\ABCIauxlen}}
               {\setlength{\ABCIauxlen}{0cm}}%
            {\biblabeltext\hspace{\ABCIauxlen}}%   
           }%
        }%
     }

     \let\ABCIscriptfont\scriptsize

     \ifthenelse{\boolean{ABNTovercite}}{%
     \def\ABCI@cite#1#2{\raisebox{1ex}%
         {\ABCIscriptfont\citeopen{#1\if@tempswa, #2\fi}\citeclose}}}{%
     \def\ABCI@cite#1#2{\citeopen{#1\if@tempswa, #2\fi}\citeclose}}

     \def\ABCI@citeonline#1#2{{#1\if@tempswa, #2\fi}}

     \DeclareRobustCommand\cite{%
        \let\@cite\ABCI@cite%
        \@ifnextchar[{\@tempswatrue\@citex}{\@tempswafalse\@citex[]}}

     \DeclareRobustCommand\citeonline{%
        \leavevmode\let\@cite\ABCI@citeonline%
        \@ifnextchar[{\@tempswatrue\@citex}{\@tempswafalse\@citex[]}}

%      \renewcommand{\@openbib@code}%
%      {\setlength{\leftmargin}{0pt}\addtolength{\itemindent}{\labelsep}}


     \def\@citex[#1]#2{%
       \def\@safe@activesfalse{}%
       \ABCIinitcitecomma%
       \def\ABCIcitelist{}%
       \@cite{%
         \@for\@citeb:=#2\do%
            {%
             \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
             \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi%
             \@ifundefined{b@\@citeb}%
                {%
                 {\bfseries??}%
                 \G@refundefinedtrue%
                 \@latex@warning%
                   {Citation `\@citeb' on page \thepage \space undefined}%
                }%
                {%
                 \expandafter\let\expandafter\ABCIcitation%
                               \csname b@\@citeb\endcsname%
                 % test for positive number
                 \ifcat _\ifnum\z@<0\ABCIcitation _\else A\fi
                    \ABCIaddtocitelist{\ABCIcitation}%
                 \else% else \ifcat
                    \ABCIcitecomma\hbox{\ABCIcitation}%
                 \fi% end \ifcat
                }%
            }%
         \ABCIoutputgroupedcitelist%
       }{#1}%
     }

   \newcommand{\ABCIaddtocitelist}[1]{%
     \ifthenelse{\equal{\ABCIcitelist}{}}%
       {\edef\ABCIcitelist{#1}}
       {\edef\ABCIcitelist{\ABCIcitelist,#1}}%
   }%
  

  \fi
\fi % end if alf

\providecommand{\citeifnotcited}[1]{}
\providecommand{\citeonlineifnotcited}[1]{}
\providecommand{\ifcited}[3]{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%                \citeyear{list of keys}
%
%  Citation by year 
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\DeclareRobustCommand{\citeyear}[1]{%
%
%  \let\@safe@activesfalse\@empty%
  \leavevmode
  \let\@citeprevious\@empty%
  \@for\@citekey:=#1\do %\@citekey contains the key
    {%
%     \edef\@citekey{\expandafter\@firstofone\@citekey\@empty}%     
     \expandafter\let\expandafter\@citename%
          \csname b@\@citekey++YEAR\endcsname%
     %compare previous name with current name and decide the punctuation marks
     %if first use do nothing
     \ifx\@citeprevious\@empty%
     \else%
        , % echoing ", 
     \fi%
     % writing on aux file
     \if@filesw\immediate\write\@auxout{\string\citation{\@citekey}}\fi%
     % if undefined bibitem
     \@ifundefined{b@\@citekey++YEAR}%
       {% if undefined
        {\bfseries??}% echoing ?
        \G@refundefinedtrue%
        \@latex@warning%
          {Citation `\@citekey' on page \thepage \space undefined}%
       }%
       {% if already defined
         \ifx\@citename\@citeprevious%
         \else%
           {\@citename\@}%
         \fi%
         \let\@citeprevious\@citename%
       }%
    }% end for
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%               \citeauthor{list of keys}
%
%  Implicit citation (capital letters)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



\DeclareRobustCommand{\citeauthor}[1]{%
%
%  \let\@safe@activesfalse\@empty%
  \leavevmode
  \let\@citeprevious\@empty%
  \@for\@citekey:=#1\do %\@citekey contains the key
    {%
%     \edef\@citekey{\expandafter\@firstofone\@citekey\@empty}%
     \expandafter\let\expandafter\@citename\csname b@\@citekey++IMPL\endcsname%
     % writing on aux file
     \if@filesw\immediate\write\@auxout{\string\citation{\@citekey}}\fi%
     % if undefined bibitem
     \@ifundefined{b@\@citekey++IMPL}%
       {% if undefined
        {\bfseries??}%
        \G@refundefinedtrue%
        \@latex@warning%
          {Citation `\@citekey' on page \thepage \space undefined}%
       }%
       {% if already defined
         \ifx\@citename\@citeprevious%
         \else%
            \ifx\@citeprevious\@empty%
            \else%
              ; % echoing "; "
            \fi%
            {\authorcapstyle\@citename\@}%
         \fi%
         \let\@citeprevious\@citename%
       }%
    }% end for
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%             \citeauthoronline{list of keys}
%
%  Explicit citation (non capital letter)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\DeclareRobustCommand{\citeauthoronline}[1]{%
%
%  \let\@safe@activesfalse\@empty%
  \leavevmode
  \let\@citeprevious\@empty%
  \@for\@citekey:=#1\do %\@citekey contains the key
    {%
%     \edef\@citekey{\expandafter\@firstofone\@citekey\@empty}%
     \expandafter\let\expandafter\@citename\csname b@\@citekey++EXPL\endcsname%
     % writing on aux file
     \if@filesw\immediate\write\@auxout{\string\citation{\@citekey}}\fi%
     % if undefined bibitem
     \@ifundefined{b@\@citekey++EXPL}%
       {% if undefined
        {\bfseries??}%
        \G@refundefinedtrue%
        \@latex@warning%
          {Citation `\@citekey' on page \thepage \space undefined}%
       }%
       {% if already defined
         \ifx\@citename\@citeprevious%
         \else%
            \ifx\@citeprevious\@empty%
            \else%
              ; % echoing "; "
            \fi%
            {\authorstyle\@citename\@}%
         \fi%
         \let\@citeprevious\@citename%
       }%
    }% end for
}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%             \citetext{list of keys}
%
%  Text of the reference
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\DeclareRobustCommand{\citetext}[1]{%
%
%  \let\@safe@activesfalse\@empty%
  \leavevmode
  \let\@citeprevious\@empty%
  \@for\@citekey:=#1\do %\@citekey contains the key
    {%
%     \edef\@citekey{\expandafter\@firstofone\@citekey\@empty}%
     \expandafter\let\expandafter\@citename\csname b@\@citekey++TEXT\endcsname%
     % writing on aux file
     \if@filesw\immediate\write\@auxout{\string\citation{\@citekey}}\fi%
     \if@filesw\immediate\write\@auxout{\string\ABCIdemand{\@citekey}}\fi%
     % if undefined bibitem
     \@ifundefined{b@\@citekey++TEXT}%
       {% if undefined
        {\bfseries??}%
        \G@refundefinedtrue%
        \@latex@warning%
          {Citation `\@citekey' on page \thepage \space undefined}%
       }%
       {% if already defined
         \ifx\@citename\@citeprevious%
         \else%
            \relax
            \ifx\@citeprevious\@empty%
            \else%
              ; % echoing "; "
            \fi%
            {\@citename}%
         \fi%
         \let\@citeprevious\@citename%
       }%
    }% end for
}


%
% Setting up `recuo' (=indent in Portuguese)
%

% To ensure that the margin settings of this package works, \leftmargin
% (inside thebibliography) must be 0cm. \@openbib@code is a hook inside
% thebibliography.
\let\@openbib@codeBACKUP\@openbib@code
\def\@openbib@code{\@openbib@codeBACKUP\setlength{\leftmargin}{0cm}}


% adding things after \begin{thebibliography}{}

\let\thebibliographyBkUp\thebibliography
\def\thebibliography#1{\thebibliographyBkUp{#1}\ABCIthebibliformat}

%
% \AfterTheBibliography{} hook
%

\newtoks\ABCItoken

\newcommand{\ABCIthebiblihook}{}

\newcommand{\AfterTheBibliography}[1]{
  \ABCItoken=\expandafter{\ABCIthebiblihook}
  \expandafter\def\expandafter\ABCIthebiblihook\expandafter{\the\ABCItoken#1}
}


\ifthenelse{\boolean{ABCIbibjustif}}
  {}
  {\AfterTheBibliography{\setlength{\rightskip}{0pt plus 2cm}}}

\ifthenelse{\equal{\AbntCallType}{authordate}}
  {% mode alf
   \newcommand{\ABCIthebibliformat}{
     \setlength{\leftskip}{\bibindent}
     \setlength{\labelwidth}{0cm}
     \setlength{\labelsep}{0cm}
     \setlength{\itemindent}{-\bibindent}
     \setlength{\listparindent}{0cm}
     \ABCIthebiblihook
     }     
  }
  {% mode num
   \ifthenelse{\boolean{ABCIbiblabelonmargin}}
     {
       \newcommand{\ABCIthebibliformat}{
         \setlength{\leftskip}{\bibindent}
         \setlength{\labelwidth}{10cm}
         \setlength{\labelsep}{0cm}
         \setlength{\itemindent}{-\bibindent}
         \setlength{\listparindent}{0cm}
         \setlength{\biblabelsep}{1.5ex}
         \ABCIthebiblihook
       }
     }
     {
       \newcommand{\ABCIthebibliformat}{
         \setlength{\leftskip}{\bibindent}
         \setlength{\labelwidth}{0cm}
         \setlength{\labelsep}{0cm}
         \setlength{\itemindent}{-\bibindent}
         \setlength{\listparindent}{0cm}
         \setlength{\minimumbiblabelwidth}{\leftskip}
         \ABCIthebiblihook
         }
         \AfterTheBibliography{
           \ifthenelse{\lengthtest{\minimumbiblabelwidth=0pt}}
             {\setlength{\biblabelsep}{1.8ex}}
             {\setlength{\biblabelsep}{1ex}}
         }
     }
  }




%---------------------------------------------------------------%
%  Macros for output sorted and compressed numerical citations  %
%---------------------------------------------------------------%


% Store to maximum of a given list to the counter "ABCImax"
\newcommand{\maximuminlist}[1]{%
  \setcounter{ABCImax}{0}%
  \@for\ABCIaux:=#1\do%
     {%
      \setcounter{ABCIaux}{\ABCIaux}%
      \ifnum \value{ABCIaux}>\value{ABCImax}%
         \setcounter{ABCImax}{\value{ABCIaux}}%
      \fi%
     }%
}

% It takes a command containing a comma separeted list of
% positive numbers and redefines the original command with
% the list without its maximum element.
\newcommand{\ABCIlistwithoutmaximum}[1]{%
  \maximuminlist{#1}%
  \let\ABCItemplist#1%
  \def#1{}%
  \def\ABCIcomma{}%
  \@for\ABCIaux:=\ABCItemplist\do%
    {%
      \ifnum\ABCIaux<\value{ABCImax}%
        \edef#1{#1\ABCIcomma\ABCIaux}%
        \def\ABCIcomma{,}%
      \fi%
    }%
}

% It requires a command containing a comma separeted list of
% positive numbers. It redefines that command with the same
% list, but sorted.
\newcommand{\ABCIsortlist}[1]{%
  \edef\ABCItempslist{#1}%
  \def#1{}%
  \def\ABCIcomma{}%
  \whiledo{\not\equal{\ABCItempslist}{}}%
    {%
     \maximuminlist{\ABCItempslist}%
     \edef#1{\arabic{ABCImax}\ABCIcomma#1}%
     \def\ABCIcomma{,}%
     \ABCIlistwithoutmaximum{\ABCItempslist}%
    }%
}

% \ifconsecutive{num1}{num2}{block1}{block2}
% executes block1 if num1 = num2+1 and block2 otherwise.
\newcommand{\ifconsecutive}[4]{%
  \@tempcnta#1%
  \@tempcntb#2%
  \advance\@tempcntb 1 %
  \ifnum\@tempcnta=\@tempcntb#3\else#4\fi%
}

%
% It sorts and outputs in grouped way the list \ABCIcitelist generated in
% \cite when in `num' mode.
%
\newcommand{\ABCIoutputgroupedcitelist}{%
  \ifthenelse{\equal{\ABCIcitelist}{}}%
    {}%
    {%
     \ABCIsortlist{\ABCIcitelist}%
     \setcounter{ABCIaux}{0}%
     \@for \ABCIaux:=\ABCIcitelist\do%
       {%
        \ifthenelse{\value{ABCIaux}=0}%
          {%
           \let\ABCIfirst\ABCIaux%
           \let\ABCIlast\ABCIaux%
           \setcounter{ABCIaux}{1}%
          }%
          {%
           \ifconsecutive{\ABCIaux}{\ABCIlast}%
             {%
              \let\ABCIlast\ABCIaux%
              \addtocounter{ABCIaux}{1}%
             }%
             {%
              \ifthenelse{\value{ABCIaux}=1}%
                {%
                 \ABCIcitecomma\ABCIfirst%
                }%
                {%
                 \ifthenelse{\value{ABCIaux}=2}%
                   {%
                    \ABCIcitecomma\ABCIfirst%
                    \ABCIcitecomma\ABCIlast%
                   }%
                   {%
                    \ABCIcitecomma\ABCIfirst--\ABCIlast%
                   }%
                }%
              \let\ABCIfirst\ABCIaux%
              \let\ABCIlast\ABCIaux%
              \setcounter{ABCIaux}{1}%
             }%
          }%
       }%
     \ifthenelse{\value{ABCIaux}=1}%
       {%
        \ABCIcitecomma\ABCIfirst%
       }%
       {%
        \ifthenelse{\value{ABCIaux}=2}%
          {%
           \ABCIcitecomma\ABCIfirst%
           \ABCIcitecomma\ABCIlast%
          }%
          {%
           \ABCIcitecomma\ABCIfirst--\ABCIlast%
          }%
       }%
     }%
}

\newcommand{\apudname}{apud}
\newcommand{\Idemname}{Id.}
\newcommand{\Ibidemname}{Ibid.}
\newcommand{\opcitname}{op.\ cit.}
\newcommand{\passimname}{passim}
\newcommand{\loccitname}{loc.\ cit.}
\newcommand{\cfcitename}{Cf.}
\newcommand{\etseqname}{et seq.}

\newcommand{\apud}[3][]{\citeopen\citeauthor{#2}, \citeyear{#2} \apudname\ %
\citeauthor{#3}, \citeyear{#3}%
\ifthenelse{\equal{#1}{\empty}}{}{, #1}\citeclose}

\newcommand{\apudonline}[3][]{\citeauthoronline{#2} \citeopen\apudname\ %
\citeauthor{#3}, \citeyear{#3}%
\ifthenelse{\equal{#1}{\empty}}{}{, #1}\citeclose}

\newcommand{\Idem}[2][]{\Idemname, \citeyear{#2}%
\ifthenelse{\equal{#1}{\empty}}{}{, #1}}

\newcommand{\Ibidem}[2][]{\Ibidemname%
\ifthenelse{\equal{#1}{\empty}}{}{, #1}}

\newcommand{\opcit}[2][]{\citeauthor{#2}, \opcitname%
\ifthenelse{\equal{#1}{\empty}}{}{, #1}}

\newcommand{\passim}[2][]{\citeauthor{#2}, \citeyear{#2}%
\ifthenelse{\equal{#1}{\empty}}{}{, #1}, \passimname}

\newcommand{\loccit}[2][]{\citeauthor{#2}, \citeyear{#2}%
\ifthenelse{\equal{#1}{\empty}}{}{, #1}, \loccitname}

\newcommand{\cfcite}[2][]{\cfcitename\ \citeauthor{#2}, \citeyear{#2}%
\ifthenelse{\equal{#1}{\empty}}{}{, #1}}

\newcommand{\etseq}[2][]{\citeauthor{#2}, \citeyear{#2}%
\ifthenelse{\equal{#1}{\empty}}{}{, #1}, \etseqname}

\ifthenelse{\equal{\AbntCallType}{numeric}}%
{\renewcommand{\citeauthor}[1]{\citeauthoronline{#1}\cite{#1}}}{}


\endinput
The last topic of the file is "Macros for output sorted and compressed numerical citations", so it should do it. But I don't understand the language so I can't verify it or even know if there is an option to active it. Can You or anyone help me in other way to do sort and compress the citation, or even fix or explain me how to active this option.

Thanks
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Multiple references in bibtex

Post by frabjous »

Firstly, that's a .sty file (package), not a .cls (Document class). It appears to be associated with a .cls file, however.

It's impossible to test, however, because it requires a number of other packages (abntex-abrev, abntex-text, etc.), which you didn't upload. I tried to track these down and went to the webpage listed, http://abntex.codigolivre.org.br -- it looks like there's a lot of documentation there (some of which to download), but it's all in Portuguese, which I can't read. There appear to be several versions of the bundle, and I don't know which one you're using. What template are you using and where did you get it? Can you read Portuguese? Does anything there help?

There's something in there about a num option \usepackage[num]{abntcite} which you should be using if you're not already.
renefks
Posts: 5
Joined: Tue Jan 11, 2011 2:45 pm

Multiple references in bibtex

Post by renefks »

Sorry, I've posted it yesterday and I was something about 4 hours trying to fix it someway! Yes this is the sty file that defines how the references looks like when you compile the tex file. In http://codigolivre.org.br/frs/?group_id=46 one can download the full package abntex. This are the Brazilian Rules for documents. I need it because I am writing my thesis to acquire the master's degree. Students from my university has developed the cls below to write the thesis, but they don't study here anymore. The full package one can download in http://code.google.com/p/italus/ in Classe Latex. It uses the abntcite file from abntex. I am using the 0.9 (beta2) version, but I tried the 0,9 (beta) and the 0.82 (stable) too. The documentation doesn't say anything . Below the cls I'm using I will post the preamble of my thesis, the a full code to test in tex. (It will repeat the preamble but one can use it directly without lyx, and the ref.bib file is last. So if anyone wants to test it will not loose time doing this! As you can see I used \usepackage[num]{abntcite} (There are alf and num options), but in lyx it also uses \bibliographystyle{abnt-num}.

Thanks

I still have hope

Code: Select all

%==============================================================================
% This is the ITA LateX class - classe de documento com padrões do ITA
% written by
%              Fábio Fagundes Silveira   -  ffs [at] ita [dot] br
%
%              Benedito C. O. Maciel     -  bcmaciel [at] ita [dot] br
%              Giovani Volnei Meinertz   -  giovani [at] ita [dot] br
%
% last updated: 
%        $Id: ita.cls 42 2006-10-01 22:30:09Z ffs $
%        $HeadURL: file:///opt/repositorioITALUS/classeITA/tags/versao-2.1/ita.cls $
%
%
% Copyright (C) 2004-2008 ITALUS - ITA LaTeX Users Group "Society"  :-)
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
%
% ITALUS
% Technological Institute of Aeronautics --- ITA
% Sao Jose dos Campos, Brazil
% HomePages:        http://www.comp.ita.br/italus
%                   http://groups.yahoo.com/group/italus/
% Discussion list: italus {at} yahoogroups.com
%==============================================================================

%==============================================================================
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{ita}[2006/03/10 v2.0 Classe de documento com padrões do ITA]

% % --------------------------------------------------------------------
% %  Verificação se alvo será gerado pelo PDFLaTeX ou não
% % --------------------------------------------------------------------
%\newif\ifpdf
%  \ifx\pdfoutput\undefined
%      \pdffalse
%  \else
%      \pdfoutput=1
%      \pdftrue
% \fi

%==============================================================================
%%% Declaracao das opcoes
%==============================================================================
\DeclareOption{defaults}{
  \input{defaults.def}
}
% Mestrado
\DeclareOption{msc}{
  \input{msc.def}
}
% Doutorado
\DeclareOption{dsc}{
  \input{dsc.def}  
}
% Doutora
\DeclareOption{fem}{
  \input{fem.def}
}
% Exame de Qualificacao
\DeclareOption{quali}{
  \input{quali.def}  
}
% Versao em ingles
\newif\if@eng
\DeclareOption{eng}{
    \@engtrue
}
\DeclareOption{classic}{

    \newcommand{\itaformatworktitle}[1]{\Large \textbf{#1}}
    \newcommand{\itaformatauthorname}[1]{\large \textbf{#1}}
    \newcommand{\itaformattitletext}[1]{\large{#1}}
    \newcommand{\itaformatadvisorword}[1]{#1}

    \renewcommand{\itaspacing}{2}
}

%==============================================================================
%%% dv: 'draft version': imprime ŽVersao PreliminarŽ + data da impressao
%==============================================================================
\newif\if@dv
\DeclareOption{dv}{
    \@dvtrue
}

\ExecuteOptions{defaults,classic}
\ProcessOptions
\AtEndOfPackage{
    \renewcommand{\baselinestretch}{\itaspacing}
}
 
  
%==============================================================================
%%% Heranca e Pacotes ...
%==============================================================================
\LoadClass[12pt,a4paper,oneside]{book}
\RequirePackage{calc}
\RequirePackage{ifthen}

\if@eng
   \RequirePackage[english]{babel}
\else
   \RequirePackage[english,portuges,brazil]{babel}
\fi

 \if@eng
   \input{itaeng.babel}
 \else
   \input{itabr.babel}
 \fi

%\RequirePackage[latin1]{inputenc}
\RequirePackage{setspace}
\RequirePackage{fancyhdr}
\RequirePackage{amsfonts}                 % Fontes p/ conjuntos: R,Z,H,...
\RequirePackage{lastpage}
\RequirePackage{indentfirst}
\RequirePackage{caption2}
\RequirePackage{longtable}
\RequirePackage{array}
\RequirePackage{tabularx}

%==============================================================================
%%% Glossário
\usepackage{makeglo}
\renewcommand{\glossmaxlabelwidth}{\hspace{3cm}}

%% opcoes de cores
%% linkcolor=blue,citecolor=gray,urlcolor=cyan
\RequirePackage{color}        %% aplicar cores no texto
\RequirePackage{hyphenat}     %% hifenização
\RequirePackage{makeidx}      %% ÍNDICE

%==============================================================================
%%% Hyperref
\definecolor{gray}{rgb}{0.4,0.4,0.4}
\definecolor{bblue}{rgb}{0,0,.8} %% tom azul mais escuro

\RequirePackage[debug,a4paper,pagebackref=true,breaklinks,bookmarksopen=true,colorlinks=true,linkcolor=bblue,citecolor=bblue,urlcolor=bblue,bookmarksnumbered=true,hyperindex=true,verbose=true]{hyperref} %% essencial %% gera pdf/dvi com links
%==============================================================================

%\ifpdf
%  \RequirePackage{ae} %% fontes para pdf
%  \RequirePackage[pdftex]{graphicx}
%  \RequirePackage[pdftex]{geometry}
%\else
%  \RequirePackage[T1]{fontenc}
%  \RequirePackage[dvips]{graphicx}
%  \RequirePackage[dvips]{geometry}
%\fi

% dimensoes das paginas
%\geometry{a4paper,left=3cm,right=2cm,top=3cm,bottom=2cm,verbose,headheight=0.56cm, headsep=0.5cm,footskip=3em}

\newif\ifhyperref
\@ifpackageloaded{hyperref}{\hyperreftrue}{\hyperreffalse}

%==============================================================================
%%% ABNTeX ...
\RequirePackage[num,abnt-emphasize=bf,abnt-etal-list=0,abnt-etal-text=it]{abntcite}
%==============================================================================

%==============================================================================
% Redefinição da data (para ter mês e ano separados)
%==============================================================================
\renewcommand{\date}[2]{
        \gdef\@publmonth{#1}
        \gdef\@publyear{#2}
}
\date{\monthname}{\number\year}

%==============================================================================
%%% Novos comandos: \author, \authoraddress, \advisor, \coadvisor,
%%% \boss, etc ...  ;-)
%==============================================================================
% Autor...
\renewcommand{\author}[2]{%               % Nome, Sobrenome
  \gdef\@authorfirst{#1}
  \gdef\@authorlast{#2}
}
% Endereco do Autor (utilizado no verso da folha de rosto
\renewcommand{\itaauthoraddress}[3]{%
  \gdef\@itaauthoraddress{#1}
  \gdef\@itaauthorcep{#2}
  \gdef\@itaauthorcity{#3}
}
% Orientador...
\newcommand{\advisor}[3][\itaadvisorwordbabel]{     % [word] ,title, name
  \renewcommand{\itaadvisorname}{#3}
  \renewcommand{\itaadvisortitle}{#2}
  \renewcommand{\itaadvisorword}{#1}
  \gdef\@advisor{#2~#3 \\ #1}
  \gdef\itaadvisorwordbabelll{#1}
}
% Co-orientador...  (opcional)
\newcommand{\coadvisor}[4][\itacoadvisorwordbabel]{%
  \gdef\@itacoadvisorname{#3}
  \gdef\@itacoadvisortitle{#2}
  \gdef\@itacoadvisorinst{#4}
  \gdef\@coadvisor{#2~#3 \\ #1}
  \gdef\itacoadvisorwordbabelll{#1}
}
% Chefe da Divisao de Pos-Graduacao...
\newcommand{\boss}[3][\itabosswordbabel]{      %[word] ,title, name
  \renewcommand{\itabossname}{#3}
  \renewcommand{\itabosstitle}{#2}
  \renewcommand{\itabossword}{#1}
  \gdef\@boss {#2~#3 \\ #1}
}
% Curso de Pos-Graduacao...
\newcommand{\course}[1]{
  \renewcommand{\itaworkcourse}{#1}
}
% Divisao...
\newcommand{\dept}[1]{
  \renewcommand{\itaworkdept}{#1}
}
% Area do Curso...
\newcommand{\area}[1]{
  \renewcommand{\itaworkarea}{#1}
}

%==============================================================================
%%% Hack: Pagina de Rosto para Teses
%==============================================================================
\newcommand{\itatitletext}{\itatitletextbabel}

\renewcommand{\maketitle}{%
   \begin{titlepage}
      \pdfbookmark[0]{\nametitlepage}{titulo}
      % verifica se eh uma tese ou um exame de qualificacao
      \ifthenelse{\equal{\itaoptionlevel}{quali}}
              {\thequalititlepage }
              {\thethesistitlepage }
   \end{titlepage}

   \ifthenelse{\equal{\itaoptionlevel}{quali}}
              {\setcounter{page}{2}}
              {\setcounter{page}{4}}
}

%==============================================================================
% Capa do Exame de Qualificacao para Doutorado
%==============================================================================
\newcommand{\thequalititlepage}{%

   \noindent
   \center
   \begin{spacing}{1.5}
      {\Large \itanametitlequalibabel } \\        %  ITA -- \textsc{Instituto Tecnológico de Aeronáutica}} \\
      {\Large \itaposnametitlequalibabel } \\     %  \textsc{Pós-Graduação em \itaworkcourse}} \\
      {\large \itaarenametitlequalibabel }        %  \textsc{Área de \itaworkarea}}
    \end{spacing}

    \vfill

   \begin{spacing}{1.2}
   \itaformatworktitle{\MakeUppercase{\@title}}
   \end{spacing}

   \vfill

   por\\
   \itaformatauthorname{\@authorfirst\ \@authorlast}

   \vfill

   \normalsize
   \hspace{\fill}
   \parbox[b]{8.5cm}{\itaqualifictext}%

   \vfill

   \begin{spacing}{1.5}
       \@advisor
   \end{spacing}

   \@ifundefined{@coadvisor}{}{      % Co-advisor eh opcional
        \vfill
        \@coadvisor
   }

   \vfill

   \begin{spacing}{1.5}
   S\~{a}o Jos\'{e} dos Campos, \@publmonth\ de \@publyear
   \end{spacing}
 }

%==============================================================================
% Capa das Teses de Mestrado e Doutorado
%==============================================================================
\newcommand{\thethesistitlepage}{%

   \noindent

   \begin{spacing}{1.2}
   \noindent \parbox[c]{\textwidth}{\itaformattitletext{\itatitletext}}
   \end{spacing}

   \vspace*{\stretch{2}}

   \center

   \itaformatauthorname{\@authorfirst\ \@authorlast}
   \vfill

   \vspace*{\stretch{1}}

   \begin{spacing}{1.2}
   \itaformatworktitle{\MakeUppercase{\@title}}
   \end{spacing}

   \vspace*{\stretch{2}}

   \normalsize
   \itathesisapprovedmembersbabel

   \vspace*{\stretch{3}}

   \begin{spacing}{1.5}
       \@advisor
   \end{spacing}

%    \@ifundefined{@coadvisor}{}{      % Co-advisor eh opcional
%         \vspace*{\stretch{2}}
%         \@coadvisor
%   }

   \@ifundefined{@coadvisor}{}{      % Co-advisor eh opcional
        \vspace*{\stretch{2}}
        \begin{spacing}{1.5}
        \@coadvisor
	\end{spacing}
  }



   \vspace*{\stretch{2}}

   \begin{spacing}{1.5}
       \@boss
   \end{spacing}

   \vspace*{\stretch{2}}

   \begin{spacing}{1.5}
   Campo Montenegro \\ S\~{a}o Jos\'{e} dos Campos, SP - \itacountrybabel \\ \@publyear
   \end{spacing}

   \@makecippage        % funcao para criar verso da folha de rosto
   \@listexaminators    % funcao para criar pagina de membros da banca
 }

%==============================================================================
% CIP ... Verso da Folha de Rosto
%==============================================================================
\newcommand{\@makecippage}{%
	\newpage%
  \pdfbookmark[0]{\namecip}{cip}
	\thispagestyle{empty}
	\begin{flushleft}
		\begin{footnotesize}
 		{\setlength{\baselineskip}{0.8\baselineskip}
		  \textbf{\itaciptitlebabel} \\
		  \textbf{\itacipbibbabel}\\}
		\end{footnotesize}
		\@cipwindow
		\@bibref
		\@rights
        \end{flushleft}
        \vfill

}
% definição do quadro
\def\@cipwindow{%
        \framebox[\textwidth]{%
        \begin{minipage}{\textwidth - 10mm}%
	   \begin{flushleft}
	   	\vspace*{0.4ex}
                \setlength{\parindent}{0.5em}%
		\begin{footnotesize}
 		    \setlength{\baselineskip}{0.7\baselineskip}
		    \noindent\@authorlast, \@authorfirst\par
                    \@title\ / \@authorfirst\ \@authorlast.\\
                    \noindent São José dos Campos, \@publyear.\par
                    \NumPenultimaPagina f.\par
		    \vspace{\baselineskip}
		    \itacipdata1babel
                    \vspace{0.4ex}
                   \end{footnotesize}
	   \end{flushleft}
        \end{minipage}%
        }%
}

% Referencia Bibliografica
\def\@bibref{%
       \vspace*{\stretch{2}}
       \normalsize
          \textbf{\itarefbibnamecipbabel} \par

          {\setlength{\baselineskip}{0.7\baselineskip}
          \MakeUppercase{\@authorlast}, \@authorfirst. \textbf{\@title}. \@publyear.                     \NumPenultimaPagina f. \itacip2babel \\}
}
% Cessao de Direitos
\def\@rights{%
       \vspace*{\stretch{4}}
       {\normalsize\textbf{\itacedirnamebabel}} \par
       {\setlength{\baselineskip}{0.7\baselineskip}
       {\footnotesize \itacipauthorname} {\normalsize \@authorfirst\ \@authorlast} \\
       {\footnotesize \itacipworktitlebabel} {\normalsize \@title.} \\
       {\footnotesize \itacipworktype} {\normalsize \itaworklevel\ / \@publyear} \\ }

       \vspace{\baselineskip}

       \parbox[c]{\textwidth}{\normalsize\setlength{\baselineskip}{0.7\baselineskip}\itacesdirtextbabel \\}

       \vspace*{\stretch{2}}
       \rule{75mm}{0.2mm}\\
       {\normalsize\setlength{\baselineskip}{0.7\baselineskip}
           \@authorfirst\ \@authorlast\\
	   \@itaauthoraddress\\
	   CEP \@itaauthorcep\ -- \@itaauthorcity\\}
}

%==============================================================================
%%% Banca Examinadora...
%==============================================================================
\newcommand{\@listexaminators}
{
   \newpage
   \pdfbookmark[0]{\namepageexaminersbookmark}{aprovacao}
   \thispagestyle{empty}

   \noindent
   \begin{spacing}{1.2}
       \begin{center}
         \itaformatworktitle{\MakeUppercase{\@title}}
         \vfill
         \itaformatauthorname{\@authorfirst\ \@authorlast}
         \vfill
       \end{center}
       \raggedright{\normalsize{\namepageexaminers}}
       \vfill
    \end{spacing}
        \raggedright\@memberslist
     \vfill
     \center
         \large\textbf{ITA}

}

%==============================================================================
%%% Dedicatória...
%==============================================================================
\newenvironment{itadedication}
{\thispagestyle{empty}%
  \pdfbookmark[0]{\namededicatory}{dedication}
  \begin{flushright}%
  \null\vfil \@beginparpenalty\@lowpenalty
  \vspace{120mm}
  \hspace{80mm}
  \begin{minipage}[b]{0.35\textwidth}\begin{spacing}{1.5}}
{\end{spacing}\end{minipage}\end{flushright}\par\vfil\null\newpage}

%==============================================================================
%%% Agradecimentos...
%==============================================================================
\newenvironment{itathanks}[1][\nameacknowledgment]
{
 \chapter*{#1}
 \pdfbookmark[0]{\nameacknowledgment}{acknowledgment}
 \begin{flushright}\begin{spacing}{1.5}}
 {\end{spacing}\end{flushright} \par\vfil\null\newpage}

%==============================================================================
%%% Resumo ...
%==============================================================================
\newenvironment{abstract}
{\chapter*{\nameabstract}
 \pdfbookmark[0]{\nameabstract}{resumo}
 \begin{spacing}{2}}
{\end{spacing} }

%==============================================================================
%%% Abstract ...
%==============================================================================
\newenvironment{englishabstract}
{\chapter*{\nameengabstract}
 \pdfbookmark[0]{\nameengabstract}{abstract}
 \it \begin{spacing}{2}} %abstract em italico ativado
{ \end{spacing} }

%==============================================================================
%%% Redefinicao de chapter
%==============================================================================
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                    \thispagestyle{empty}%
                    \global\@topnum\z@
                    \@afterindenttrue
                    \secdef\@chapter\@schapter}
% Redefinicao do espaco entre paragrafos
\setlength{\parskip}{.5em}

%==============================================================================
%%% Hack: Adicionando Bibliografia, Lista de Figuras, Lista de Tabelas,
%%% Lista de Simbolos e Lista de Abreviaturas ao Sumario
%==============================================================================
% Bibliografia
\renewenvironment{thebibliography}[1]
     {\chapter*{\bibname
      \refstepcounter{chapter}
      \addcontentsline{toc}{chapter}{\bibname}   % Thanks to D.Farfan
      \@mkboth{\MakeUppercase{\bibname}}%
              {\MakeUppercase{\bibname}}}%       % Thanks to ffs :-)
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m
}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}

% Lista de figuras...
\renewcommand\listoffigures{%
    \begin{spacing}{1.5}   %ita
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename
      \@mkboth{\MakeUppercase{\listfigurename}}%
              {\MakeUppercase{\listfigurename}}}      % Thanks to Reinaldo Fortes
    \addcontentsline{toc}{chapter}{\listfigurename}   % Thanks to D.Farfan
    \@starttoc{lof}%
    \if@restonecol\twocolumn\fi
    \end{spacing}   %ita
    }

% Lista de tabelas...
\renewcommand\listoftables{%
    \begin{spacing}{1.5}   %ita
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listtablename
      \@mkboth{\MakeUppercase{\listtablename}}%
               {\MakeUppercase{\listtablename}}}     % Thanks to Reinaldo Fortes
    \addcontentsline{toc}{chapter}{\listtablename}   % Thanks do D.Farfan
    \@starttoc{lot}%
    \if@restonecol\twocolumn\fi
    \end{spacing}   %ita
    }

% Redefinicao do Sumário...
\renewcommand\tableofcontents{%
    \begin{spacing}{1.5}   %ita
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\contentsname
        \pdfbookmark[0]{\namecontents}{contents}
        \@mkboth{\MakeUppercase{\contentsname}}%
                 {\MakeUppercase{\contentsname}}}       % Thanks to Reinaldo Fortes
     \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    \end{spacing}   %ita
    }

% Lista de Símbolos...
\newcommand\listofsymbols{%
    \begin{spacing}{1.5}   %ita
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listofsymbolsname
      \@mkboth{\MakeUppercase{\listofsymbolsname}}%
              {\MakeUppercase{\listofsymbolsname}}}%         Thanks to Reinaldo Fortes
    \addcontentsline{toc}{chapter}{\listofsymbolsname}%      Thanks to ffs  :-)
    \@starttoc{lof}%
    \if@restonecol\twocolumn\fi
    \end{spacing}   %ita
    }

% Lista de Abreviaturas...
\newcommand\listofabbreviations{%
    \begin{spacing}{1.5}   %ita
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{{\listofabbreviationsname}
      \@mkboth{\MakeUppercase{\listofabbreviationsname}}%       Thanks to Reinaldo Fortes
              {\MakeUppercase{\listofabbreviationsname}}}%
     \addcontentsline{toc}{chapter}{\listofabbreviationsname}%  Thanks to ffs  :-)
    \@starttoc{lof}%
    \if@restonecol\twocolumn\fi
    \end{spacing}   %ita
    }


% Thanks to Dr. Alan Wilter Sousa da Silva - alan@lncc.br
\renewcommand{\addcontentsline}[3]{%
  \begingroup
    \let\label\@gobble
    \let\textlatin\@firstofone
    \ifx\@currentHref\@empty
      \Hy@Warning{%
        No destination for bookmark of \string\addcontentsline,%
        \MessageBreak destination is added%
      }%
      \phantomsection
    \fi
    \expandafter\ifx\csname toclevel@#2\endcsname\relax
      \begingroup
        \def\Hy@tempa{#1}%
        \ifx\Hy@tempa\Hy@bookmarkstype
          \Hy@WarningNoLine{bookmark level for unknown #2 defaults to 0}%
        \else
          \Hy@Info{bookmark level for unknown #2 defaults to 0}%
        \fi
      \endgroup
      \expandafter\gdef\csname toclevel@#2\endcsname{0}%
    \fi
    \edef\Hy@toclevel{\csname toclevel@#2\endcsname}%
    \Hy@writebookmark{\csname the#2\endcsname}%
      {#3}%
      {\@currentHref}%
      {\Hy@toclevel}%
      {#1}%
    \ifHy@verbose
      \typeout{pdftex: bookmark at \the\inputlineno:
        {\csname the#2\endcsname}
        {#3}
        {\@currentHref}%
        {\Hy@toclevel}%
        {#1}%
      }%
    \fi
    \addtocontents{#1}{%
      \protect\contentsline{#2}{#3}{\thepage}{\@currentHref}%
    }%
  \endgroup
}

%==============================================================================
%%% Cabecalhos e Rodapés
%==============================================================================
\pagestyle{fancy}
\lhead{\leftmark}
\chead{}
\rhead{\thepage}
\lfoot{}\cfoot{}\rfoot{}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
% Imprimir rodape com versao preliminar?
  \if@dv
     \rfoot{\emph{\itadvnamebabel\ \today }}
  \fi

%==============================================================================
%%% Membros da banca examinadora
%==============================================================================
\newcounter{mecounter}
\newcommand{\examiner}[4]{
        \addtocounter{mecounter}{1}
        \expandafter\gdef\csname metitle\alph{mecounter}\endcsname{#1}
        \expandafter\gdef\csname mename\alph{mecounter}\endcsname{#2}
        \expandafter\gdef\csname merole\alph{mecounter}\endcsname{#3}
        \expandafter\gdef\csname meinst\alph{mecounter}\endcsname{#4}
}

\newcommand{\@memberslist}{%
   \begin{tabular}{l l l l}
      \@ifundefined{metitlea}{}    {\metitlea\@         & \menamea\@       & \hspace{1cm} \merolea\@ & - \hspace{0.5cm} \meinsta\@ } \\
                                 \itaadvisortitle   & \itaadvisorname  & \hspace{1cm} \itaadvisorwordbabelll\ & - \hspace{0.5cm} ITA       

      \@ifundefined{@coadvisor}{}  {\\ \@itacoadvisortitle   & \@itacoadvisorname  & \hspace{1cm} \itacoadvisorwordbabelll & - \hspace{0.5cm} \@itacoadvisorinst }
      \@ifundefined{metitleb}{}    {\\ \metitleb\@ & \menameb\@ & \hspace{1cm} \meroleb\@ & - \hspace{0.5cm} \meinstb\@ } \\
      \@ifundefined{metitlec}{}    {\metitlec\@ & \menamec\@ & \hspace{1cm} \merolec\@ & - \hspace{0.5cm} \meinstc\@ } \\
      \@ifundefined{metitled}{}    {\metitled\@ & \menamed\@ & \hspace{1cm} \meroled\@ & - \hspace{0.5cm} \meinstd\@ } \\
      \@ifundefined{metitlee}{}    {\metitlee\@ & \menamee\@ & \hspace{1cm} \merolee\@ & - \hspace{0.5cm} \meinste\@ } \\
      \@ifundefined{metitlef}{}    {\metitlef\@ & \menamef\@ & \hspace{1cm} \merolef\@ & - \hspace{0.5cm} \meinstf\@ } \\
      \@ifundefined{metitleg}{}    {\metitleg\@ & \menameg\@ & \hspace{1cm} \meroleg\@ & - \hspace{0.5cm} \meinstg\@ } \\
      \@ifundefined{metitleh}{}    {\metitleh\@ & \menameh\@ & \hspace{1cm} \meroleh\@ & - \hspace{0.5cm} \meinsth\@ }
        \end{tabular}
}

%==============================================================================
%%% Palavras-chave
%==============================================================================
\newcommand{\keywords}[1]{%
    \vfill \noindent\textbf{Palavras--Chave:} #1%
}

%==============================================================================
%%% Keywords
%==============================================================================
\newcommand{\englishkeywords}[1]{%
    \vfill \noindent\textbf{Keywords:} #1
}

%==============================================================================
% Definição das palavras-chave para CIP (informado pela Biblioteca)
%==============================================================================
\newcounter{kwcipcounter}
\newcommand{\kwcip}[1]{
        \addtocounter{kwcipcounter}{1}
        \expandafter\gdef\csname kwcip\alph{kwcipcounter}\endcsname{#1}
}
\newcommand{\@cipkw}{%
        \@ifundefined{kwcipa}{}{1.~\expandafter\MakeUppercase\kwcipa\@. }%
        \@ifundefined{kwcipb}{}{2.~\expandafter\MakeUppercase\kwcipb\@. }%
        \@ifundefined{kwcipc}{}{3.~\expandafter\MakeUppercase\kwcipc\@. }%
        \@ifundefined{kwcipd}{}{4.~\expandafter\MakeUppercase\kwcipd\@. }%
        \@ifundefined{kwcipe}{}{5.~\expandafter\MakeUppercase\kwcipe\@. }%
        \@ifundefined{kwcipf}{}{6.~\expandafter\MakeUppercase\kwcipf\@. }%
        \@ifundefined{kwcipg}{}{7.~\expandafter\MakeUppercase\kwcipg\@. }%
        \@ifundefined{kwciph}{}{8.~\expandafter\MakeUppercase\kwciph\@. }%
        \@ifundefined{kwcipi}{}{9.~\expandafter\MakeUppercase\kwcipi\@. }%
        \@ifundefined{kwcipj}{}{10.~\expandafter\MakeUppercase\kwcipj\@. }%
}

%==============================================================================
%%% Hack: Centralizando \chapter*
%%% \@makeschapterhead é chamado por \chapter*
%==============================================================================
\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \centering
    \normalfont
    \interlinepenalty\@M
    \Huge \bfseries  #1\par\nobreak
    \vskip 40\p@
  }}

%==============================================================================
%%% Redefinicao do comando \appendix para mostrar 'Apêndice' ou 'Anexo'
%%% no Sumario
%==============================================================================
\renewcommand{\appendix}{%
  \cleardoublepage
  \providecommand\anexoautorefname{appendix}
	\setcounter{chapter}{0}%
	\setcounter{section}{0}%
	\def\Hy@appendixstring{appendix}% %%novo string no *.toc, para fazer o hyperlink funcionar
	\def\anexo{%
  \@ifundefined{chapter}%
    {\gdef\theHsection{\Alph{section}}}%
    {\gdef\theHchapter{\Alph{chapter}}}%
  \xdef\Hy@chapapp{\Hy@appendixstring}%

  \gdef\@chapapp{\appendixname}%
  \addtocontents{toc}{\SetAppendixTocName{\appendixname}}%
  \gdef\thechapter{\@Alph\c@chapter}%
  }
  \anexo
}

%==============================================================================
%%% Acrescenta o comando SetappendixTocName ao toc
%==============================================================================
\DeclareRobustCommand{\SetAppendixTocName}[1]{\gdef\AppendixTocName{#1}}

%==============================================================================
%%% Novo comando: \annex
%==============================================================================
\newcommand{\annex}{%
  \cleardoublepage
  \providecommand\anexoautorefname{annex}
	\setcounter{chapter}{0}%
	\setcounter{section}{0}%
	\def\Hy@appendixstring{annex}% %%novo string no *.toc, para fazer o hyperlink funcionar
	\def\anexo{%
  \@ifundefined{chapter}%
    {\gdef\theHsection{\alph{section}}}%
    {\gdef\theHchapter{\alph{chapter}}}%
  \xdef\Hy@chapapp{\Hy@appendixstring}%

  \gdef\@chapapp{\nameannex}%
  \addtocontents{toc}{\SetAppendixTocName{\nameannex}}%
  \gdef\thechapter{\@Alph\c@chapter}%
  }
  \anexo
}


%==============================================================================
%%% Redefinicao de mainmatter para numeracao continua de paginas
%==============================================================================
\renewcommand\mainmatter{%
  \cleardoublepage
  \@mainmattertrue
  \renewcommand{\thepage}{\arabic{page}} }

%==============================================================================
%%% 'Desligar' hifenacao...
%==============================================================================
\newlanguage\nohyphen
\newcommand\nh[1]{{\language\nohyphen #1}}

%==============================================================================
%%% Redefinicao de l@chapter, l@section e l@subsection para acrescentar
%%% a palavra 'Anexo' ou 'Apendice' no toc e ajustar identacao para
%%% "nada identado" ... :-)
%==============================================================================
\renewcommand*\l@chapter[2]{%
  \ifnum \c@tocdepth >\m@ne
    \addpenalty{-\@highpenalty}%
    \vskip -3ex \@plus\p@
    \setlength\@tempdima{1.5em}%
    \begingroup
    \ifx\AppendixTocName\undefined\else
       \renewcommand{\numberline}[1]{\AppendixTocName~##1~~--~~}%
    \fi
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      \@dottedtocline{0}{0em}{1.8em}{\normalfont\scshape\large{#1}}{#2}
      \penalty\@highpenalty
    \endgroup
  \fi}

% l@section
\renewcommand*{\l@section}[2]{%
\@dottedtocline{1}{0em}{2.8em}{\textbf{#1}}{\hss #2}}

% l@subsection
\renewcommand*{\l@subsection}{\@dottedtocline{2}{0em}{3.7em}}

%==============================================================================
%%% Numerar o subsubsection conforme definido anteriormente
%==============================================================================
\setcounter{secnumdepth}{4}

%==============================================================================
%%% Glossario
%==============================================================================
\newcommand{\itaglossary}{
\cleardoublepage
\thispagestyle{empty}%
\@mkboth{\MakeUppercase{\itaglossarynamebabel}}%
        {\MakeUppercase{\itaglossarynamebabel}}%
\gdef\glossaryname{\itaglossarynamebabel}
\refstepcounter{chapter}
}

%==============================================================================
% %%% Centralizar e ajustar os espacamentos dos captions das figuras e tabelas 
%==============================================================================
\def\fnum@figure{\centering\MakeUppercase{\figurename}\nobreakspace\thefigure}
\def\fnum@table{\centering\MakeUppercase{\tablename}\nobreakspace\thetable}
\setlength\abovecaptionskip{6\p@}
\setlength\belowcaptionskip{4\p@}

% Redefinicao do caracter que separa o label Figura ou Tabela do texto
\renewcommand*\captionlabeldelim{\ --}

%==============================================================================
% %%% Indentar a segunda linha de captions longos das listas 
%     de figuras e tabelas
%==============================================================================
\renewcommand*{\l@figure}{\@dottedtocline{1}{0cm}{1cm}}
\def\FigureITA@dottedtocline#1#2#3#4#5{\begingroup
  \def\numberline##1{\hb@xt@\@tempdima{\itafigurenamebabel~##1 --\hfil}}%
  \@dottedtocline{#1}{#2}{#3}{#4}{#5}%
\endgroup}
\def\TableITA@dottedtocline#1#2#3#4#5{\begingroup
  \def\numberline##1{\hb@xt@\@tempdima{\itatablenamebabel~##1 --\hfil}}%
  \@dottedtocline{#1}{#2}{#3}{#4}{#5}%
\endgroup}
% faz a lista de figuras e de tabelas usarem as novas versoes dos \dottedtocline
\renewcommand*\l@figure{\FigureITA@dottedtocline{1}{0cm}{2.8cm}}
\renewcommand*\l@table{\TableITA@dottedtocline{1}{0cm}{2.8cm}}


%==============================================================================
% Folha de Registro do Documento
%==============================================================================
\newcommand{\esp}{.2cm}

% Definicoes dos valores dos campos do formulario
\newcommand{\FRDitadata}[1]{\gdef\FRDitadatababel{#1}}
\newcommand{\FRDitadocnro}[1]{\gdef\FRDitadocnrobabel{#1}}
\newcommand{\FRDitaorgaointerno}[1]{\gdef\FRDitaorgaointernobabel{#1}}
\newcommand{\FRDitapalavrasautor}[1]{\gdef\FRDitapalavrasautorbabel{#1}}
\newcommand{\FRDitapalavrasresult}[1]{\gdef\FRDitapalavrasresultbabel{#1}}

\newcommand{\FRDitaresumo}[1]{
    \gdef\FDRitaabstractcontent{#1}
}


%  Opcoes para: 
%  Nacional ou Internacional -- N/I
%  Ostensivo, Reservado, Confidencial ou Secreto -- O/R/C/S
\newcommand{\FRDitaOpcoes}[2]{
      \gdef\N{\ } \gdef\I{\ }      
      \gdef\O{\ } \gdef\R{\ } \gdef\C{\ } \gdef\S{\ }      
      
      \ifthenelse{\equal{#1}{N}}{\gdef\N{\textbf{X}}}{}
      \ifthenelse{\equal{#1}{I}}{\gdef\I{\textbf{X}}}{}
      
      \ifthenelse{\equal{#2}{O}}{\gdef\O{\textbf{X}}}{}
      \ifthenelse{\equal{#2}{R}}{\gdef\R{\textbf{X}}}{}
      \ifthenelse{\equal{#2}{C}}{\gdef\C{\textbf{X}}}{}
      \ifthenelse{\equal{#2}{S}}{\gdef\S{\textbf{X}}}{}
}

% Folha de Registro de Documento
\newcommand{\itaFRD}{
     
     \if@openright\cleardoublepage\else\clearpage\fi
     
     %Redefinicao das margens ...
	\setlength{\hoffset}{-1in}        % remove padrão do LaTeX
	\setlength{\voffset}{-1in}        % remove padrão do LaTeX
	\setlength{\oddsidemargin}{1cm}   % margem esquerda, páginas ímpares
	\setlength{\evensidemargin}{1cm}  % margem esquerda, páginas pares
	\setlength{\topmargin}{3cm}       % margem superior
	\newlength{\bottommargin}         % margem inferior é deduzida em LaTeX
	\setlength{\bottommargin}{2cm}    % margem inferior
	\setlength{\headheight}{0pt}      % altura do cabeçalho
	\setlength{\headsep}{0pt}         % espaço entre cabeçalho e texto
	\setlength{\footskip}{0mm}        % espaço entre rodapé e texto
	\setlength\textheight{            % altura disponível para texto
		\paperheight-\topmargin-\bottommargin-\headheight-\headsep-\footskip
	}
	% margem direita é deduzida em LaTeX... alterando isso...
	\newlength{\rightmarginn}        
	\setlength{\rightmarginn}{2cm}    % margem direita

	\setlength\textwidth{             % largura disponível para texto
		\paperwidth-\oddsidemargin-\rightmarginn
	}

     \singlespacing
     \footnotesize
     \setlength{\baselineskip}{0.1\baselineskip}
     \setlength{\parskip}{.1em}
     \setlength{\extrarowheight}{2pt}
          
     \lhead{}\rhead{}

     \thispagestyle{empty}
     \pdfbookmark[0]{\itapagedocregbabel}{bla}    
     
     \begin{tabularx}{\textwidth}{|X|X|X|X|}
	\hline
	\multicolumn{ 4}{|c|}{} \\
	\multicolumn{ 4}{|c|}{\normalsize FOLHA DE REGISTRO DO DOCUMENTO} \\
	\multicolumn{ 4}{|c|}{} \\
	\hline
	
	$^{1.}$ \scriptsize CLASSIFICAÇÃO/TIPO & 
	$^{2.}$ \scriptsize DATA               & 
	$^{3.}$ \scriptsize DOCUMENTO Nº       & 
	$^{4.}$ \scriptsize Nº DE PÁGINAS             \tabularnewline 
	
	\centering{\ifthenelse{\equal{\itaoptionlevel}{msc}}{TM}{TD}}  & 
	\centering{\FRDitadatababel}   & 
	\centering\scriptsize \FRDitadocnrobabel  &  
	\centering\NumPenultimaPagina                  \tabularnewline[\esp]
	\hline
	
	\multicolumn{ 4}{|p{17cm}|}{$^{5.}$ \scriptsize TÍTULO E SUBTÍTULO:} \\
	\multicolumn{ 4}{|l|}{\nh{\parbox[b]{.95\textwidth}{\@title}}} \\[\esp]
	\hline
	\multicolumn{ 4}{|l|}{$^{6.}$ \scriptsize AUTOR(ES):} \\
	\multicolumn{ 4}{|l|}{\textbf{\@authorfirst\ \@authorlast}} \\[\esp]
	\hline
	\multicolumn{ 4}{|l|}{$^{7.}$ \scriptsize INSTITUIÇÃO(ÕES)/ÓRGÃO(S) 
	    INTERNO(S)/DIVISÃO(ÕES):} \\
	\multicolumn{ 4}{|l|}{Instituto Tecnológico de Aeronáutica. \FRDitaorgaointernobabel} \\[\esp]
	\hline
	\multicolumn{ 4}{|l|}{$^{8.}$ \scriptsize PALAVRAS-CHAVE SUGERIDAS PELO AUTOR:} \\
	\multicolumn{ 4}{|p{17cm}|}{\FRDitapalavrasautorbabel} \\[\esp]
	\hline
	\multicolumn{ 4}{|l|}{$^{9.}$ \scriptsize PALAVRAS-CHAVE RESULTANTES DE INDEXAÇÃO:} \\
	\multicolumn{ 4}{|p{17cm}|}{\FRDitapalavrasresultbabel} \\[\esp]
	\hline
	\multicolumn{ 4}{|l|}{$^{10.}$ {\scriptsize APRESENTAÇÃO:}  \hfill 
		(\N) \textbf{Nacional} \ \ \ 
		(\I) \textbf{Internacional} } \\
	\multicolumn{ 4}{|l|}{ITA, São José dos Campos, \@publyear, \NumPenultimaPagina\ páginas} \\[\esp]
	\hline
	\multicolumn{ 4}{|l|}{$^{11.}$ \scriptsize RESUMO:} \\
	\multicolumn{ 4}{|c|}{\parbox[t][12cm]{.95\textwidth}{\FDRitaabstractcontent}} \\[\esp]
	\hline
	\multicolumn{ 4}{|l|}{$^{12.}$ \scriptsize GRAU DE SIGILO:} \\
	\multicolumn{ 4}{| l|}{(\O) \textbf{OSTENSIVO} \hfill 
			       (\R) \textbf{RESERVADO} \hfill 
			       (\C) \textbf{CONFIDENCIAL} \hfill 
			       (\S) \textbf{SECRETO}} \\[\esp]
	\hline
     \end{tabularx}  
     
}


%==============================================================================
%%% Hack: Retirando a palavra Capitulo mas mantendo Anexo e Apendice...
%%% \@makechapterhead é chamado por \chapter
%==============================================================================
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
          % se "anexo" nao foi definido, altera cabecalho do capitulo..
	  % senao, mantem a palavra Anexo ou Apendice
          \@ifundefined{anexo}      
		{\huge\bfseries \thechapter\space}
		{\huge\bfseries \@chapapp\space \thechapter \space -}
      \fi
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@
  }}
  
  
%==============================================================================
%%% Obtendo o numero da penultima pagina, visto que a FRD nao é contada ...
%%% Thanks to Dr. Miguel V. S. Frasson!! :-)
%==============================================================================
\def\deixasosegundo#1#2#3!{#2}
\makeatletter
\AtBeginDocument{%
  % se a referencia a ultima pagina nao existe, definir como ??
  \expandafter\ifx\csname r@LastPage\endcsname\relax
    \newcommand\NumPenultimaPagina{{\bfseries??}}%
  \else
    \newcounter{butlastpage}%
    \setcounter{butlastpage}{\expandafter\deixasosegundo\r@LastPage!}%
    \addtocounter{butlastpage}{-1}%
    \newcommand\NumPenultimaPagina{}%
    \edef\NumPenultimaPagina{\arabic{butlastpage}}%
  \fi}

Code: Select all

\usepackage{float}
\usepackage[num]{abntcite}
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}
\hypersetup{linktocpage}
%\citebrackets[]


%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
% Identificacoes...
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\course{Physics}
\dept{Physics}
\area{Atomic and Molecular}

% Autor do trabalho: Nome Sobrenome 
\author{Rene Felipe Keidel}{Spada}

% Endereco do Autor -> utilizado no verso da folha de rosto 
\itaauthoraddress{Avenida São João}{12.220-281}{São José dos Campos -- SP}

% Titulo da Tese/Dissertacao 
%\title{Redes Neurais Artificiais para Reconhecimento de Padrões}

% Orientador 
\advisor{Prof.~Dr.}{XXXX XXXX XXXX}

% Pro-reitor da divisao de Pos-Graduacao 
\boss{Prof.~Dr.}{XXXX XXX}
% Banca Examinadora (ai ai ai .... )   :-) 
\examiner{Prof. Dr.}{XXXX XXXX}{Presidente}{ITA}%
\examiner{Prof Dr.}{XXXX XXXX}{Membro Externo}{XXXX}%
\examiner{Prof. Dr.}{XXXX XXXX}{Membro Interno}{ITA}%
% Data da defesa
\date{Fevereiro}{2010}
% Palavras-Chaves informadas pela Biblioteca -> utilizada na CIP
\kwcip{Self Organized Maps}
\kwcip{XXXXXXXX}
\kwcip{Density Functional Theory}
\kwcip{softness}
\kwcip{hardness}
 

Code: Select all

% Pré-visualizar código-fonte

%% LyX 1.6.5 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[brazil]{ita}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[letterpaper]{geometry}
\geometry{verbose}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{float}
\usepackage[num]{abntcite}
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}
\hypersetup{linktocpage}
%\citebrackets[]


%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
% Identificacoes...
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\course{Physics}
\dept{Physics}
\area{Atomic and Molecular}

% Autor do trabalho: Nome Sobrenome 
\author{Rene Felipe Keidel}{Spada}

% Endereco do Autor -> utilizado no verso da folha de rosto 
\itaauthoraddress{Avenida São João}{12.220-281}{São José dos Campos -- SP}

% Titulo da Tese/Dissertacao 
%\title{Redes Neurais Artificiais para Reconhecimento de Padrões}

% Orientador 
\advisor{Prof.~Dr.}{XXXX XXXX XXXX}

% Pro-reitor da divisao de Pos-Graduacao 
\boss{Prof.~Dr.}{XXXX XXX}
% Banca Examinadora (ai ai ai .... )   :-) 
\examiner{Prof. Dr.}{XXXX XXXX}{Presidente}{ITA}%
\examiner{Prof Dr.}{XXXX XXXX}{Membro Externo}{XXXX}%
\examiner{Prof. Dr.}{XXXX XXXX}{Membro Interno}{ITA}%
% Data da defesa
\date{Fevereiro}{2010}
% Palavras-Chaves informadas pela Biblioteca -> utilizada na CIP
\kwcip{Self Organized Maps}
\kwcip{XXXXXXXX}
\kwcip{Density Functional Theory}
\kwcip{softness}
\kwcip{hardness}
 

\makeatother

\usepackage{babel}

\begin{document}

\title{Teste}

\maketitle
teste teste teste \cite{geerlings2003conceptual,gibbs1equilibrium,KohonenLivro,SOM}
\bibliographystyle{abnt-num}
\bibliography{ref}

\end{document}

Code: Select all


@book{KohonenLivro,
  title={{Self-Organizing Maps}},
  author={Teuvo Kohonen},
  isbn={3-540-67921},
  year={2001},
  publisher={Springer-Verlag Berlin Heidelberg}
}

@article{gibbs1equilibrium,
  title={{On the Equilibrium of Heterogeneous Substances. 1876/1878}},
  author={Gibbs, JW},
  journal={The Collected Works of J. Willard Gibbs},
  volume={1}
}

@article{geerlings2003conceptual,
  title={{Conceptual density functional theory}},
  author={P. Geerlings and F. D. Proft and W. Langenaeker},
  journal={Chem. Rev},
  volume={103},
  number={5},
  pages={1793--1874},
  year={2003},
  publisher={ACS Publications}
}

@misc{SOM,
title ="http://www.cis.hut.fi/projects/somtoolbox/",
month ="Acesso em Dezembro de 2010"
}

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Multiple references in bibtex

Post by frabjous »

Wow, what a mess. I think that document class is pretty poorly written. Are you sure you need to use it?

Anyway, there is a discussion group for it (which looks active), as well as a place to post "issues" with it, at the link you provided. You might want to try that if you continue to have issues.

Anyway, I had a look at the files you posted. The second one is just the preamble of the third one, right? I was unsure why they were both there.

But just comparing the LaTeX file generated by LyX with the ita.cls file you begin to get a sense of what some of the problem are. Both the class, and your file, are loading the same packages, but with diferrent and incompatible options. E.g., ita.cls has:

Code: Select all

\RequirePackage[alf,abnt-emphasize=bf,abnt-etal-list=0,abnt-etal-text=it]{abntcite}
But your document has:

Code: Select all

\usepackage[num]{abntcite}
Same goes for things such as the hyperref package, the babel package, and the papersize (geometry).

But the real reason for citations not being compressed is the hyperref package. Since it is turning all the citations into hyperlinks, it needs each number to be listed separately so that each number can be a link. If you were to use the abntcite package without hyperref, it would work to compress the citations, but with the hyperref package, it does not work.

However, you cannot simply remove the hyperref package, since the ita.cls file depends on it in many ways, especially with regard to PDF bookmarks.

Other packages which do this, such as the cite package and natbib package, have ways of making the compression consistent with hyperref (e.g., the hypernat package), but as far as I know, there isn't an easy way to make this feature of abntcite compatible with hyperref.

Are you actually using the abntcite package for anything, or are you just using it because it is required for ita.cls?

If the latter, then I'd remove it from both your file, and add some stuff from natbib:

Code: Select all

\usepackage[numbers,sort&compress]{natbib}
\renewcommand{\bibnumfmt}[1]{#1~}
\setcitestyle{round}
\usepackage{hypernat}
The \renewcommand line sets how the numbers in the bibliography itself look. Adjust as you see fit. (E.g., changing {#1~} to {[#1]} would put brackets around them, {#1.~} would add a period after the number.) the setcitestyle line gets you soft parentheses rather than brackets for internal citations, e.g., (1-4) rather than [1-4].

(You can still use the abnt-num bibliography style as near as I can tell.)

I'd also remove all the stuff from your file about hyperref and hypersetup and the babel package. If you just comment them out, your final document might look something like this. (All the changes are in the LaTeX preamble, so hopefully you can see what you'd need to do in LyX.)

Code: Select all

% Pré-visualizar código-fonte

%% LyX 1.6.5 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[brazil]{ita}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[letterpaper]{geometry}
\geometry{verbose}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{float}
%\usepackage[num]{abntcite}
\usepackage[numbers,sort&compress]{natbib}
\renewcommand{\bibnumfmt}[1]{#1~}
\setcitestyle{round}
\usepackage{hypernat}
% LINES BELOW COMMENTED OUT
%\usepackage{hyperref}
%\hypersetup{
%    colorlinks,
%    citecolor=black,
%    filecolor=black,
%    linkcolor=black,
%    urlcolor=black
%}
%\hypersetup{linktocpage}
%\citebrackets[]


%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
% Identificacoes...
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\course{Physics}
\dept{Physics}
\area{Atomic and Molecular}

% Autor do trabalho: Nome Sobrenome
\author{Rene Felipe Keidel}{Spada}

% Endereco do Autor -> utilizado no verso da folha de rosto
\itaauthoraddress{Avenida São João}{12.220-281}{São José dos Campos -- SP}

% Titulo da Tese/Dissertacao
%\title{Redes Neurais Artificiais para Reconhecimento de Padrões}

% Orientador
\advisor{Prof.~Dr.}{XXXX XXXX XXXX}

% Pro-reitor da divisao de Pos-Graduacao
\boss{Prof.~Dr.}{XXXX XXX}
% Banca Examinadora (ai ai ai .... )   :-)
\examiner{Prof. Dr.}{XXXX XXXX}{Presidente}{ITA}%
\examiner{Prof Dr.}{XXXX XXXX}{Membro Externo}{XXXX}%
\examiner{Prof. Dr.}{XXXX XXXX}{Membro Interno}{ITA}%
% Data da defesa
\date{Fevereiro}{2010}
% Palavras-Chaves informadas pela Biblioteca -> utilizada na CIP
\kwcip{Self Organized Maps}
\kwcip{XXXXXXXX}
\kwcip{Density Functional Theory}
\kwcip{softness}
\kwcip{hardness}


\makeatother
% BABEL PACKAGE COMMENTED OUT
%\usepackage{babel}

\begin{document}

\title{Teste}

\maketitle
teste teste teste \cite{geerlings2003conceptual,gibbs1equilibrium,KohonenLivro,SOM}
\bibliographystyle{abnt-num}
\bibliography{ref}

\end{document}
(Notice that I also changed the inputenc line from latin9 to utf8, which is just because the editor I was using for testing uses utf8 encoding; you may need to change that back to latin9, or it may not matter at all.)


Now, I'd also remove the abntcite package from ita.cls and also insert your preferred options for hyperref, and set the page size correctly in the options to the book class importation.

Make a back-up of ita.cls before making changes!

In the end ita.cls might look like this:

Code: Select all

    %==============================================================================
    % This is the ITA LateX class - classe de documento com padrões do ITA
    % written by
    %              Fábio Fagundes Silveira   -  ffs [at] ita [dot] br
    %
    %              Benedito C. O. Maciel     -  bcmaciel [at] ita [dot] br
    %              Giovani Volnei Meinertz   -  giovani [at] ita [dot] br
    %
    % last updated:
    %        $Id: ita.cls 42 2006-10-01 22:30:09Z ffs $
    %        $HeadURL: file:///opt/repositorioITALUS/classeITA/tags/versao-2.1/ita.cls $
    %
    %
    % Copyright (C) 2004-2008 ITALUS - ITA LaTeX Users Group "Society"  :-)
    %
    % This program is free software; you can redistribute it and/or modify
    % it under the terms of the GNU General Public License as published by
    % the Free Software Foundation; either version 2 of the License, or
    % (at your option) any later version.
    %
    % This program is distributed in the hope that it will be useful,
    % but WITHOUT ANY WARRANTY; without even the implied warranty of
    % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    % GNU General Public License for more details.
    %
    % You should have received a copy of the GNU General Public License
    % along with this program; if not, write to the Free Software
    % Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    %
    % ITALUS
    % Technological Institute of Aeronautics --- ITA
    % Sao Jose dos Campos, Brazil
    % HomePages:        http://www.comp.ita.br/italus
    %                   http://groups.yahoo.com/group/italus/
    % Discussion list: italus {at} yahoogroups.com
    %==============================================================================

    %==============================================================================
    \NeedsTeXFormat{LaTeX2e}[1995/12/01]
    \ProvidesClass{ita}[2006/03/10 v2.0 Classe de documento com padrões do ITA]

    % % --------------------------------------------------------------------
    % %  Verificação se alvo será gerado pelo PDFLaTeX ou não
    % % --------------------------------------------------------------------
    %\newif\ifpdf
    %  \ifx\pdfoutput\undefined
    %      \pdffalse
    %  \else
    %      \pdfoutput=1
    %      \pdftrue
    % \fi

    %==============================================================================
    %%% Declaracao das opcoes
    %==============================================================================
    \DeclareOption{defaults}{
      \input{defaults.def}
    }
    % Mestrado
    \DeclareOption{msc}{
      \input{msc.def}
    }
    % Doutorado
    \DeclareOption{dsc}{
      \input{dsc.def} 
    }
    % Doutora
    \DeclareOption{fem}{
      \input{fem.def}
    }
    % Exame de Qualificacao
    \DeclareOption{quali}{
      \input{quali.def} 
    }
    % Versao em ingles
    \newif\if@eng
    \DeclareOption{eng}{
        \@engtrue
    }
    \DeclareOption{classic}{

        \newcommand{\itaformatworktitle}[1]{\Large \textbf{#1}}
        \newcommand{\itaformatauthorname}[1]{\large \textbf{#1}}
        \newcommand{\itaformattitletext}[1]{\large{#1}}
        \newcommand{\itaformatadvisorword}[1]{#1}

        \renewcommand{\itaspacing}{2}
    }

    %==============================================================================
    %%% dv: 'draft version': imprime ¿Versao Preliminar¿ + data da impressao
    %==============================================================================
    \newif\if@dv
    \DeclareOption{dv}{
        \@dvtrue
    }

    \ExecuteOptions{defaults,classic}
    \ProcessOptions
    \AtEndOfPackage{
        \renewcommand{\baselinestretch}{\itaspacing}
    }

     
    %==============================================================================
    %%% Heranca e Pacotes ...
    %==============================================================================
    \LoadClass[12pt,letterpaper,oneside]{book}
    \RequirePackage{calc}
    \RequirePackage{ifthen}

    \if@eng
       \RequirePackage[english]{babel}
    \else
       \RequirePackage[english,portuges,brazil]{babel}
    \fi

    \if@eng
       \input{itaeng.babel}
    \else
       \input{itabr.babel}
    \fi

    %\RequirePackage[latin1]{inputenc}
    \RequirePackage{setspace}
    \RequirePackage{fancyhdr}
    \RequirePackage{amsfonts}                 % Fontes p/ conjuntos: R,Z,H,...
    \RequirePackage{lastpage}
    \RequirePackage{indentfirst}
    \RequirePackage{caption2}
    \RequirePackage{longtable}
    \RequirePackage{array}
    \RequirePackage{tabularx}

    %==============================================================================
    %%% Glossário
    \usepackage{makeglo}
    \renewcommand{\glossmaxlabelwidth}{\hspace{3cm}}

    %% opcoes de cores
    %% linkcolor=blue,citecolor=gray,urlcolor=cyan
    \RequirePackage{color}        %% aplicar cores no texto
    \RequirePackage{hyphenat}     %% hifenização
    \RequirePackage{makeidx}      %% ÍNDICE

    %==============================================================================
    %%% Hyperref
    \definecolor{gray}{rgb}{0.4,0.4,0.4}
    \definecolor{bblue}{rgb}{0,0,.8} %% tom azul mais escuro

    \RequirePackage[debug,pagebackref=true,breaklinks,bookmarksopen=true,colorlinks=true,linkcolor=black,citecolor=black,filecolor=black,urlcolor=black,bookmarksnumbered=true,linktocpage,hyperindex=true,verbose=true]{hyperref} %% essencial %% gera pdf/dvi com links

    %==============================================================================

    %\ifpdf
    %  \RequirePackage{ae} %% fontes para pdf
    %  \RequirePackage[pdftex]{graphicx}
    %  \RequirePackage[pdftex]{geometry}
    %\else
    %  \RequirePackage[T1]{fontenc}
    %  \RequirePackage[dvips]{graphicx}
    %  \RequirePackage[dvips]{geometry}
    %\fi

    % dimensoes das paginas
    %\geometry{a4paper,left=3cm,right=2cm,top=3cm,bottom=2cm,verbose,headheight=0.56cm, headsep=0.5cm,footskip=3em}

    \newif\ifhyperref
    \@ifpackageloaded{hyperref}{\hyperreftrue}{\hyperreffalse}

    %==============================================================================
    %%% ABNTeX ...
%    \RequirePackage[num,abnt-emphasize=bf,abnt-etal-list=0,abnt-etal-text=it]{abntcite}
    %==============================================================================

    %==============================================================================
    % Redefinição da data (para ter mês e ano separados)
    %==============================================================================
    \renewcommand{\date}[2]{
            \gdef\@publmonth{#1}
            \gdef\@publyear{#2}
    }
    \date{\monthname}{\number\year}

    %==============================================================================
    %%% Novos comandos: \author, \authoraddress, \advisor, \coadvisor,
    %%% \boss, etc ...  ;-)
    %==============================================================================
    % Autor...
    \renewcommand{\author}[2]{%               % Nome, Sobrenome
      \gdef\@authorfirst{#1}
      \gdef\@authorlast{#2}
    }
    % Endereco do Autor (utilizado no verso da folha de rosto
    \renewcommand{\itaauthoraddress}[3]{%
      \gdef\@itaauthoraddress{#1}
      \gdef\@itaauthorcep{#2}
      \gdef\@itaauthorcity{#3}
    }
    % Orientador...
    \newcommand{\advisor}[3][\itaadvisorwordbabel]{     % [word] ,title, name
      \renewcommand{\itaadvisorname}{#3}
      \renewcommand{\itaadvisortitle}{#2}
      \renewcommand{\itaadvisorword}{#1}
      \gdef\@advisor{#2~#3 \\ #1}
      \gdef\itaadvisorwordbabelll{#1}
    }
    % Co-orientador...  (opcional)
    \newcommand{\coadvisor}[4][\itacoadvisorwordbabel]{%
      \gdef\@itacoadvisorname{#3}
      \gdef\@itacoadvisortitle{#2}
      \gdef\@itacoadvisorinst{#4}
      \gdef\@coadvisor{#2~#3 \\ #1}
      \gdef\itacoadvisorwordbabelll{#1}
    }
    % Chefe da Divisao de Pos-Graduacao...
    \newcommand{\boss}[3][\itabosswordbabel]{      %[word] ,title, name
      \renewcommand{\itabossname}{#3}
      \renewcommand{\itabosstitle}{#2}
      \renewcommand{\itabossword}{#1}
      \gdef\@boss {#2~#3 \\ #1}
    }
    % Curso de Pos-Graduacao...
    \newcommand{\course}[1]{
      \renewcommand{\itaworkcourse}{#1}
    }
    % Divisao...
    \newcommand{\dept}[1]{
      \renewcommand{\itaworkdept}{#1}
    }
    % Area do Curso...
    \newcommand{\area}[1]{
      \renewcommand{\itaworkarea}{#1}
    }

    %==============================================================================
    %%% Hack: Pagina de Rosto para Teses
    %==============================================================================
    \newcommand{\itatitletext}{\itatitletextbabel}

    \renewcommand{\maketitle}{%
       \begin{titlepage}
          \pdfbookmark[0]{\nametitlepage}{titulo}
          % verifica se eh uma tese ou um exame de qualificacao
          \ifthenelse{\equal{\itaoptionlevel}{quali}}
                  {\thequalititlepage }
                  {\thethesistitlepage }
       \end{titlepage}

       \ifthenelse{\equal{\itaoptionlevel}{quali}}
                  {\setcounter{page}{2}}
                  {\setcounter{page}{4}}
    }

    %==============================================================================
    % Capa do Exame de Qualificacao para Doutorado
    %==============================================================================
    \newcommand{\thequalititlepage}{%

       \noindent
       \center
       \begin{spacing}{1.5}
          {\Large \itanametitlequalibabel } \\        %  ITA -- \textsc{Instituto Tecnológico de Aeronáutica}} \\
          {\Large \itaposnametitlequalibabel } \\     %  \textsc{Pós-Graduação em \itaworkcourse}} \\
          {\large \itaarenametitlequalibabel }        %  \textsc{Área de \itaworkarea}}
        \end{spacing}

        \vfill

       \begin{spacing}{1.2}
       \itaformatworktitle{\MakeUppercase{\@title}}
       \end{spacing}

       \vfill

       por\\
       \itaformatauthorname{\@authorfirst\ \@authorlast}

       \vfill

       \normalsize
       \hspace{\fill}
       \parbox[b]{8.5cm}{\itaqualifictext}%

       \vfill

       \begin{spacing}{1.5}
           \@advisor
       \end{spacing}

       \@ifundefined{@coadvisor}{}{      % Co-advisor eh opcional
            \vfill
            \@coadvisor
       }

       \vfill

       \begin{spacing}{1.5}
       S\~{a}o Jos\'{e} dos Campos, \@publmonth\ de \@publyear
       \end{spacing}
    }

    %==============================================================================
    % Capa das Teses de Mestrado e Doutorado
    %==============================================================================
    \newcommand{\thethesistitlepage}{%

       \noindent

       \begin{spacing}{1.2}
       \noindent \parbox[c]{\textwidth}{\itaformattitletext{\itatitletext}}
       \end{spacing}

       \vspace*{\stretch{2}}

       \center

       \itaformatauthorname{\@authorfirst\ \@authorlast}
       \vfill

       \vspace*{\stretch{1}}

       \begin{spacing}{1.2}
       \itaformatworktitle{\MakeUppercase{\@title}}
       \end{spacing}

       \vspace*{\stretch{2}}

       \normalsize
       \itathesisapprovedmembersbabel

       \vspace*{\stretch{3}}

       \begin{spacing}{1.5}
           \@advisor
       \end{spacing}

    %    \@ifundefined{@coadvisor}{}{      % Co-advisor eh opcional
    %         \vspace*{\stretch{2}}
    %         \@coadvisor
    %   }

       \@ifundefined{@coadvisor}{}{      % Co-advisor eh opcional
            \vspace*{\stretch{2}}
            \begin{spacing}{1.5}
            \@coadvisor
       \end{spacing}
      }



       \vspace*{\stretch{2}}

       \begin{spacing}{1.5}
           \@boss
       \end{spacing}

       \vspace*{\stretch{2}}

       \begin{spacing}{1.5}
       Campo Montenegro \\ S\~{a}o Jos\'{e} dos Campos, SP - \itacountrybabel \\ \@publyear
       \end{spacing}

       \@makecippage        % funcao para criar verso da folha de rosto
       \@listexaminators    % funcao para criar pagina de membros da banca
    }

    %==============================================================================
    % CIP ... Verso da Folha de Rosto
    %==============================================================================
    \newcommand{\@makecippage}{%
       \newpage%
      \pdfbookmark[0]{\namecip}{cip}
       \thispagestyle{empty}
       \begin{flushleft}
          \begin{footnotesize}
          {\setlength{\baselineskip}{0.8\baselineskip}
            \textbf{\itaciptitlebabel} \\
            \textbf{\itacipbibbabel}\\}
          \end{footnotesize}
          \@cipwindow
          \@bibref
          \@rights
            \end{flushleft}
            \vfill

    }
    % definição do quadro
    \def\@cipwindow{%
            \framebox[\textwidth]{%
            \begin{minipage}{\textwidth - 10mm}%
          \begin{flushleft}
             \vspace*{0.4ex}
                    \setlength{\parindent}{0.5em}%
          \begin{footnotesize}
              \setlength{\baselineskip}{0.7\baselineskip}
              \noindent\@authorlast, \@authorfirst\par
                        \@title\ / \@authorfirst\ \@authorlast.\\
                        \noindent São José dos Campos, \@publyear.\par
                        \NumPenultimaPagina f.\par
              \vspace{\baselineskip}
              \itacipdata1babel
                        \vspace{0.4ex}
                       \end{footnotesize}
          \end{flushleft}
            \end{minipage}%
            }%
    }

    % Referencia Bibliografica
    \def\@bibref{%
           \vspace*{\stretch{2}}
           \normalsize
              \textbf{\itarefbibnamecipbabel} \par

              {\setlength{\baselineskip}{0.7\baselineskip}
              \MakeUppercase{\@authorlast}, \@authorfirst. \textbf{\@title}. \@publyear.                     \NumPenultimaPagina f. \itacip2babel \\}
    }
    % Cessao de Direitos
    \def\@rights{%
           \vspace*{\stretch{4}}
           {\normalsize\textbf{\itacedirnamebabel}} \par
           {\setlength{\baselineskip}{0.7\baselineskip}
           {\footnotesize \itacipauthorname} {\normalsize \@authorfirst\ \@authorlast} \\
           {\footnotesize \itacipworktitlebabel} {\normalsize \@title.} \\
           {\footnotesize \itacipworktype} {\normalsize \itaworklevel\ / \@publyear} \\ }

           \vspace{\baselineskip}

           \parbox[c]{\textwidth}{\normalsize\setlength{\baselineskip}{0.7\baselineskip}\itacesdirtextbabel \\}

           \vspace*{\stretch{2}}
           \rule{75mm}{0.2mm}\\
           {\normalsize\setlength{\baselineskip}{0.7\baselineskip}
               \@authorfirst\ \@authorlast\\
          \@itaauthoraddress\\
          CEP \@itaauthorcep\ -- \@itaauthorcity\\}
    }

    %==============================================================================
    %%% Banca Examinadora...
    %==============================================================================
    \newcommand{\@listexaminators}
    {
       \newpage
       \pdfbookmark[0]{\namepageexaminersbookmark}{aprovacao}
       \thispagestyle{empty}

       \noindent
       \begin{spacing}{1.2}
           \begin{center}
             \itaformatworktitle{\MakeUppercase{\@title}}
             \vfill
             \itaformatauthorname{\@authorfirst\ \@authorlast}
             \vfill
           \end{center}
           \raggedright{\normalsize{\namepageexaminers}}
           \vfill
        \end{spacing}
            \raggedright\@memberslist
         \vfill
         \center
             \large\textbf{ITA}

    }

    %==============================================================================
    %%% Dedicatória...
    %==============================================================================
    \newenvironment{itadedication}
    {\thispagestyle{empty}%
      \pdfbookmark[0]{\namededicatory}{dedication}
      \begin{flushright}%
      \null\vfil \@beginparpenalty\@lowpenalty
      \vspace{120mm}
      \hspace{80mm}
      \begin{minipage}[b]{0.35\textwidth}\begin{spacing}{1.5}}
    {\end{spacing}\end{minipage}\end{flushright}\par\vfil\null\newpage}

    %==============================================================================
    %%% Agradecimentos...
    %==============================================================================
    \newenvironment{itathanks}[1][\nameacknowledgment]
    {
    \chapter*{#1}
    \pdfbookmark[0]{\nameacknowledgment}{acknowledgment}
    \begin{flushright}\begin{spacing}{1.5}}
    {\end{spacing}\end{flushright} \par\vfil\null\newpage}

    %==============================================================================
    %%% Resumo ...
    %==============================================================================
    \newenvironment{abstract}
    {\chapter*{\nameabstract}
    \pdfbookmark[0]{\nameabstract}{resumo}
    \begin{spacing}{2}}
    {\end{spacing} }

    %==============================================================================
    %%% Abstract ...
    %==============================================================================
    \newenvironment{englishabstract}
    {\chapter*{\nameengabstract}
    \pdfbookmark[0]{\nameengabstract}{abstract}
    \it \begin{spacing}{2}} %abstract em italico ativado
    { \end{spacing} }

    %==============================================================================
    %%% Redefinicao de chapter
    %==============================================================================
    \renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                        \thispagestyle{empty}%
                        \global\@topnum\z@
                        \@afterindenttrue
                        \secdef\@chapter\@schapter}
    % Redefinicao do espaco entre paragrafos
    \setlength{\parskip}{.5em}

    %==============================================================================
    %%% Hack: Adicionando Bibliografia, Lista de Figuras, Lista de Tabelas,
    %%% Lista de Simbolos e Lista de Abreviaturas ao Sumario
    %==============================================================================
    % Bibliografia
    \renewenvironment{thebibliography}[1]
         {\chapter*{\bibname
          \refstepcounter{chapter}
          \addcontentsline{toc}{chapter}{\bibname}   % Thanks to D.Farfan
          \@mkboth{\MakeUppercase{\bibname}}%
                  {\MakeUppercase{\bibname}}}%       % Thanks to ffs :-)
          \list{\@biblabel{\@arabic\c@enumiv}}%
               {\settowidth\labelwidth{\@biblabel{#1}}%
                \leftmargin\labelwidth
                \advance\leftmargin\labelsep
                \@openbib@code
                \usecounter{enumiv}%
                \let\p@enumiv\@empty
                \renewcommand\theenumiv{\@arabic\c@enumiv}}%
          \sloppy
          \clubpenalty4000
          \@clubpenalty \clubpenalty
          \widowpenalty4000%
          \sfcode`\.\@m
    }
         {\def\@noitemerr
           {\@latex@warning{Empty `thebibliography' environment}}%
          \endlist}

    % Lista de figuras...
    \renewcommand\listoffigures{%
        \begin{spacing}{1.5}   %ita
        \if@twocolumn
          \@restonecoltrue\onecolumn
        \else
          \@restonecolfalse
        \fi
        \chapter*{\listfigurename
          \@mkboth{\MakeUppercase{\listfigurename}}%
                  {\MakeUppercase{\listfigurename}}}      % Thanks to Reinaldo Fortes
        \addcontentsline{toc}{chapter}{\listfigurename}   % Thanks to D.Farfan
        \@starttoc{lof}%
        \if@restonecol\twocolumn\fi
        \end{spacing}   %ita
        }

    % Lista de tabelas...
    \renewcommand\listoftables{%
        \begin{spacing}{1.5}   %ita
        \if@twocolumn
          \@restonecoltrue\onecolumn
        \else
          \@restonecolfalse
        \fi
        \chapter*{\listtablename
          \@mkboth{\MakeUppercase{\listtablename}}%
                   {\MakeUppercase{\listtablename}}}     % Thanks to Reinaldo Fortes
        \addcontentsline{toc}{chapter}{\listtablename}   % Thanks do D.Farfan
        \@starttoc{lot}%
        \if@restonecol\twocolumn\fi
        \end{spacing}   %ita
        }

    % Redefinicao do Sumário...
    \renewcommand\tableofcontents{%
        \begin{spacing}{1.5}   %ita
        \if@twocolumn
          \@restonecoltrue\onecolumn
        \else
          \@restonecolfalse
        \fi
        \chapter*{\contentsname
            \pdfbookmark[0]{\namecontents}{contents}
            \@mkboth{\MakeUppercase{\contentsname}}%
                     {\MakeUppercase{\contentsname}}}       % Thanks to Reinaldo Fortes
         \@starttoc{toc}%
        \if@restonecol\twocolumn\fi
        \end{spacing}   %ita
        }

    % Lista de Símbolos...
    \newcommand\listofsymbols{%
        \begin{spacing}{1.5}   %ita
        \if@twocolumn
          \@restonecoltrue\onecolumn
        \else
          \@restonecolfalse
        \fi
        \chapter*{\listofsymbolsname
          \@mkboth{\MakeUppercase{\listofsymbolsname}}%
                  {\MakeUppercase{\listofsymbolsname}}}%         Thanks to Reinaldo Fortes
        \addcontentsline{toc}{chapter}{\listofsymbolsname}%      Thanks to ffs  :-)
        \@starttoc{lof}%
        \if@restonecol\twocolumn\fi
        \end{spacing}   %ita
        }

    % Lista de Abreviaturas...
    \newcommand\listofabbreviations{%
        \begin{spacing}{1.5}   %ita
        \if@twocolumn
          \@restonecoltrue\onecolumn
        \else
          \@restonecolfalse
        \fi
        \chapter*{{\listofabbreviationsname}
          \@mkboth{\MakeUppercase{\listofabbreviationsname}}%       Thanks to Reinaldo Fortes
                  {\MakeUppercase{\listofabbreviationsname}}}%
         \addcontentsline{toc}{chapter}{\listofabbreviationsname}%  Thanks to ffs  :-)
        \@starttoc{lof}%
        \if@restonecol\twocolumn\fi
        \end{spacing}   %ita
        }


    % Thanks to Dr. Alan Wilter Sousa da Silva - alan@lncc.br
    \renewcommand{\addcontentsline}[3]{%
      \begingroup
        \let\label\@gobble
        \let\textlatin\@firstofone
        \ifx\@currentHref\@empty
          \Hy@Warning{%
            No destination for bookmark of \string\addcontentsline,%
            \MessageBreak destination is added%
          }%
          \phantomsection
        \fi
        \expandafter\ifx\csname toclevel@#2\endcsname\relax
          \begingroup
            \def\Hy@tempa{#1}%
            \ifx\Hy@tempa\Hy@bookmarkstype
              \Hy@WarningNoLine{bookmark level for unknown #2 defaults to 0}%
            \else
              \Hy@Info{bookmark level for unknown #2 defaults to 0}%
            \fi
          \endgroup
          \expandafter\gdef\csname toclevel@#2\endcsname{0}%
        \fi
        \edef\Hy@toclevel{\csname toclevel@#2\endcsname}%
        \Hy@writebookmark{\csname the#2\endcsname}%
          {#3}%
          {\@currentHref}%
          {\Hy@toclevel}%
          {#1}%
        \ifHy@verbose
          \typeout{pdftex: bookmark at \the\inputlineno:
            {\csname the#2\endcsname}
            {#3}
            {\@currentHref}%
            {\Hy@toclevel}%
            {#1}%
          }%
        \fi
        \addtocontents{#1}{%
          \protect\contentsline{#2}{#3}{\thepage}{\@currentHref}%
        }%
      \endgroup
    }

    %==============================================================================
    %%% Cabecalhos e Rodapés
    %==============================================================================
    \pagestyle{fancy}
    \lhead{\leftmark}
    \chead{}
    \rhead{\thepage}
    \lfoot{}\cfoot{}\rfoot{}
    \renewcommand{\headrulewidth}{0.5pt}
    \renewcommand{\footrulewidth}{0pt}
    % Imprimir rodape com versao preliminar?
      \if@dv
         \rfoot{\emph{\itadvnamebabel\ \today }}
      \fi

    %==============================================================================
    %%% Membros da banca examinadora
    %==============================================================================
    \newcounter{mecounter}
    \newcommand{\examiner}[4]{
            \addtocounter{mecounter}{1}
            \expandafter\gdef\csname metitle\alph{mecounter}\endcsname{#1}
            \expandafter\gdef\csname mename\alph{mecounter}\endcsname{#2}
            \expandafter\gdef\csname merole\alph{mecounter}\endcsname{#3}
            \expandafter\gdef\csname meinst\alph{mecounter}\endcsname{#4}
    }

    \newcommand{\@memberslist}{%
       \begin{tabular}{l l l l}
          \@ifundefined{metitlea}{}    {\metitlea\@         & \menamea\@       & \hspace{1cm} \merolea\@ & - \hspace{0.5cm} \meinsta\@ } \\
                                     \itaadvisortitle   & \itaadvisorname  & \hspace{1cm} \itaadvisorwordbabelll\ & - \hspace{0.5cm} ITA       

          \@ifundefined{@coadvisor}{}  {\\ \@itacoadvisortitle   & \@itacoadvisorname  & \hspace{1cm} \itacoadvisorwordbabelll & - \hspace{0.5cm} \@itacoadvisorinst }
          \@ifundefined{metitleb}{}    {\\ \metitleb\@ & \menameb\@ & \hspace{1cm} \meroleb\@ & - \hspace{0.5cm} \meinstb\@ } \\
          \@ifundefined{metitlec}{}    {\metitlec\@ & \menamec\@ & \hspace{1cm} \merolec\@ & - \hspace{0.5cm} \meinstc\@ } \\
          \@ifundefined{metitled}{}    {\metitled\@ & \menamed\@ & \hspace{1cm} \meroled\@ & - \hspace{0.5cm} \meinstd\@ } \\
          \@ifundefined{metitlee}{}    {\metitlee\@ & \menamee\@ & \hspace{1cm} \merolee\@ & - \hspace{0.5cm} \meinste\@ } \\
          \@ifundefined{metitlef}{}    {\metitlef\@ & \menamef\@ & \hspace{1cm} \merolef\@ & - \hspace{0.5cm} \meinstf\@ } \\
          \@ifundefined{metitleg}{}    {\metitleg\@ & \menameg\@ & \hspace{1cm} \meroleg\@ & - \hspace{0.5cm} \meinstg\@ } \\
          \@ifundefined{metitleh}{}    {\metitleh\@ & \menameh\@ & \hspace{1cm} \meroleh\@ & - \hspace{0.5cm} \meinsth\@ }
            \end{tabular}
    }

    %==============================================================================
    %%% Palavras-chave
    %==============================================================================
    \newcommand{\keywords}[1]{%
        \vfill \noindent\textbf{Palavras--Chave:} #1%
    }

    %==============================================================================
    %%% Keywords
    %==============================================================================
    \newcommand{\englishkeywords}[1]{%
        \vfill \noindent\textbf{Keywords:} #1
    }

    %==============================================================================
    % Definição das palavras-chave para CIP (informado pela Biblioteca)
    %==============================================================================
    \newcounter{kwcipcounter}
    \newcommand{\kwcip}[1]{
            \addtocounter{kwcipcounter}{1}
            \expandafter\gdef\csname kwcip\alph{kwcipcounter}\endcsname{#1}
    }
    \newcommand{\@cipkw}{%
            \@ifundefined{kwcipa}{}{1.~\expandafter\MakeUppercase\kwcipa\@. }%
            \@ifundefined{kwcipb}{}{2.~\expandafter\MakeUppercase\kwcipb\@. }%
            \@ifundefined{kwcipc}{}{3.~\expandafter\MakeUppercase\kwcipc\@. }%
            \@ifundefined{kwcipd}{}{4.~\expandafter\MakeUppercase\kwcipd\@. }%
            \@ifundefined{kwcipe}{}{5.~\expandafter\MakeUppercase\kwcipe\@. }%
            \@ifundefined{kwcipf}{}{6.~\expandafter\MakeUppercase\kwcipf\@. }%
            \@ifundefined{kwcipg}{}{7.~\expandafter\MakeUppercase\kwcipg\@. }%
            \@ifundefined{kwciph}{}{8.~\expandafter\MakeUppercase\kwciph\@. }%
            \@ifundefined{kwcipi}{}{9.~\expandafter\MakeUppercase\kwcipi\@. }%
            \@ifundefined{kwcipj}{}{10.~\expandafter\MakeUppercase\kwcipj\@. }%
    }

    %==============================================================================
    %%% Hack: Centralizando \chapter*
    %%% \@makeschapterhead é chamado por \chapter*
    %==============================================================================
    \def\@makeschapterhead#1{%
      \vspace*{50\p@}%
      {\parindent \z@ \centering
        \normalfont
        \interlinepenalty\@M
        \Huge \bfseries  #1\par\nobreak
        \vskip 40\p@
      }}

    %==============================================================================
    %%% Redefinicao do comando \appendix para mostrar 'Apêndice' ou 'Anexo'
    %%% no Sumario
    %==============================================================================
    \renewcommand{\appendix}{%
      \cleardoublepage
      \providecommand\anexoautorefname{appendix}
       \setcounter{chapter}{0}%
       \setcounter{section}{0}%
       \def\Hy@appendixstring{appendix}% %%novo string no *.toc, para fazer o hyperlink funcionar
       \def\anexo{%
      \@ifundefined{chapter}%
        {\gdef\theHsection{\Alph{section}}}%
        {\gdef\theHchapter{\Alph{chapter}}}%
      \xdef\Hy@chapapp{\Hy@appendixstring}%

      \gdef\@chapapp{\appendixname}%
      \addtocontents{toc}{\SetAppendixTocName{\appendixname}}%
      \gdef\thechapter{\@Alph\c@chapter}%
      }
      \anexo
    }

    %==============================================================================
    %%% Acrescenta o comando SetappendixTocName ao toc
    %==============================================================================
    \DeclareRobustCommand{\SetAppendixTocName}[1]{\gdef\AppendixTocName{#1}}

    %==============================================================================
    %%% Novo comando: \annex
    %==============================================================================
    \newcommand{\annex}{%
      \cleardoublepage
      \providecommand\anexoautorefname{annex}
       \setcounter{chapter}{0}%
       \setcounter{section}{0}%
       \def\Hy@appendixstring{annex}% %%novo string no *.toc, para fazer o hyperlink funcionar
       \def\anexo{%
      \@ifundefined{chapter}%
        {\gdef\theHsection{\alph{section}}}%
        {\gdef\theHchapter{\alph{chapter}}}%
      \xdef\Hy@chapapp{\Hy@appendixstring}%

      \gdef\@chapapp{\nameannex}%
      \addtocontents{toc}{\SetAppendixTocName{\nameannex}}%
      \gdef\thechapter{\@Alph\c@chapter}%
      }
      \anexo
    }


    %==============================================================================
    %%% Redefinicao de mainmatter para numeracao continua de paginas
    %==============================================================================
    \renewcommand\mainmatter{%
      \cleardoublepage
      \@mainmattertrue
      \renewcommand{\thepage}{\arabic{page}} }

    %==============================================================================
    %%% 'Desligar' hifenacao...
    %==============================================================================
    \newlanguage\nohyphen
    \newcommand\nh[1]{{\language\nohyphen #1}}

    %==============================================================================
    %%% Redefinicao de l@chapter, l@section e l@subsection para acrescentar
    %%% a palavra 'Anexo' ou 'Apendice' no toc e ajustar identacao para
    %%% "nada identado" ... :-)
    %==============================================================================
    \renewcommand*\l@chapter[2]{%
      \ifnum \c@tocdepth >\m@ne
        \addpenalty{-\@highpenalty}%
        \vskip -3ex \@plus\p@
        \setlength\@tempdima{1.5em}%
        \begingroup
        \ifx\AppendixTocName\undefined\else
           \renewcommand{\numberline}[1]{\AppendixTocName~##1~~--~~}%
        \fi
          \parindent \z@ \rightskip \@pnumwidth
          \parfillskip -\@pnumwidth
          \leavevmode \bfseries
          \advance\leftskip\@tempdima
          \hskip -\leftskip
          \@dottedtocline{0}{0em}{1.8em}{\normalfont\scshape\large{#1}}{#2}
          \penalty\@highpenalty
        \endgroup
      \fi}

    % l@section
    \renewcommand*{\l@section}[2]{%
    \@dottedtocline{1}{0em}{2.8em}{\textbf{#1}}{\hss #2}}

    % l@subsection
    \renewcommand*{\l@subsection}{\@dottedtocline{2}{0em}{3.7em}}

    %==============================================================================
    %%% Numerar o subsubsection conforme definido anteriormente
    %==============================================================================
    \setcounter{secnumdepth}{4}

    %==============================================================================
    %%% Glossario
    %==============================================================================
    \newcommand{\itaglossary}{
    \cleardoublepage
    \thispagestyle{empty}%
    \@mkboth{\MakeUppercase{\itaglossarynamebabel}}%
            {\MakeUppercase{\itaglossarynamebabel}}%
    \gdef\glossaryname{\itaglossarynamebabel}
    \refstepcounter{chapter}
    }

    %==============================================================================
    % %%% Centralizar e ajustar os espacamentos dos captions das figuras e tabelas
    %==============================================================================
    \def\fnum@figure{\centering\MakeUppercase{\figurename}\nobreakspace\thefigure}
    \def\fnum@table{\centering\MakeUppercase{\tablename}\nobreakspace\thetable}
    \setlength\abovecaptionskip{6\p@}
    \setlength\belowcaptionskip{4\p@}

    % Redefinicao do caracter que separa o label Figura ou Tabela do texto
    \renewcommand*\captionlabeldelim{\ --}

    %==============================================================================
    % %%% Indentar a segunda linha de captions longos das listas
    %     de figuras e tabelas
    %==============================================================================
    \renewcommand*{\l@figure}{\@dottedtocline{1}{0cm}{1cm}}
    \def\FigureITA@dottedtocline#1#2#3#4#5{\begingroup
      \def\numberline##1{\hb@xt@\@tempdima{\itafigurenamebabel~##1 --\hfil}}%
      \@dottedtocline{#1}{#2}{#3}{#4}{#5}%
    \endgroup}
    \def\TableITA@dottedtocline#1#2#3#4#5{\begingroup
      \def\numberline##1{\hb@xt@\@tempdima{\itatablenamebabel~##1 --\hfil}}%
      \@dottedtocline{#1}{#2}{#3}{#4}{#5}%
    \endgroup}
    % faz a lista de figuras e de tabelas usarem as novas versoes dos \dottedtocline
    \renewcommand*\l@figure{\FigureITA@dottedtocline{1}{0cm}{2.8cm}}
    \renewcommand*\l@table{\TableITA@dottedtocline{1}{0cm}{2.8cm}}


    %==============================================================================
    % Folha de Registro do Documento
    %==============================================================================
    \newcommand{\esp}{.2cm}

    % Definicoes dos valores dos campos do formulario
    \newcommand{\FRDitadata}[1]{\gdef\FRDitadatababel{#1}}
    \newcommand{\FRDitadocnro}[1]{\gdef\FRDitadocnrobabel{#1}}
    \newcommand{\FRDitaorgaointerno}[1]{\gdef\FRDitaorgaointernobabel{#1}}
    \newcommand{\FRDitapalavrasautor}[1]{\gdef\FRDitapalavrasautorbabel{#1}}
    \newcommand{\FRDitapalavrasresult}[1]{\gdef\FRDitapalavrasresultbabel{#1}}

    \newcommand{\FRDitaresumo}[1]{
        \gdef\FDRitaabstractcontent{#1}
    }


    %  Opcoes para:
    %  Nacional ou Internacional -- N/I
    %  Ostensivo, Reservado, Confidencial ou Secreto -- O/R/C/S
    \newcommand{\FRDitaOpcoes}[2]{
          \gdef\N{\ } \gdef\I{\ }     
          \gdef\O{\ } \gdef\R{\ } \gdef\C{\ } \gdef\S{\ }     
         
          \ifthenelse{\equal{#1}{N}}{\gdef\N{\textbf{X}}}{}
          \ifthenelse{\equal{#1}{I}}{\gdef\I{\textbf{X}}}{}
         
          \ifthenelse{\equal{#2}{O}}{\gdef\O{\textbf{X}}}{}
          \ifthenelse{\equal{#2}{R}}{\gdef\R{\textbf{X}}}{}
          \ifthenelse{\equal{#2}{C}}{\gdef\C{\textbf{X}}}{}
          \ifthenelse{\equal{#2}{S}}{\gdef\S{\textbf{X}}}{}
    }

    % Folha de Registro de Documento
    \newcommand{\itaFRD}{
         
         \if@openright\cleardoublepage\else\clearpage\fi
         
         %Redefinicao das margens ...
       \setlength{\hoffset}{-1in}        % remove padrão do LaTeX
       \setlength{\voffset}{-1in}        % remove padrão do LaTeX
       \setlength{\oddsidemargin}{1cm}   % margem esquerda, páginas ímpares
       \setlength{\evensidemargin}{1cm}  % margem esquerda, páginas pares
       \setlength{\topmargin}{3cm}       % margem superior
       \newlength{\bottommargin}         % margem inferior é deduzida em LaTeX
       \setlength{\bottommargin}{2cm}    % margem inferior
       \setlength{\headheight}{0pt}      % altura do cabeçalho
       \setlength{\headsep}{0pt}         % espaço entre cabeçalho e texto
       \setlength{\footskip}{0mm}        % espaço entre rodapé e texto
       \setlength\textheight{            % altura disponível para texto
          \paperheight-\topmargin-\bottommargin-\headheight-\headsep-\footskip
       }
       % margem direita é deduzida em LaTeX... alterando isso...
       \newlength{\rightmarginn}       
       \setlength{\rightmarginn}{2cm}    % margem direita

       \setlength\textwidth{             % largura disponível para texto
          \paperwidth-\oddsidemargin-\rightmarginn
       }

         \singlespacing
         \footnotesize
         \setlength{\baselineskip}{0.1\baselineskip}
         \setlength{\parskip}{.1em}
         \setlength{\extrarowheight}{2pt}
             
         \lhead{}\rhead{}

         \thispagestyle{empty}
         \pdfbookmark[0]{\itapagedocregbabel}{bla}   
         
         \begin{tabularx}{\textwidth}{|X|X|X|X|}
       \hline
       \multicolumn{ 4}{|c|}{} \\
       \multicolumn{ 4}{|c|}{\normalsize FOLHA DE REGISTRO DO DOCUMENTO} \\
       \multicolumn{ 4}{|c|}{} \\
       \hline
       
       $^{1.}$ \scriptsize CLASSIFICAÇÃO/TIPO &
       $^{2.}$ \scriptsize DATA               &
       $^{3.}$ \scriptsize DOCUMENTO Nº       &
       $^{4.}$ \scriptsize Nº DE PÁGINAS             \tabularnewline
       
       \centering{\ifthenelse{\equal{\itaoptionlevel}{msc}}{TM}{TD}}  &
       \centering{\FRDitadatababel}   &
       \centering\scriptsize \FRDitadocnrobabel  & 
       \centering\NumPenultimaPagina                  \tabularnewline[\esp]
       \hline
       
       \multicolumn{ 4}{|p{17cm}|}{$^{5.}$ \scriptsize TÍTULO E SUBTÍTULO:} \\
       \multicolumn{ 4}{|l|}{\nh{\parbox[b]{.95\textwidth}{\@title}}} \\[\esp]
       \hline
       \multicolumn{ 4}{|l|}{$^{6.}$ \scriptsize AUTOR(ES):} \\
       \multicolumn{ 4}{|l|}{\textbf{\@authorfirst\ \@authorlast}} \\[\esp]
       \hline
       \multicolumn{ 4}{|l|}{$^{7.}$ \scriptsize INSTITUIÇÃO(ÕES)/ÓRGÃO(S)
           INTERNO(S)/DIVISÃO(ÕES):} \\
       \multicolumn{ 4}{|l|}{Instituto Tecnológico de Aeronáutica. \FRDitaorgaointernobabel} \\[\esp]
       \hline
       \multicolumn{ 4}{|l|}{$^{8.}$ \scriptsize PALAVRAS-CHAVE SUGERIDAS PELO AUTOR:} \\
       \multicolumn{ 4}{|p{17cm}|}{\FRDitapalavrasautorbabel} \\[\esp]
       \hline
       \multicolumn{ 4}{|l|}{$^{9.}$ \scriptsize PALAVRAS-CHAVE RESULTANTES DE INDEXAÇÃO:} \\
       \multicolumn{ 4}{|p{17cm}|}{\FRDitapalavrasresultbabel} \\[\esp]
       \hline
       \multicolumn{ 4}{|l|}{$^{10.}$ {\scriptsize APRESENTAÇÃO:}  \hfill
          (\N) \textbf{Nacional} \ \ \
          (\I) \textbf{Internacional} } \\
       \multicolumn{ 4}{|l|}{ITA, São José dos Campos, \@publyear, \NumPenultimaPagina\ páginas} \\[\esp]
       \hline
       \multicolumn{ 4}{|l|}{$^{11.}$ \scriptsize RESUMO:} \\
       \multicolumn{ 4}{|c|}{\parbox[t][12cm]{.95\textwidth}{\FDRitaabstractcontent}} \\[\esp]
       \hline
       \multicolumn{ 4}{|l|}{$^{12.}$ \scriptsize GRAU DE SIGILO:} \\
       \multicolumn{ 4}{| l|}{(\O) \textbf{OSTENSIVO} \hfill
                    (\R) \textbf{RESERVADO} \hfill
                    (\C) \textbf{CONFIDENCIAL} \hfill
                    (\S) \textbf{SECRETO}} \\[\esp]
       \hline
         \end{tabularx} 
         
    }


    %==============================================================================
    %%% Hack: Retirando a palavra Capitulo mas mantendo Anexo e Apendice...
    %%% \@makechapterhead é chamado por \chapter
    %==============================================================================
    \def\@makechapterhead#1{%
      \vspace*{50\p@}%
      {\parindent \z@ \raggedright \normalfont
        \ifnum \c@secnumdepth >\m@ne
          \if@mainmatter
              % se "anexo" nao foi definido, altera cabecalho do capitulo..
         % senao, mantem a palavra Anexo ou Apendice
              \@ifundefined{anexo}     
          {\huge\bfseries \thechapter\space}
          {\huge\bfseries \@chapapp\space \thechapter \space -}
          \fi
        \fi
        \interlinepenalty\@M
        \Huge \bfseries #1\par\nobreak
        \vskip 40\p@
      }}
     
     
    %==============================================================================
    %%% Obtendo o numero da penultima pagina, visto que a FRD nao é contada ...
    %%% Thanks to Dr. Miguel V. S. Frasson!! :-)
    %==============================================================================
    \def\deixasosegundo#1#2#3!{#2}
    \makeatletter
    \AtBeginDocument{%
      % se a referencia a ultima pagina nao existe, definir como ??
      \expandafter\ifx\csname r@LastPage\endcsname\relax
        \newcommand\NumPenultimaPagina{{\bfseries??}}%
      \else
        \newcounter{butlastpage}%
        \setcounter{butlastpage}{\expandafter\deixasosegundo\r@LastPage!}%
        \addtocounter{butlastpage}{-1}%
        \newcommand\NumPenultimaPagina{}%
        \edef\NumPenultimaPagina{\arabic{butlastpage}}%
      \fi}

I hope that helps. I'd ask at that mailing list if you had more questions, or needed a different approach.
renefks
Posts: 5
Joined: Tue Jan 11, 2011 2:45 pm

Re: Multiple references in bibtex

Post by renefks »

Thank You very much! it works fine now! But there is still one thing. The Journal name is italic but it must be bold text. I will start to google it now. Thanks
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Multiple references in bibtex

Post by frabjous »

Here's my best guess at how to do this.

First make a back-up of the file abnt-num.bst. Now edit it. You need to change line 2068 from.

Code: Select all

"\emph" 'abnt.emphasize :=
to

Code: Select all

"\textbf" 'abnt.emphasize :=
renefks
Posts: 5
Joined: Tue Jan 11, 2011 2:45 pm

Re: Multiple references in bibtex

Post by renefks »

Thank You very much! it works 100%!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Multiple references in bibtex

Post by localghost »

renefks wrote:Thank You very much! it works 100%!
Then please mark the topic accordingly as written in Section 3 of the Board Rules (to be read before posting).


Thorsten
Post Reply