Re: Lo stile bibliogafico migliore del mondo

#36047
Up
0
Down
::


Ciao Lorenzo,

mi fa piacere sapere che inserirai nell’Arte un capitolo su biblatex. Come hai detto non esistono stili già pronti per comporre bibliografie come si costuma in Italia (Il supporto per l’italiano è stato curato da un certo Enrico 😉 ). Ma poi, come si costuma in Italia ❓
Ho quasi pronto uno stile bibliografico per citazioni tipo autore-anno e un altro per le classiche citazioni in nota in uso in ambito umanistico, che permettono di gestire le voci di testi con edizione in lingua originale. Appena avranno una forma decente le metto on line da qualche parte…

Nel frattempo ho sistemato alcune cose del mio codice precedente. Ora mi sembra un po’ più razionale. In particolare, è possibile ridefinire le lunghezze \prentry e \pstntry per personalizzare le distanze tra le voci in bibliografia. Ora tutte le voci del file examples.bib appaiono correttamente nella bibliografia. L’unico problema riguarda le voci bibliografiche con curatore che hanno come etichetta per l’anno un intervallo, per esempio
1885-1888 (cur.). In questo caso lo spazio riservato per l’etichetta dell’anno è insufficiente e la stringa (cur.) si sovrappone al titolo. Non sono riuscito a risolvere il problema, quindi per il momento non rimane che abbreviare, per esempio: 1885-88 (cur.), oppure, ovviamente, aumentare la lunghezza \bibhang.

`\documentclass[a4paper]{book}
\usepackage[T1]{fontenc}
\usepackage[german,italian]{babel}
\usepackage[%
style=authoryear,
natbib
]{biblatex}

\bibliography{examples}

\DefineBibliographyStrings{italian}{%
typeeditor = {cur\adddot}
}

\renewcommand{\labelnamepunct}{\unspace}
\renewcommand{\entrysetpunct}{}
%\setlength{\bibitemsep}{}
\setlength{\bibhang}{4\parindent}

\newlength{\prentry}
\newlength{\pstntry}
\setlength{\prentry}{2em plus 2pt minus 1pt}
\setlength{\pstntry}{0.5em plus 2pt minus 1pt}
\newcommand{\presep}{\vskip\prentry \hskip-\bibhang}
\newcommand{\postsep}{\vskip\pstntry \hskip-\bibhang}

% ridefinisco l'ambiente 'thebibliography'
\renewenvironment*{thebibliography}
{\vspace{-\baselineskip} % correzione di \presep
\list
{}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{-\leftmargin}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}}
{\endlist}

% etichetta dell'anno
\renewbibmacro*{year+labelyear}{%
\iffieldundef{year}{}
{\makebox[\bibhang][l]{\printtext{%
\printfield{year}%
\printfield{labelyear}
}}}}

% etichetta dell'anno per voci con 'editor'
\newbibmacro*{edyear+labelyear}{%
\iffieldundef{year}{}
{\makebox[\bibhang][l]{%
\printtext{\printfield{year}\printfield{labelyear}
\setunit{\addspace}
\iffieldundef{label}{\printtext[parens]{\usebibmacro{editorstrg}}}{}
}}}}

% etichietta per voci senza 'editor' e 'author'
\renewbibmacro*{labeltitle}{%
\iffieldundef{label}
{\iffieldundef{shorttitle}
{\printfield{title}%
\clearfield{title}}
{\printfield[title]{shorttitle}}}
{\presep
\parbox{\bibhang}{\printtext{\printfield{label}}}
\postsep
}}

% ridefinisco la macro 'author'
\makeatletter
\renewbibmacro*{author}{%
\ifthenelse{\ifuseauthor\AND\NOT\ifnameundef{author}}
{\ifthenelse{\iffieldequals{fullhash}{\bbx@lasthash}\AND
\NOT\iffirstonpage}
{}
{\savefield{fullhash}{\bbx@lasthash}%
\presep
\printnames{author}
\par\nobreak
\postsep
\iffieldundef{authortype}
{}
{\setunit{\addcomma\space}}}%
\iffieldundef{authortype}
{}
{\usebibmacro{authorstrg}%
\setunit{\addspace}}}%
{\global\undef\bbx@lasthash
\usebibmacro{labeltitle}%
\setunit*{\addspace}
}%
\usebibmacro{year+labelyear}}

% ridefinisco la macro 'editor'
\renewbibmacro*{editor}{%
\ifthenelse{\ifuseeditor\AND\NOT\ifnameundef{editor}}
{\ifthenelse{\iffieldequals{fullhash}{\bbx@lasthash}\AND
\NOT\iffirstonpage}
{}
{\savefield{fullhash}{\bbx@lasthash}%
\presep
\printnames{editor}
\par\nobreak
\postsep
}%
\clearname{editor}%
}%
{\global\undef\bbx@lasthash
\usebibmacro{labeltitle}%
\setunit*{\addspace}}%
\usebibmacro{edyear+labelyear}}
\makeatother

\DeclareBibliographyDriver{set}{\entryset{}{}}
%
\DeclareBibliographyDriver{set}{%
\entryset{}{\postsep}%
\vskip-2\baselineskip
\nopunct\finentry}

\begin{document}

\citep{gaonkar}
\citep{Knuth:ct},
\citet{Knuth:ct:a},
\cite{Knuth:ct:b}.
\cite{cms}.

\nocite{*}

\printbibliography
\end{document}`

Ciao
Ivan

Go to top