Hyperlinking to a bibitem in LaTeX - hyperlink

Here is a minimum working example:
\documentclass{article}
\usepackage{natbib,xspace}
\usepackage[colorlinks,citecolor=blue,linkcolor=blue]{hyperref}
\newcommand{\BOGOS}{\hyperlink{BriEtal18a}{BOGOS}\xspace}
\begin{document}
In this article we reference \cite{BriEtal18a} many times. I want to create the shortcut \BOGOS that will still link to the reference in the bibliography. This does not work yet.
\begin{thebibliography}{}
\bibitem[Briol et~al., 2018]{BriEtal18a}
Briol, F.-X., Oates, C.~J., Griolami, M., Osborne, M.~A., and Sejdinovic, D.
(2018+).
\newblock Probabilistic integration: A role in statistical computation?
\newblock {\em Statist.\ Sci.}
\newblock to appear.
\end{thebibliography}
\end{document}
If one clicks on the hyperlink for the citation it sends you to the reference. If one clicks on my abbreviation, nothing happens. I need to know what the right label is. Can you help?

Since you're using natbib, you can define a citation alias which will be displayed instead of the regular \cite:
\documentclass{article}
\usepackage{natbib}
\usepackage[colorlinks,citecolor=blue,linkcolor=blue]{hyperref}
\defcitealias{BriEtal18a}{BOGOS}% Define a citation alias
\newcommand{\BOGOS}{\citetalias{BriEtal18a}}% Use shorthand
\begin{document}
In this article we reference \citet{BriEtal18a} many times.
I want to create the shortcut \BOGOS{} that will still link to the reference in the bibliography.
\begin{thebibliography}{}
\bibitem[Briol et~al., 2018]{BriEtal18a}
Briol, F.-X., Oates, C.~J., Griolami, M., Osborne, M.~A., and Sejdinovic, D.
(2018+).
\newblock Probabilistic integration: A role in statistical computation?
\newblock {\itshape Statist.\ Sci.}
\newblock to appear.
\end{thebibliography}
\end{document}

Related

Citing mathoverflow answers using \bibitem(without using bibtex)

Is there a way to cite mathoverflow answers using the following :
\begin{thebibliography}
\bibitem ....the mathoverflow citation
\end{thebibliography}
I did the following :
\documentclass[11pt]{amsart}
\setlength{\textheight}{23cm}
\setlength{\textwidth}{16cm}
\setlength{\topmargin}{-0.8cm}
\setlength{\parskip}{0.3\baselineskip}
\hoffset=-1.4cm
\usepackage{pifont}
\usepackage{amsmath,amscd,amssymb}
\usepackage{hyperref}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{conjecture}[subsection]{Conjecture}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{remark}[theorem]{Remark}
\numberwithin{equation}{section}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{corollary}[theorem]{Corollary}
\renewcommand{\thefootnote}{\arabic{footnote}}
\input xy
\xyoption{all}
\begin{document}
some text \cite{MO1}
\begin{thebibliography}{1}
\bibitem{MO1} gowers (\url{https://mathoverflow.net/users/1459/gowers}), Examples of common false beliefs in mathematics, URL (version: 2020-09-03): \url{https://mathoverflow.net/q/23478}
\end{thebibliography}
\end{document}
I know that there are ways to do it using bibtex and creating a separate .bib file. But I was thinking whether we could do it just using \bibitem?
Any help from anyone is welcome.
You could copy the rendered citation from the top of the cite popup:
With some tiny modifications, like wrapping the urls into suitable macros, you can directly use this in your bibliography:
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{thebibliography}{1}
\bibitem{gowers} gowers (\url{https://mathoverflow.net/users/1459/gowers}), Examples of common false beliefs in mathematics, URL (version: 2020-09-03): \url{https://mathoverflow.net/q/23478}
\end{thebibliography}
\end{document}

Print parts of bibliography using BibTeX?

For some days I am trying to solve the following problem for which I wasn't able to find a solution. Help is very much appreciated.
I am writing a long document and for some sections I would like to print a subset of items from the total bibliography that will be included at the very end before the appendix.
Is there a way do this? I was playing with refsection and imagining something like:
\documentclass[ twoside,openright,titlepage,numbers=noenddot,
headinclude,footinclude,
cleardoublepage=empty,abstract=on,
BCOR=5mm,paper=a4,fontsize=11pt
]{scrreprt}
\usepackage{biblatex}
\addbibresource[label=ownpubs]{ownpubs.bib}
\addbibresource[label=refs]{references.bib}
\begin{document}
%here I want to print a selection of the complete bibliography
%References are required to be consistent throughout the whole document
\chapter*{Related Publications}
\begin{refsection}[references.bib]
\nocite{*}
\printbibliography[heading=none]
\end{refsection}
%here goes all the other stuff: chapters, sections, whatever
%print complete bibliography
\nocite{*}
\printbibliography
\end{document}
ownpubs.bib:
#article{einstein1935can,
title={Can quantum-mechanical description of physical reality be considered complete?},
author={Einstein, Albert and Podolsky, Boris and Rosen, Nathan},
journal={Physical review},
volume={47},
number={10},
pages={777},
year={1935},
publisher={APS}
}
#article{einstein1905movement,
title={On the movement of small particles suspended in stationary liquids required by the molecularkinetic theory of heat},
author={Einstein, A},
journal={Ann. d. Phys},
volume={17},
number={549-560},
pages={1},
year={1905}
}
references.bib:
#article{schrodinger1935gegenwartige,
title={Die gegenw{\"a}rtige Situation in der Quantenmechanik},
author={Schr{\"o}dinger, Erwin},
journal={Naturwissenschaften},
volume={23},
number={50},
pages={844--849},
year={1935},
publisher={Springer-Verlag}
}
With the above code I got the bibliographies printed, but the references (numbers) are not consistent.
Does anyone know a way to approach this problem? I am in no means restricted to splitting the files up. That was just the only solution I was able to come up with.
Thanks for your help and warm Greetings!
You could use a similar approach as in https://tex.stackexchange.com/a/166018 and automatically add some keyword to all entries in references.bib. This will allow you to filter for those when using \printbibliography:
\documentclass[ twoside,openright,titlepage,numbers=noenddot,
headinclude,footinclude,
cleardoublepage=empty,abstract=on,
BCOR=5mm,paper=a4,fontsize=11pt
]{scrreprt}
\usepackage{biblatex}
\addbibresource[label=ownpubs]{ownpubs.bib}
\addbibresource[label=refs]{references.bib}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite]{
\perdatasource{references.bib}
\step[fieldset=keywords, fieldvalue={,Perhalo}, append]
}
}
}
\begin{document}
%here I want to print a selection of the complete bibliography
%References are required to be consistent throughout the whole document
\chapter*{Related Publications}
\printbibliography[heading=none,keyword={Perhalo}]
%here goes all the other stuff: chapters, sections, whatever
%print complete bibliography
\nocite{*}
\printbibliography
\end{document}

getting a decimal number while creating section on my texmate?

\documentclass[12pt] {book}
\begin{document}
\begin{titlepage}
\begin{center}
\line(1,0){300}\\
[4mm]
\huge{\bfseries THIS IS MY NOVEL}\\
[1mm]
\line(1,0){300}\\
\end{center}
\end{titlepage}
\section{Introduction}\label{sec:intro}
here I am explaining the story of me and about my family and where I am right now and and so on.
\end{document}
for the section I am getting an output as 0.1 introduction please let me know how to fix this.
You are using the document class book. The class book defines the commands \part, \chapter, \section, \subsection... see. If you add a section, latex will use {chapter number}.{section number} as default. Since you haven't started a chapter, the current chapter number is 0.
You can either promote your sections to chapters, or change the class from book to article (or something similar).

Left justification of nomenclature description in LaTeX

I'm using a LaTeX template (provided by ASME) to write a conference paper.
The asme2e.cls class defines a "nomenclature" environment as follows:
% Nomenclature environment
\newbox\tempbox
\newenvironment{nomenclature}{%
\newcommand\entry[2]{%
\setbox\tempbox\hbox{##1.\quad}
\hangindent\wd\tempbox\noindent{##1}\quad\ignorespaces##2\par}
\section*{NOMENCLATURE}}{\par\addvspace{12pt}}
which is used, in the .tex source file, as follows:
\begin{nomenclature}
% [...]
\entry{$C_{visc}$}{Viscous friction coefficient.}
\entry{$M$}{Spool mass.}
% [...]
\end{nomenclature}
resulting in the description texts not being left justified (since a fixed horizontal space is inserted between the symbol (e.g.: M) and the description (e.g.: Spool mass.), but the symbols have different lengths (e.g.: Cvisc is longer than M).
Is there a way to fix the class to have left-justified descriptions?
(I did a few experiments with \dimexpr and the calc package, but just got a bunch of errors).
(I also asked ASME if they could provide an updated template, but I'm still waiting for their feedback...)
I couldn't solve the problem, but I found a "quick and dirty" workaround, using the Tabbing and setspace packages.
Here is the new .tex source:
%[...]
\usepackage{Tabbing}
\usepackage{setspace}
%[...]
\begin{nomenclature}
{\setstretch{1.1}
\begin{tabbing}
\noindent
% [...]
\entry{$C_{visc}$}\quad\quad\={Viscous friction coefficient.}\\
\entry{$M$}\>{Spool mass.}\\
\entry{$v$}\>{Spool velocity.}\\
% [...]
\end{tabbing}
} % end \setstretch
\end{nomenclature}
%[...]
(Clearly, I'm completely bypassing the \entry command defined by the asme2e.cls class for the nomenclature environment).
I also tried to edit the asme2ej.cls file but nothing working for me. Then I ended up using the tabbing and set space packages. However, I did not use the \setstretch, and my document compiled just fine.
%[...]
\usepackage{Tabbing}
\usepackage{setspace}
%[...]
\begin{nomenclature}
\begin{tabbing}
\noindent
\entry{XYZ}\quad\quad\={This is an example}\\
\entry{PQR}\>{This is an example}\\
\entry{ZXC}\>{This is an example}\\
\entry{CVN}\>{This is an example}\\
\end{tabbing}
\end{nomenclature}
%[...]
I ran into a similar issue when submitting a paper to an ASME journal. My solution was to edit the asme2e.cls file:
\newenvironment{nomenclature}{%
\newcommand\entry[2]{\noindent\hbox to 0.05\textwidth{##1}\ignorespaces##2\par}
\section*{Nomenclature}}{\par\addvspace{12pt}}
You can change the amount of indentation by changing "0.05\textwidth".
I'm not sure if this is what you're asking, but see the following MWE:
\documentclass[12pt]{article}
\newlength{\nomenlabelindent}
\setlength{\nomenlabelindent}{4em}
\newenvironment{nomenclature}{%
\newcommand\entry[2]{%
\hangindent\nomenlabelindent\noindent\makebox[\nomenlabelindent][l]{##1\quad}\ignorespaces##2\par}%
\section*{NOMENCLATURE}}{\par\addvspace{12pt}}
\begin{document}
\begin{nomenclature}
\entry{$A$} {Parameter}
\entry{$B$} {Parameter}
\entry{$C$}{Parameter}
\entry{$D$}{Parameter}
\entry{$E$}{Parameter}
\end{nomenclature}
\end{document}
Output:
Nomenclature

LaTEX: changing the format of citation in References to list authors' last name first

It seems the format in the Reference section is a little off! Can you please show me how to format the citation to list authors' last name first?
Thanks all.
Here is the current form in the Reference section:
C. B. Grimmond, A. Isard, and J. Belding. Development and evaluation of
continuously weighing mini-lysimeters. Agricultural and Forest Meteorology,
62(3-4):205{218, 1992.
I use BibDesk to organize the citation database. Here is what I am using in the TeXstudio:
\documentclass[]{article}
\usepackage[pdftex]{graphicx}
\usepackage[round]{natbib}
\begin{document}
\bibliographystyle{plainnat}
\bibliography{/Users/me/Citation/citation}
\end{document}
You can try to change the Bibtex Bibliography style to 'acm' or 'apalike'
\bibliographystyle{stylename}
\bibliography{bibfile}
Read more about other styles: https://www.sharelatex.com/learn/Bibtex_bibliography_styles

Resources