
Estou fazendo citações para um relatório de tese com o pacote natbib:
\usepackage[authoryear,sort,round]{natbib}
\bibliographystyle{apa}
As citações devem estar no ano do autor com parênteses no texto e também ordenadas, o que funciona perfeitamente para mim.
O problema é que tenho colunas muito grandes com o ambiente da tabela que contém um grande número de citações. Manter o estilo auhtoryear dentro das tabelas dificulta a organização da largura da tabela com a largura do texto, mesmo se eu estiver usando colunas personalizadas.
%ltxtable configuration
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X} % flush-left, while allowing hyphenation
\newcolumntype{C}{>{\Centering\arraybackslash}X} % centered, while allowing hyphenation
\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1}}
Preciso redefinir o comando cite para ser numerado com colchetes em vez do estilo do autor apenas dentro do ambiente da tabela. Além disso, quero que o colchete fique sobrescrito e já encontrei a solução mas está sempre com o estilo autorano:
\usepackage{letltxmacro}
\LetLtxMacro{\originalcite}{\cite}
\def\tablecite#1#{%
\def\pretablecite{#1}%
\tableciteaux}
\def\tableciteaux#1{%
\textsuperscript{\expandafter\originalcite\pretablecite{#1}}%
}
\AtBeginEnvironment{table}{\let\cite\tablecite}
É assim que meu documento (o código mínimo = necessário) se parece:
\documentclass[12pt,fleqn,a4paper]{book} % Default font size and left-justified equations
\usepackage{etoolbox}
% Bibliography
\usepackage[authoryear,sort,round]{natbib}
\bibliographystyle{apa}%this one order the list of references whereas abbrvnat is the elsevier thing;
\usepackage{afterpage}
\usepackage{capt-of}% or use the larger `caption` package
\usepackage{textcomp} % display ' apostrophe
\usepackage{dirtytalk} % access \say
\usepackage{longtable} %access longtable
\usepackage{lscape} %access landscape
\usepackage{pdflscape} % To rotate the page when using landscape & longtable
\usepackage{multirow} %access multirow
\usepackage{booktabs} %access \toprule & \bottomrule \cmidrule
\usepackage{changepage}%adjustwidth
\usepackage{ragged2e} % access \justify
\usepackage{tabularx,ltxtable}
\usepackage{array}
%ltxtable configuration
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X} % flush-left, while allowing hyphenation
\newcolumntype{C}{>{\Centering\arraybackslash}X} % centered, while allowing hyphenation
\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1}}
%To change the citation in the table environment
\usepackage{letltxmacro}
\LetLtxMacro{\originalcite}{\cite}
\def\tablecite#1#{%
\def\pretablecite{#1}%
\tableciteaux}
\def\tableciteaux#1{%
\textsuperscript{\expandafter\originalcite\pretablecite{#1}}%
}
\AtBeginEnvironment{table}{\let\cite\tablecite}
\begin{document}
\begingroup % restrict scope of reset of \textwidth parameter
\setlength\textwidth\textheight
\setlength\tabcolsep{1.25pt}
\begin{table}
\footnotesize
\renewcommand{\arraystretch}{1}%to keep the consistency and got similar render as longtable
\centering
\begin{tabular}{P{3.5cm}P{6cm}P{10cm}}
\toprule
\textbf{C1} & \textbf{C2} & \textbf{C3}\\
\midrule
DL.1. & C1.1. & reg \cite{cit1,cit2,cit3,cit4}, local \cite{cit1,cit2,cit3,cit4}, urban \cite{cit1,cit2,cit3,cit4}, rural \cite{cit1,cit2,cit3,cit4}\\
\phantom{C1} & C1.2. &pla \cite{cit1,cit2,cit3,cit4}, evaluation \cite{cit1,cit2,cit3,cit4}, frameworks \cite{cit1,cit2,cit3,cit4}\\
\phantom{C1} & C1.3. Envi&env and eco \cite{cit1,cit2,cit3,cit4}, lca \cite{cit1,cit2,cit3,cit4}\\
\phantom{C1} & C1.4. evaluation and assessment&investments \cite{cit1,cit2,cit3,cit4}, assessment ms \cite{cit1,cit2,cit3,cit4}, options \cite{cit1,cit2,cit3,cit4}, alternatives \cite{cit1,cit2,cit3,cit4}, plants \cite{cit1,cit2,cit3,cit4}, scenarios \cite{cit1,cit2,cit3,cit4}, production pathways\cite{cit1,cit2,cit3,cit4}\\
\phantom{C1} & C1.5. Site &projects \cite{cit1,cit2,cit3,cit4}, plants \cite{cit1,cit2,cit3,cit4}, stations \cite{cit1,cit2,cit3,cit4}, farms \cite{cit1,cit2,cit3,cit4}\\
\bottomrule
\end{tabular}
\caption{Caption.}
\label{tab:examples}
\end{table}
\endgroup
\bibliography{bibliography}
\end{document}