Replace brackets in references with commas in Latex - reference

I would like to replace the brackets of the year with commas in the references as it is the standard method in the Journal of Finance.
In the references, I have this structure; Author (2020) Title... but I would like to change it to; Author, 2020, Title...
This would be a sample bibliography:
#article{examplesource,
title={Title of article},
author={LastName1, FirstName1 and LastName2, FirstName2 and LastName3, FirstName3},
journal={Journal of Finance},
volume={40},
number={1},
pages={3--73},
year={2005}}
This is what I have so far:
\documentclass{article}
\usepackage[style=ext-authoryear, backend=biber, giveninits=true, uniquelist = false, uniquename=init, isbn=false, maxcitenames=3, dashed=false, maxbibnames=999, doi=false, url=false]{biblatex}
\addbibresource{biblatex-examples.bib}
%\DeclareDelimFormat{nameyeardelim}{\addcomma\space}
\setlength{\bibhang}{15pt}
\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\labelnamepunct}{\addspace}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1}
\DeclareFieldFormat{titlecase}{\MakeSentenceCase*{#1}}
\renewbibmacro*{in:}
{\ifentrytype{article}
{\setunit{\addcomma\space}}
{\printtext{\bibstring{in}\intitlepunct}}}
\DeclareFieldFormat{journaltitlecase}{#1}
\renewbibmacro*{journal}{
\ifboolexpr{
test {\iffieldundef{journaltitle}}
and
test {\iffieldundef{journalsubtitle}}}
{\printtext[journaltitle]{
\printfield[journaltitlecase]{journaltitle}
\setunit{\subtitlepunct}
\printfield[journaltitlecase]{journalsubtitle}}}}
\renewbibmacro*{volume+number+eid}{
\printfield{volume}
\setunit{\addcomma\space}
\printfield{eid}}
\DeclareFieldFormat[article,periodical]{volume}{{#1}}
\DeclareFieldFormat{pages}{#1}
\UndeclareInnerCiteDelims{parencite}
\DeclareInnerCiteDelims{parencite}{(}{)}
\begin{document}
\textcite{examplesource} lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\\
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua \parencite{examplesource}.
\printbibliography
\end{document}
Thanks a lot for your help!

Luckily you are using the ext-authoryear style, so you can use
\DeclareFieldFormat{biblabeldate}{#1} to remove the parenthesis
\DeclareDelimFormat[bib]{nameyeardelim}{\addcomma\space} to add a comma before the year
\ExecuteBibliographyOptions{innamebeforetitle=true} \DeclareDelimFormat[bib]{nametitledelim}{\addcomma\space} to add a comma after the year
\documentclass{article}
\usepackage[style=ext-authoryear, backend=biber, giveninits=true, uniquelist = false, uniquename=init, isbn=false, maxcitenames=3, dashed=false, maxbibnames=999, doi=false, url=false]{biblatex}
\addbibresource{biblatex-examples.bib}
%\DeclareDelimFormat{nameyeardelim}{\addcomma\space}
\setlength{\bibhang}{15pt}
\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\labelnamepunct}{\addspace}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1}
\DeclareFieldFormat{titlecase}{\MakeSentenceCase*{#1}}
\renewbibmacro*{in:}
{\ifentrytype{article}
{\setunit{\addcomma\space}}
{\printtext{\bibstring{in}\intitlepunct}}}
\DeclareFieldFormat{journaltitlecase}{#1}
\renewbibmacro*{journal}{
\ifboolexpr{
test {\iffieldundef{journaltitle}}
and
test {\iffieldundef{journalsubtitle}}}
{\printtext[journaltitle]{
\printfield[journaltitlecase]{journaltitle}
\setunit{\subtitlepunct}
\printfield[journaltitlecase]{journalsubtitle}}}}
\renewbibmacro*{volume+number+eid}{
\printfield{volume}
\setunit{\addcomma\space}
\printfield{eid}}
\DeclareFieldFormat[article,periodical]{volume}{{#1}}
\DeclareFieldFormat{pages}{#1}
\UndeclareInnerCiteDelims{parencite}
\DeclareInnerCiteDelims{parencite}{(}{)}
\DeclareFieldFormat{biblabeldate}{#1}
\DeclareDelimFormat[bib]{nameyeardelim}{\addcomma\space}
\ExecuteBibliographyOptions{innamebeforetitle=true} \DeclareDelimFormat[bib]{nametitledelim}{\addcomma\space}
\begin{document}
\textcite{knuth:ct} lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\\
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua \parencite{knuth:ct}.
\printbibliography
\end{document}

Related

How to adjust the order of author names in Latex references (Journal of Finance style)

I try to replicate the Journal of Finance reference style. In order to do that, the names in the references should be ordered and written with full names as:
For two authors: LastName1, FirstName1 and FirstName2 LastName2
For three or more authors: LastName1, FirstName1, FirstName2 LastName2, and FirstName3 LastName3
This is the example reference:
#article{examplesource,
title={Title of article},
author={LastName1, FirstName1 and LastName2, FirstName2 and LastName3, FirstName3},
journal={Journal of Finance},
volume={40},
number={1},
pages={3--73},
year={2005}}
This is what I have defined so far (based on: https://tex.stackexchange.com/questions/379901/biblatex-how-to-match-the-journal-of-finance-bibliographic-style)
\documentclass{article}
\usepackage[style=ext-authoryear, backend=biber, giveninits=true, uniquelist = false, uniquename=init, isbn=false, maxcitenames=3, dashed=false, maxbibnames=999, doi=false, url=false]{biblatex}
\addbibresource{biblatex-examples.bib}
\setlength{\bibhang}{15pt}
\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\labelnamepunct}{\addspace}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1}
\DeclareFieldFormat{titlecase}{\MakeSentenceCase*{#1}}
\renewbibmacro*{in:}
{\ifentrytype{article}
{\setunit{\addcomma\space}}
{\printtext{\bibstring{in}\intitlepunct}}}
\DeclareFieldFormat{journaltitlecase}{#1}
\renewbibmacro*{journal}{
\ifboolexpr{
test {\iffieldundef{journaltitle}}
and
test {\iffieldundef{journalsubtitle}}}
{\printtext[journaltitle]{
\printfield[journaltitlecase]{journaltitle}
\setunit{\subtitlepunct}
\printfield[journaltitlecase]{journalsubtitle}}}}
\renewbibmacro*{volume+number+eid}{
\printfield{volume}
\setunit{\addcomma\space}
\printfield{eid}}
\DeclareFieldFormat[article,periodical]{volume}{{#1}}
\DeclareFieldFormat{pages}{#1}
\UndeclareInnerCiteDelims{parencite}
\DeclareInnerCiteDelims{parencite}{(}{)}
\DeclareFieldFormat{biblabeldate}{#1}
\DeclareDelimFormat[bib]{nameyeardelim}{\addcomma\space}
\ExecuteBibliographyOptions{innamebeforetitle=true} \DeclareDelimFormat[bib]{nametitledelim}{\addcomma\space}
\begin{document}
\textcite{examplesource} lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\\
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua \parencite{examplesource}.
\printbibliography
\end{document}
you get the full given names with giveninits=false
the sorting you are looking is actually the default behaviour, so you just need to NOT overwrite it with \DeclareNameAlias{sortname}{family-given}
\documentclass{article}
\usepackage[style=ext-authoryear, backend=biber, giveninits=true, uniquelist = false, uniquename=init, isbn=false, maxcitenames=3, dashed=false, maxbibnames=999, doi=false, url=false,giveninits=false]{biblatex}
\addbibresource{biblatex-examples.bib}
\setlength{\bibhang}{15pt}
%\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\labelnamepunct}{\addspace}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1}
\DeclareFieldFormat{titlecase}{\MakeSentenceCase*{#1}}
\renewbibmacro*{in:}
{\ifentrytype{article}
{\setunit{\addcomma\space}}
{\printtext{\bibstring{in}\intitlepunct}}}
\DeclareFieldFormat{journaltitlecase}{#1}
\renewbibmacro*{journal}{
\ifboolexpr{
test {\iffieldundef{journaltitle}}
and
test {\iffieldundef{journalsubtitle}}}
{\printtext[journaltitle]{
\printfield[journaltitlecase]{journaltitle}
\setunit{\subtitlepunct}
\printfield[journaltitlecase]{journalsubtitle}}}}
\renewbibmacro*{volume+number+eid}{
\printfield{volume}
\setunit{\addcomma\space}
\printfield{eid}}
\DeclareFieldFormat[article,periodical]{volume}{{#1}}
\DeclareFieldFormat{pages}{#1}
\UndeclareInnerCiteDelims{parencite}
\DeclareInnerCiteDelims{parencite}{(}{)}
\DeclareFieldFormat{biblabeldate}{#1}
\DeclareDelimFormat[bib]{nameyeardelim}{\addcomma\space}
\ExecuteBibliographyOptions{innamebeforetitle=true} \DeclareDelimFormat[bib]{nametitledelim}{\addcomma\space}
\begin{document}
\textcite{baez/article} lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\\
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua \parencite{aksin}.
\printbibliography
\end{document}

Year of reference in brackets in Latex

I use \textcite{} and \parencite{} for referencing in a latex file. Using that method, I get as default; Author (Year)... and (Author, Year). But I would like to adjust the \parencite{} reference as (Author (Year)) as the standard method in the Journal of Finance.
This would be a sample bibliography:
#article{examplesource,
title={Title of article},
author={LastName1, FirstName1 and LastName2, FirstName2 and LastName3, FirstName3},
journal={Journal of Finance},
volume={40},
number={1},
pages={3--73},
year={2005}}
And this is what I got so far (https://tex.stackexchange.com/questions/379901/biblatex-how-to-match-the-journal-of-finance-bibliographic-style):
\documentclass{article}
\usepackage[style=authoryear, backend=biber, giveninits=true, uniquelist = false, uniquename=init, isbn=false, maxcitenames=3, dashed=false, maxbibnames=999, doi=false, url=false]{biblatex}
\addbibresource{biblatex-examples.bib}
\DeclareDelimFormat{nameyeardelim}{\addcomma\space}
\setlength{\bibhang}{15pt}
\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\labelnamepunct}{\addspace}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1}
\DeclareFieldFormat{titlecase}{\MakeSentenceCase*{#1}}
\renewbibmacro*{in:}
{\ifentrytype{article}
{\setunit{\addcomma\space}}
{\printtext{\bibstring{in}\intitlepunct}}}
\DeclareFieldFormat{journaltitlecase}{#1}
\renewbibmacro*{journal}{
\ifboolexpr{
test {\iffieldundef{journaltitle}}
and
test {\iffieldundef{journalsubtitle}}}
{\printtext[journaltitle]{
\printfield[journaltitlecase]{journaltitle}
\setunit{\subtitlepunct}
\printfield[journaltitlecase]{journalsubtitle}}}}
\renewbibmacro*{volume+number+eid}{
\printfield{volume}
\setunit{\addcomma\space}
\printfield{eid}}
\DeclareFieldFormat[article,periodical]{volume}{{#1}}
\DeclareFieldFormat{pages}{#1}
\begin{document}
\textcite{examplesource} lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\\
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua \parencite{examplesource}.
\printbibliography
\end{document}
Thanks a lot!
If you use the ext-authoryear style, you can change the delimiter using \DeclareInnerCiteDelims{parencite}{(}{)}:
\documentclass{article}
\usepackage[style=ext-authoryear, backend=biber, giveninits=true, uniquelist = false, uniquename=init, isbn=false, maxcitenames=3, dashed=false, maxbibnames=999, doi=false, url=false]{biblatex}
\addbibresource{biblatex-examples.bib}
%\DeclareDelimFormat{nameyeardelim}{\addcomma\space}
\setlength{\bibhang}{15pt}
\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\labelnamepunct}{\addspace}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1}
\DeclareFieldFormat{titlecase}{\MakeSentenceCase*{#1}}
\renewbibmacro*{in:}
{\ifentrytype{article}
{\setunit{\addcomma\space}}
{\printtext{\bibstring{in}\intitlepunct}}}
\DeclareFieldFormat{journaltitlecase}{#1}
\renewbibmacro*{journal}{
\ifboolexpr{
test {\iffieldundef{journaltitle}}
and
test {\iffieldundef{journalsubtitle}}}
{\printtext[journaltitle]{
\printfield[journaltitlecase]{journaltitle}
\setunit{\subtitlepunct}
\printfield[journaltitlecase]{journalsubtitle}}}}
\renewbibmacro*{volume+number+eid}{
\printfield{volume}
\setunit{\addcomma\space}
\printfield{eid}}
\DeclareFieldFormat[article,periodical]{volume}{{#1}}
\DeclareFieldFormat{pages}{#1}
\UndeclareInnerCiteDelims{parencite}
\DeclareInnerCiteDelims{parencite}{(}{)}
\begin{document}
\textcite{knuth:ct} lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\\
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua \parencite{knuth:ct}.
\printbibliography
\end{document}

How to replace word in text with link (Pug)?

I am a very beginner in Pug and I'm trying to solve the following task: Every occurrence (in text) of the following words shall become a link to the destination defined below:
sed -> https://google.com
liq -> https://facebook.com
Đ¢his works as I expected, but keeps anchor tag as string.
- var str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar elementum integer sed neque volutpat ac. Facilisis liq odio morbi quis commodo odio aenean . Vel facilisis volutpat liq velit. Viverra aliquet liq sit amet tellus cras adipiscing sed.";
- var url = '#[a(href="https://google.com") sed]'; //I tried with these ones too - var url = 'sed'; var url = 'a(href="https://google.com)sed'
- var res = str.replace(/sed/g, url);
p #{res}
Here my latest atempt:
mixin link(href, name)
a(href=href target!=attributes.target )= name
//+link('https://google.com', 'Google')(target="blank")
- var str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar elementum integer sed neque volutpat ac. Facilisis liq odio morbi quis commodo odio aenean . Vel facilisis volutpat liq velit. Viverra aliquet liq sit amet tellus cras adipiscing sed.";
- var link = +link('https://google.com', 'Google')(target="blank");
- var res = str.replace(/sed/g, link);
p #{res}
I've never seen Pug mixins used within javascript code blocks like that before. I'm surprised it even outputs the anchor tag at all.
That being said, you can use the unescaped string interpolation syntax (!{variable}) instead of the regular string interpolation syntax (#{variable}) to get the link to render as a link.
In your case:
p !{res}
But keep in mind this word of warning from the Pug documentation:
Caution
Keep in mind that buffering unescaped content into your templates can be mighty risky if that content comes fresh from your users. Never trust user input!

In VBA editor window, mouse selects next line instead of part of current one

This is my problem:
So, I want to select just a part of one (usually very long) line, and when I only slightly move my mouse down while moving to the right, the next line gets selected, and I can start over again.
Does anyone have a solution for this annoying mouse behavior?
Or would you recommend an altogether different input method? (pen, touch pad, keyboard, etc.)
Click on the start point of the text you want, then with the SHIFT key held down, click on the end point.
That's by design.
If you only wish to mark a part of one line, move mouse left-right only, not down (or up).
There are many possibilities to target your problem.
You can use your Shift-Key and the cursor keys to select.
You can also use your Shift-Key in combination with your End-Key and or Pos1-Key
You can also use your Shift-Key in combination with your mouse like mentioned by another user
Also the problem is not that big when you make shorter lines. In VBA you can use _ to hang lines together and interpret it like one:
txt = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
is the same as
txt = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, " _
& "sed diam nonumy eirmod tempor invidunt ut labore et " _
& "dolore magna aliquyam erat, sed diam voluptua. At vero " _
& "eos et accusam et justo duo dolores et ea rebum. Stet " _
& "clita kasd gubergren, no sea takimata sanctus est Lorem " _
& "ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur " _
& "sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut " _
& "labore et dolore magna aliquyam erat, sed diam voluptua. At " _
& "vero eos et accusam et justo duo dolores et ea rebum. Stet " _
& "clita kasd gubergren, no sea takimata sanctus est Lorem ipsum " _
& "dolor sit amet."
To select the whole line you can also click at the white space between the gray bar on the left side of the editor and the first sign in the editor
I hope that helps you.

How can i search multiple words in a file on Notepad++

I'm trying to find a list of Strings in a file (already formated from \n and \r), for example :
0145100841
65722ED01A
657738J000
6584640F00 // this one is found
in a file of this :
201506186584640F00AME NMGR01 RUBAT
How can i do this in Notepad++ ? Is there an existing plugin ?
Prolog
To help people coming from the search or Google, I write it again as answer. Please mark it as correct answer to improve the speed of finding the correct answer.
You can also check the comment section inside the question if something is unclear.
Solution
Instead of seperating the search terms by \r a possible solution would be seperating them by | Pipe symbol, so you can use the whole string as an Regular Expression.
Search Term: 0145100841|65722ED01A|657738J000|6584640F00
You can now press CTRL + F (or in Germany STRG + F) to open the "Search"-Window.
Now you have to change the "Search Mode" to "Regular Expression" and insert the search term.
If you now press search you will get one match (if one exists) and with every continued press, you will get another match (if one exists).
You can test this with following random text content.
Following the Pastebin: http://pastebin.com/YB3i1Ju0
To remove the dependency on pastebin, here the random text content pasted as blockquote:
RANDOM TEXT CONTENT
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat6584640F00, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.Lorem657738J000 ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, n65722ED01Ao sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetet0145100841ur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Resources