Year of reference in brackets in Latex - reference

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}

Related

Replace brackets in references with commas in Latex

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}

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}

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.

Using vim's `gqap' sometimes indents unusually

For the life of me, I cannot figure out the cause of this: when writing in LaTeX documents, I like to keep my line width to maximum of 80 characters. As such, I will execute the vim command gqap and vim will automatically re-wordwrap the paragraph I am writing.
For example, it will cause a long line to become many shorter ones:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pharetra nunc eget arcu dapibus pretium. Nulla vel risus quam, ut sollicitudin sem. Vivamus vitae diam in risus pharetra gravida. Donec rutrum mattis nulla, in consectetur lorem luctus varius. Donec augue purus, iaculis eget fringilla nec, vehicula ut sapien. Quisque sit amet dolor mauris. Sed ac est eu ligula aliquam tincidunt. Proin condimentum rutrum lacinia.
becomes:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pharetra
nunc eget arcu dapibus pretium. Nulla vel risus quam, ut sollicitudin sem.
Vivamus vitae diam in risus pharetra gravida. Donec rutrum mattis nulla, in
consectetur lorem luctus varius. Donec augue purus, iaculis eget fringilla nec,
vehicula ut sapien. Quisque sit amet dolor mauris. Sed ac est eu ligula aliquam
tincidunt. Proin condimentum rutrum lacini
But, for some paragraphs, it will start adding unusual indentions towards the end of the paragraph:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pharetra
nunc eget arcu dapibus pretium. Nulla vel risus quam, ut sollicitudin sem.
Vivamus vitae diam in risus pharetra gravida. Donec rutrum mattis nulla, in
consectetur lorem luctus varius. Donec augue purus, iaculis eget fringilla,
vehicula ut sapien. Quisque sit amet dolor mauris. Sed ac est eu ligula
tincidunt. Proin condimentum rutrum lacini
Why does vim do this? I have yet to figure out the pattern. How can I make it format paragraphs "the correct way"?
Yes, vim's 'smartindent' is not well named. I had trouble with this for a while before I figured out what was wrong. For others, if you notice strange indenting behavior after lines starting with "if" or "for", unset smartindent. You will come across this a lot if you start using vim as a word processor.
From the vim help file, 'smartindent' will indent after a line starting with a keyword from 'cinwords', which is "if,else,while,do,for,switch", by default.
The problem was that I had "smartindent" enabled. Disabling this for LaTeX documents solved it:
au BufEnter *.tex set nosmartindent

Resources