Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize commenton relationship #235

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 58 additions & 1 deletion bibtex/bib/biblatex-apa-test-references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,6 @@ @ARTICLE{10.1:18
something out that women have known forever. {I} know of many},
RELATED = {10.1:18r},
RELATEDTYPE = {commenton},
RELATEDSTRING = {Comment on the article},
JOURNALTITLE = {The Washington Post},
DATE = {2019-01-15},
URL = {https://wapo.st/2HDToGJ}
Expand Down Expand Up @@ -2786,3 +2785,61 @@ @LEGAL{11.10:29
URL = {https://www.ohchr.org/en/professionalinterest/pages/crc.aspx}
}

@ONLINE{online-forum-references:1,
AUTHOR = {J. Little},
AUTHOR+an:username = {1="j450n\_l"},
DATE = {2018-12-12},
TITLE = {I'm the first person in the world with a neural-enabled
prosthetic hand. Using an specialized prosthetic and a
device implanted},
TITLEADDON = {Online forum post},
EPRINT = {Reddit},
URL = {https://www.reddit.com/r/AMA/comments/a5jxbe/im_the_first_person_in_the_world_with_a/}
}

@ONLINE{online-forum-references:2a,
AUTHOR = {B. Gates},
AUTHOR+an:username = {thisisbillgates},
DATE = {2017-02-27},
TITLE = {Philanthropy is small as a part of the overall economy so it
can't do things like fund health care or},
RELATED = {online-forum-references:2ar},
RELATEDTYPE = {commenton},
EPRINT = {Reddit},
URL = {https://www.reddit.com/r/IAmA/comments/5whpqs/im_bill_gates_cochair_of_the_bill_melinda_gates/dea82mk/}
}

@ONLINE{online-forum-references:2ar,
ENTRYSUBTYPE = {onlineforumpost},
AUTHOR = {B. Gates},
AUTHOR+an:username = {thisisbillgates},
DATE = {2017-02-27},
TITLE = {I'm {Bill} {Gates}, co-chair of the {Bill} \& {Melinda} {Gates}
{Foundation}. Ask Me Anything.},
TITLEADDON = {Online forum post},
EPRINT = {Reddit},
URL = {https://www.reddit.com/r/IAmA/comments/5whpqs/im_bill_gates_cochair_of_the_bill_melinda_gates/}
}

@ONLINE{online-forum-references:2b,
AUTHOR = {{haffy-1223}},
DATE = {2018-09-12},
TITLE = {What do you think while on the launchpad about to launch?},
RELATED = {online-forum-references:2br},
RELATEDTYPE = {commenton},
EPRINT = {Reddit},
URL = {https://www.reddit.com/r/IAmA/comments/9fagqy/im_nasa_astronaut_scott_tingle_ask_me_anything/e5v0027/}
}

@ONLINE{online-forum-references:2br,
ENTRYSUBTYPE = {onlineforumpost},
AUTHOR = {S. Tingle},
AUTHOR+an:username = {nasa},
DATE = {2018-09-12},
TITLE = {I'm {NASA} astronaut {Scott} {Tingle}. Ask me anything
about adjusting to being back on {Earth} after my first
spaceflight!},
TITLEADDON = {Online forum post},
EPRINT = {Reddit},
URL = {https://www.reddit.com/r/IAmA/comments/9fagqy/im_nasa_astronaut_scott_tingle_ask_me_anything/}
}
20 changes: 18 additions & 2 deletions doc/biblatex-apa-test.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1195,10 +1195,26 @@ \subsection{APA 11.10--Treaties and International Conventions}
\apaex{\parencite{11.10:29}}\\
\apaex{\textcite{11.10:29}}

\printbibliography[heading=subbibliography,title={APA 11.9 References}]
\printbibliography[heading=subbibliography,title={APA 11.10 References}]
\end{refsection}
\newpage
\section{apastyle.apa.org}
\subsection{Online Forum (e.g., Reddit) References}

\begin{refsection}

\noindent\textcolor{blue}{\texttt{(Online forum post)}}\\
\apaex{\parencite{online-forum-references:1}}\\
\apaex{\textcite{online-forum-references:1}}

\noindent\textcolor{blue}{\texttt{(Online forum comment)}}\\
\apaex{\parencite{online-forum-references:2a, online-forum-references:2b}}\\
\apaex{\textcite{online-forum-references:2a, online-forum-references:2b}}

\printbibliography[heading=subbibliography,title={Online Forum (e.g., Reddit) References}]
\end{refsection}
\newpage
\subsection{Misc tests}
\section{Misc tests}
\begin{refsection}[../bibtex/bib/biblatex-apa-test-misc.bib]
\begin{otherlanguage}{ngerman}
\nocite{datetest1,datetest2,datetest3,datetest4,datetest5,datetest6,datetest7,datetest8,datetest9}
Expand Down
10 changes: 8 additions & 2 deletions tex/latex/biblatex-apa/bbx/apa.bbx
Original file line number Diff line number Diff line change
Expand Up @@ -1310,11 +1310,17 @@
% (APA 10.1 Example 18) Comment on article

\newcommand*{\begrelateddelimcommenton}{\addspace}
\DeclareFieldFormat{related:commenton}{\def\bibstring{\blx@imc@bibcpstring}\mkbibbrackets{#1}}
\DeclareFieldFormat{related:commenton}{\mkbibbrackets{\bibsentence #1}}

\newbibmacro*{related:commenton}[1]{%
\entrydata*{#1}{%
\printtext{\mkbibquote{\printfield[apacase]{title}}}}}
\iffieldundef{savedrelatedstring}{%
\iffieldundef{entrysubtype}{%
\ifbibxstring{\strfield{entrytype}comment}{%
\bibstring[\mkrelatedstringtext]{\strfield{entrytype}comment}}{}}{%
\ifbibxstring{\strfield{entrysubtype}comment}{%
\bibstring[\mkrelatedstringtext]{\strfield{entrysubtype}comment}}{}}}{}
\printtext[citetitle]{\printfield[apacase]{title}}}}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down
2 changes: 1 addition & 1 deletion tex/latex/biblatex-apa/cbx/apa.cbx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
% (APA 11) Bizarre and special rules for legal information

\DeclareFieldFormat{citetitle}{\mkbibquote{#1}}
\DeclareFieldFormat[book,manual,report,periodical,legmaterial,jurisdiction,video]{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat[book,manual,online,report,periodical,legmaterial,jurisdiction,video]{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat[legislation,legadminmaterial,legal]{citetitle}{#1}

\newbibmacro*{cite:noname}{%
Expand Down
6 changes: 6 additions & 0 deletions tex/latex/biblatex-apa/lbx/american-apa.lbx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
\NewBibliographyString{with}
\NewBibliographyString{supplement}
\NewBibliographyString{commenton}
\NewBibliographyString{articlecomment}
\NewBibliographyString{blogpostcomment}
\NewBibliographyString{onlineforumpostcomment}
\NewBibliographyString{manunpub}
\NewBibliographyString{maninprep}
\NewBibliographyString{mansub}
Expand Down Expand Up @@ -182,6 +185,9 @@
reprintas = {{reprinted as}{reprinted as}},
reprintfrom = {{reprinted from}{reprinted from}},
commenton = {{comment\space on}{comment\space on}},
articlecomment = {{the\space article}{the\space article}},
blogpostcomment = {{the\space blog\space post}{the\space blog\space post}},
onlineforumpostcomment = {{the\space online\space forum\space post}{the\space online\space forum\space post}},
part = {{part}{pt\adddot}},
paragraph = {{paragraph}{para\adddot}},
paragraphs = {{paragraphs}{paras\adddot}},
Expand Down