I am using the below reference in .bib file overleaf project
#MISC{104,author = {W. R. Group},title = {Auckland II},howpublished = {https://wand.net.nz/wits/auck/2/auckland\_ii.php.}, year = {2020}, month = {Accessed on: July, 1}}
However, I get spaces in my references as shown in the link below
reference output
Two problems:
you shouldn't set urls as normal text. Use the \url{...} macro from the hyperref or url package instead
Once you have done this, you can use the xurl package to provide more possible break points and thus avoid such spaces
Unrelated comment:
the month field is not the right place to give additional information like Accessed on: July, 1. If you'd choose an appropriate entry type instead of #misc it would have its own field for this, e.g. urldate
Related
I need to create a bibliography style based on authoryear, which precedes the entry with its original citation label. I know that I can set the additional style somewhat like this.
\renewbibmacro*{begentry}{%
\printnames{labelname} \usebibmacro{date+extradate}\\
}
But this will give me a different line, if maxcitenames and maxbibnames are set to different values. By example, if I have maxcitenames set to 2 and maxbibnames set to 99, I will get "Dehmel et al 2020" for citing and "Dehmel / Kenning / Wagner 2020" in the first line of the bib entry (respecting that I'm using '/' as the author delimiter). I want both to be the same, without changing maxcitenames, as the second line of the bib entry would be affected by this and no longer show all and full author names. Is there a field or bib macro that I can use to access the original label? I know that this bib style is unconventional, but the style is not my decision.
I need a Google Sheet function that will return the position of the last instance of a particular character. Basically, FIND, but starting on the right.
For example, for the data set below, I need to return the position of the last dash.
ABC-DEF-GHI = 8
ABCD-EF-GH-IJK = 11
AB-C-DE-FGH-I-JK = 14
Thanks!
I don't know where to start. MID might work, but the file names are of different lengths and different formats. The files just generally end with - ***.png, and I need the asterisk. The string I need is also of variable length and can contain spaces (the string is the name of the student).
Here's a possible solution:
=len(regexextract(A1,".*-"))
It's essentially extracting everything up to the last dash and taking the length of the resulting string.
for the whole array try:
=INDEX(LEN(REGEXEXTRACT(A1:A3; "(.*-)")))
I would like to add custom text right after citation year within a reference without a comma. For example, I need (UNISDR, 2016:18) to indicate the exact page number of the reference.
To add custom text of ":18" right after year, I add following into my latex citation:
\citep[:18]{UNISDR:2016aa}
Then the result becomes (UNISDR, 2016, :18). I need to get (UNISDR, 2016:18) without a comma and a space after year.
How can I extract a specific word or words from a URL to display in another column on Google Spreadsheets? The URL is https://seatgeek.com/bands/katy-perry?p=3 and I have to extract "katy perry" from this URL. I also have to create a second formula that will display the same URL with a date from another column on the spreadsheet.
Look up regular expressions for VBA. This way you can perform pattern matching with a lot of flexibility.
Here:
http://www.macrostash.com/2011/10/08/simple-regular-expression-tutorial-for-excel-vba/
or better yet, here:
How to use Regular Expressions (Regex) in Microsoft Excel both in-cell and loops
How's this - change A3 as needed to match the Cell with the URL:
=SUBSTITUTE(MID(A3,SEARCH(";",SUBSTITUTE(A3,"/",";",4))+1,FIND("?",SUBSTITUTE(A3,"/",";",4))-SEARCH(";",SUBSTITUTE(A3,"/",";",4))-1),"-"," ")
What this is doing is switching out the '/' right before 'katy-perry' with a unique (to that cell) mark, the semi-colon. Then, using MID(), extract the info between the substituted ';' and the '?'.
Edit: This should work with any name length (i.e. 'katy-perry','katyyyyyy-peeerrryyy'). Note that it assumes that you will ALWAYS have a URL with four '/' before the artist's name.
The single sample URL you provided leaves one wondering if the configuration is going to be standard across many other URLs you may have listed. If this is typical of the way other URLs are constructed, you can identify the question mark and the last forward slash to parse out the katy-perry. Here is is in steps then altogether.
The following instructions assume that https://seatgeek.com/bands/katy-perry?p=3 is in A1.
Append a question mark to the end just in case there isn't one in the URL and use the first question mark found to strip off anything right of that.
=LEFT(A1, FIND("?", A1&"?")-1)
Replace all forward slashes with 99 spaces.
=SUBSTITUTE(LEFT(A1, FIND("?", A1&"?")-1), "/", REPT(" ", 99))
Peel off the right-most 99 characters and trim off extra spaces.
=TRIM(RIGHT(SUBSTITUTE(LEFT(A1, FIND("?", A1&"?")-1), "/", REPT(" ", 99)), 99))
The result should katy-perry. This formula is Google-Spreadsheet friendly.
I did some searching and in openoffice and excel it looks like you can simply add an * at the beginning or end of a character to delete everything before and after it, but in Google spreadsheet this isn't working. Does it support this feature? So if I have:
keyword USD 0078945jg .12 N N 5748 8
And I want to remove USD and everything after it what do I use? I have tried:
USD* and (USD*) with regular expressions checked
But it doesn't work. Any ideas?
The * quantifier just needs to be applied to a dot (.) which will match any character.
To clarify: the * wildcard used in certain spreadsheet functions (eg COUNTIF) has a different usage to the * quantifier used in regular expressions.
In addition to options that would be available in Excel (LEFT + FIND) pointed out by pnuts, you can use a variety of regex tools available in Google Sheets for text searching / manipulation
For example, RegexReplace:
=REGEXREPLACE(A1,"(.*)USD.*","$1")
(.*) <- capture group () with zero or more * of any character .
USD.* <- exact match on USD followed by zero or more * of any character .
$1 <- replace with match in first capture group
Please try:
and also have a look at.
For spaces within keyword I suggest a helper column with a formula such as:
=left(A1,find("USD",A1)-1)
copied down to suit. The formula could be converted to values and the raw data (assumed to be in ColumnA) then deleted, if desired.
To add to the answers here, you can get into trouble when there are special characters in the text (I have been struggling with this for years).
You can put a frontslash \ in front of special characters such as ?, + or . to escape them. But I still got stuck when there were further special characters in the text. I finally figured it out after reading find and replace in google sheets with regex.
Example: I want to remove the number, period and space from the beginning of a question like this: 1. What is your name?
Go to Edit → Find and replace
In the Find field, enter the following: .+\. (note: this includes a space at the end).
Note: In the Find and replace dialogue box, be sure to check "Search using regular expressions" and "match case". Leave the Replace field blank.
The result will be this text only: What is your name?