Changing currency in Latex that's not Dollar, Pound or Euro - latex

How do I change a currency in a Latex template? Something that's text based, like South African Rand (symbol > 'R'). Latex doesn't recognize ZAR etc.
FYI: I'm currently using an invoice template.

Within invoices, or any template containing a currency you'll want to change, simply write the next:
\documentclass[letterpaper]{dapper-invoice}
\renewcommand{\$}{\text{R}}
In the above instance, I'm changing $ to ZAR (South African Rand). It's a simple way of changing the currency to a text-like currency (eg. 'R').

Related

Only print a footnote of a acronym once per page in the footnotes.- LaTeX

I want the acronym package to only print a footnote, if its not already printed on that specific page. And give the \acf{XX} the same number in the text.
It should look like this:
Text
The USA¹ are country as well as the UAE², but the USA¹ are bigger.
___________________
1 United States of America, 2 United Arabic Emirates
Next page:
The UAE¹ are still a country.
___________________
1 United Arabic Emirates
But it looks like this:
Text
The USA¹ are country as well as the UAE², but the USA³ are bigger.
___________________
1 United States of America, 2 United Arabic Emirates, 3 United States of America
Next page:
The UAE¹ are still a country.
___________________
1 United Arabic Emirates
My code:
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[footnote]{acronym}
\usepackage{hyperref}
\usepackage{perpage}
\MakePerPage[1]{footnote}
\begin{document}
\section*{Acronyms}
\begin{acronym}[ECU]
\acro{USA}{United States of America}
\acro{UAE}{United Arabic Emirates}
%[...]
\end{acronym}
\newpage
\section{Text}
The \acf{USA} are a country as well as the \acf{UAE}, but the \acf{USA} are bigger.
\newpage
The \acf{USA} are still a country.
\end{document}
I tried a lot but couldnt find out a Solution on my own - Maby someone here is better in LaTeX as me and could provide me some help.
Greetings
Tristan.
When you use \acf you request a "full acronym", so you explicitly override what the package would normally do. If you use \af instead, you'll only get the footnote the first time.
As for "first time¨: the acronym package tracks whether it has spelled out the acronym already. You can reset this counter with \acresetall. This is independent of pages. In your example with the forced page break you could simply add \acresetall after \newpage. In larger documents you could add it to each \section or \chapter, or have it done automatically with the etoolbox package or look into this answer to hook it into a page break.

Bibliography Customisation for Overleaf

I currently have this code:
\usepackage[
backend=biber,
citestyle=authoryear,
bibstyle=authoryear,
maxcitenames=2,
maxbibnames=99]{biblatex}
\addbibresource{reference.bib}
\renewcommand*{\nameyeardelim}{\addcomma\space}
\DeclareNameAlias{sortname}{family-given}
\setlength\bibitemsep{1em}
Which prints the bibliography like this:
Birrell, S. and Donnelley, P. (2004). “Erving Goffman’s Influence on
the Sociology ofSport”. In: ed. by R. Giulianotti. Sport and Modern
Social Theorists. London: Pal-grave Macmillian UK, pp. 49–64.
This is the info from the .bib file:
#inbook{birrel:2004,
author={S. Birrell and P. Donnelley},
editor={Giulianotti,R.},
year={2004},
title={Erving Goffman's Influence on the Sociology of Sport},
series={Sport and Modern Social Theorists},
publisher={Palgrave Macmillian UK},
address={London},
pages={49-64}
}
I need to remove the parentheses from around the year to conform to Leeds Harvard style, which is like this:
Family name, INITIAL(S). Year. Title of article. Journal Title. Volume(issue number), page numbers.
Help!

Auto translation with GOOGLETRANSLATE is not working

The issue is simple, when I try to do auto translate from English to a detected language I got an error, the formula is:
=GOOGLETRANSLATE("Cat"; "en"; "auto")
and the error is something like
Error, Google Translate does not support translation from en to pl-PL.
The problem (I think) is that GOOGLETRANSLATE is supposed to get language as two letter code when default value is language + country code (which is not supported https://support.google.com/docs/answer/3093331?hl=en)
Is it possible to fix that? I would like to translate to user's language (so I want to use "auto" value), no matter what is the language and I assume that if the problem occurs for one language it will happen for different one.
Have you tried to use ; instead of ,.
Example:
=GOOGLETRANSLATE(A1 ; "auto"; "bg")
I have the same issue for Russian. The formula =GOOGLETRANSLATE("Cat"; "en"; "auto") gives the error:
Google Translate does not support translating from en to ru-RU.
This is Google issue, the best way is to report it:
Menu: Help > Report a problem
Here's a workaround:
make a script to detect sheet's locale.
use regex to extract first part of a locale string.
Here's the sample code:
function getLocale()
{
var locale = SpreadsheetApp.getActive().getSpreadsheetLocale(); // pl_PL
return /(.*)_/.exec(locale)[1]; // pl
}
The usage:
=GOOGLETRANSLATE("Cat"; "en"; getLocale())
auto-translate is supported only for these 16 locales:
brazil
germany
mexico
spain
canada (english)
hong kong
philippines
taiwan
china
italy
portugal
united kingdom
france
japan
south korea
united states
see more at: https://stackoverflow.com/a/73767720/5632629

Extracting text from APA citation

I have a spreadsheet containing APA citation style text and I want to split them into author(s), date, and title.
An example of a citation would be:
Parikka, J. (2010). Insect Media: An Archaeology of Animals and Technology. Minneapolis: Univ Of Minnesota Press.
Given this string is in field I2 I managed to do the following:
Name: =LEFT(I2, FIND("(", I2)-1) yields Parikka, J.
Date: =MID(I2,FIND("(",I2)+1,FIND(")",I2)-FIND("(",I2)-1) yields 2010
However, I am stuck at extracting the name of the title Insect Media: An Archaeology of Animals and Technology.
My current formula =MID(I2,FIND(").",I2)+2,FIND(").",I2)-FIND(".",I2)) only returns the title partially - the output should show every character between ).and the following ..
I tried =REGEXEXTRACT(I2, "\)\.\s(.*[^\.])\.\s" ) and this generally works but does not stop at the first ". " - Like with this example:
Sanders, E. B.-N., Brandt, E., & Binder, T. (2010). A framework for organizing the tools and techniques of participatory design. In Proceedings of the 11th biennial participatory design conference (pp. 195–198). ACM. Retrieved from http://dl.acm.org/citation.cfm?id=1900476
Where is the mistake?
The title can be found (in the two examples you've given, at least) with this:
=MID(I2,find("). ",I2)+3,find(". ",I2,find("). ",I2)+3)-(find("). ",I2)+3)+1)
In English: Get the substring starting after the first occurrence of )., up to and including the first occurrence of . following.
If you wish to use REGEXEXTRACT, then this works (on your two examples). (You can also see a Regex101 demo.):
=REGEXEXTRACT(I3,"(?:.*\(\d{4}\)\.\s)([^.]*\.)(?: .*)")
Where is the mistake?
In your expression, you were capturing (.*[^\.]), which greedily includes any number of characters followed by a character in the character class not (backslash or dot), which means that multiple sentences can be captured. The expression finished with \.\s, which wasn't captured, so the capture group would end before a period-then-space, rather than including it.
Try:
=split(SUBSTITUTE(SUBSTITUTE(I2, "(",""), ")", ""),".")
If you don't replace the parentheses around 2010, it thinks it is a negative number -2010.
For your Title try adding index split to your existing formula:
=index(split(REGEXEXTRACT(A5, "\)\.\s(.*[^\.])\.\s" ),"."),0,1)&"."

Titleize with roman numerals, dashes, apostrophes, etc. in Ruby on Rails

I'm simply trying to convert uppercased company names into proper names.
Company names can include:
Dashes
Apostrophes
Roman Numerals
Text like LLC, LP, INC which should stay uppercase.
I thought I might be able to use acronyms like this:
ACRONYMS = %W( LP III IV VI VII VIII IX GI)
ActiveSupport::Inflector.inflections(:en) do |inflect|
ACRONYMS.each { |a| inflect.acronym(a) }
end
However, the conversion does not take into account word breaks, so having VI and VII does not work. For example, the conversion of "ADVISORS".titleize is "Ad VI Sors", as the VI becomes a whole word.
Dashes get removed.
It seems like there should be a generic gem for this generic problem, but I didn't find one. Is this problem really not that common? What's the best solution besides completely hacking the current inflection library?
Company names are a little odd, since a lot of times they're Marks (as in Service Mark) more than proper names. That means precise capitalization might actually matter, and trying to titleize might not be worth it.
In any case, here's a pattern that might work. Build your list of tokens to "keep", then manually split the string up and titleize the non-token parts.
# Make sure you put long strings before short (VII before VI)
word_tokens = %w{VII VI IX XI}
# Special characters need to be separate, since they never appear as "part" of another word
special_tokens = %w{-}
# Builds a regex like /(\bVII\b|\bVI\b|-|)/ that wraps "word tokens" in a word boundary check
token_regex = /(#{word_tokens.map{|t| /\b#{t}\b/}.join("|")}|#{special_tokens.join("|")})/
title = "ADVISORS-XI"
title.split(token_regex).map{|s| s =~ token_regex ? s : s.titleize}.join

Resources