Skip to content

Commit

Permalink
more citation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
homberghp committed May 8, 2024
1 parent 56610c3 commit 92677a7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 42 deletions.
39 changes: 36 additions & 3 deletions chapters/ch08_citingsimple.tex
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,41 @@ \section{What style to choose}
}
\end{lstlisting}

With these addition, and the biblatex configuration in \vref{snip:bibconfig}, you get the more pleasing bibliography in \vref{fig:fontysharvard}
which hase back references as an additional bonus. These will not work in the image above, but do work with this \textcite{latexcompanion} citation.

A screenshot (still ugly, but useful for once) in \vref{fig:activecitation} shows what that looks like in the pdf-viewer \textbf{evince} on a ubuntu box.

\begin{lstlisting}[language=TeX,caption={\label{snip:bibconfig}Using \texttt{shorthand} for label and \texttt{sortname}for sorting}]
%% citation and bibliography style.
%% This style depends on 'sortname' and 'shorthand' fields in the bib file.
%% This gives you control on what is shown in the labels.
%% If you ommit the shorthand, the styles fall back to a numeric label
\usepackage[
backend=biber,
hyperref=true,
backref=true,
]{biblatex}
\DefineBibliographyStrings{english}{
backrefpage={cited on p.},
backrefpages={cited on pp.}
}
% end citation bibliography style.
\end{lstlisting}

\begin{figure}
\shadowbox{\parbox{\linewidth}{
\centering \includegraphics{images/fontysharvard.pdf}}}
\caption{\label{fig:fontysharvard}Labels same as with the citations.}
\end{figure}


\begin{figure}
\centering \includegraphics[width=\linewidth]{images/activecitation.png}
\caption{\label{fig:activecitation}Citations called out when pointed to in evince.}
\end{figure}

As most \LaTeX\ documentation, with a complete installation you can use the command \texttt{texdoc biblatex} to be presented with the
documentaton of \textbf{biblatex} in this example in the default pdf viewer.

As most documentation, with a complete installation, you may want to
use the command \texttt{texdoc biblatex} to be presented with the
documentaton of \textbf{biblatex} in this case in the default pdf viewer.

Binary file added images/activecitation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/fontysharvard.pdf
Binary file not shown.
40 changes: 1 addition & 39 deletions simplest.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,18 @@
\usepackage[colorlinks=true, citecolor=blue]{hyperref}

\usepackage[
%style=authoryear,
backend=biber,
hyperref=true,
backref=true,
]{biblatex}

\usepackage{listings}
%\addbibresource{biblatex-examples.bib}
\addbibresource{references.bib}

% here the doc begins
% \DeclareCiteCommand{\cite}
% {\usebibmacro{prenote}}
% {\usebibmacro{citeindex}%
% \printtext[bibhyperref]{\usebibmacro{cite}}}
% {\multicitedelim}
% {\usebibmacro{postnote}}

% \DeclareCiteCommand*{\cite}
% {\usebibmacro{prenote}}
% {\usebibmacro{citeindex}%
% \printtext[bibhyperref]{\usebibmacro{citeyear}}}
% {\multicitedelim}
% {\usebibmacro{postnote}}

% \DeclareCiteCommand{\parencite}
% {\usebibmacro{prenote}}
% {\usebibmacro{citeindex}%
% \printtext[bibhyperref]{[\usebibmacro{cite}]}}
% {\multicitedelim}
% {\usebibmacro{postnote}}

% \makeatletter
% \newrobustcmd*{\parentexttrack}[1]{%
% \begingroup
% \blx@blxinit
% \blx@setsfcodes
% \blx@bibopenparen#1\blx@bibcloseparen
% \endgroup}

% \AtEveryCite{%
% \let\parentext=\parentexttrack%
% \let\bibopenparen=\bibopenbracket%
% \let\bibcloseparen=\bibclosebracket}
% \makeatother
\DefineBibliographyStrings{english}{
backrefpage={cited p.},
% backrefpage={},
backrefpages={cited pp.}
% backrefpages={}
}

\begin{document}
Expand Down Expand Up @@ -101,6 +63,6 @@ \section*{What it looks like}
\item made with {\color{PineGreen}\tt{}\lstinline#Text cite looks like this ``\textcite{texbook}''#}
\end{itemize}
\end{itemize}
\clearpage
\clearpage\pagenumbering{gobble}
\printbibliography
\end{document}

0 comments on commit 92677a7

Please sign in to comment.