How to preserve quotes in BibTeX - latex

I'm new to LaTeX and BibTeX, so excuse my ignorance. I have the following entry:
#Article{Hart,
author = {P.E. Hart, N.J. Nilsson, B. Raphael},
title = {Correction to \"A Formal Basis for the Heuristic Determination of Minimum Cost Paths\" },
journal = {SIGART Newsletter 37},
year = {1972},
pages = {28-29}
}
But this comes out as a capital letter A with diaeresis (Ä) and a ':', respectively. How do you get BibTeX to display quotes in a title?

First, quotes should be done like ``this'' (with back-ticks and apostrophes). Second, wrapping this in braces {like this} protects it from being messed with by bibtex. (You need to do this to get capital letters in article titles, for instance.

Related

How to find a word in a single long string?

I want to be able to copy and paste a large string of words from say a text document where there are spaces, returns and not commas between each and every word. Then i want to be able to take out each word individually and put them in a table for example...
input:
please i need help
output:
{1, "please"},
{2, "i"},
{3, "need"},
{4, "help"}
(i will have the table already made with the second column set to like " ")
havent tried anything yet as nothing has come to mind and all i could think of was using gsub to turn spaces into commas and find a solution from there but again i dont think that would work out so well.
Your delimiters are spaces ( ), commas (,) and newlines (\n, sometimes \r\n or \r, the latter very rarely). You now want to find words delimited by these delimiters. A word is a sequence of one or more non-delimiter characters. This trivially translates to a Lua pattern which can be fed into gmatch. Paired with a loop & inserting the matches in a table you get the following:
local words = {}
for word in input:gmatch"[^ ,\r\n]+" do
table.insert(words, word)
end
if you know that your words are gonna be in your locale-specific character set (usually ASCII or extended ASCII), you can use Lua's %w character class for matching sequences of alphanumeric characters:
local words = {}
for word in input:gmatch"%w+" do
table.insert(words, word)
end
Note: The resulting table will be in "list" form:
{
[1] = "first",
[2] = "second",
[3] = "third",
}
(for which {"first", "second", "third"} would be shorthand)
I don't see any good reasons for the table format you have described, but it can be trivially created by inserting tables instead of strings into the list.

How could I get an editor to align vertically by a single character in selected text?

Let's say I've got a document (it happens to be a BibTeX file) filled with thousands of entries like this:
#article{hierarchy_problem_1,
title = {Dynamics of spontaneous symmetry breaking in the Weinberg-Salam theory},
author = {Susskind, Leonard},
journal = {Physical Review D},
volume = {20},
number = {10},
pages = {2619--2625},
year = {1979},
month = {November},
publisher = {American Physical Society}
}
I want to be able to select one of those, or maybe a bunch of them, and get them to change to be aligned vertically by a single character, in this case the "=" character, so it becomes something like this:
#article{hierarchy_problem_1,
title = {Dynamics of spontaneous symmetry breaking in the Weinberg-Salam theory},
author = {Susskind, Leonard},
journal = {Physical Review D},
volume = {20},
number = {10},
pages = {2619--2625},
year = {1979},
month = {November},
publisher = {American Physical Society}
}
My editor of choice is Geany just now (which has the facility to send selected text to some external, custom command -- context menu > Format > Send Selection to) but I will entertain anything. Bearing in mind that some titles of the papers can contain the "=" character, what might be a good way to do this? I would suspect at least that the "=" character in a line after some text like "journal", would be the first instance of that character, and then it gets spaces (I'd prefer to avoid tabs) added before it in order for it to end up at, say, the 30th column. What might be some way to do this?
Maybe a shell/regex expert can build a script used in a custom command.
Personally, in your situation I will :
Set tabulation to <tab> in the document
search & replace = by <tab><tab><tab><…>=
Adjust distance with a vertical selection (need the plugin Extra Selection).
Notepad++ has an align to clipboard character.

Titanic: Machine Learning from Disaster

Define function to extract titles from passenger names
def get_title(name):
title_search = re.search(' ([A-Za-z]+)\.', name)
# If the title exists, extract and return it.
if title_search:
return title_search.group(1)
return ""
title_search = re.search(' ([A-Za-z]+)\.', name) What does this mean?
The titanic dataset has names of the passenger like: Graham, Miss. Margaret Edith and Behr, Mr. Karl Howell
The titles here are Mr. and Miss.
title_search = re.search(' ([A-Za-z]+).', name)
The above line of code searches for names having titles. Mr. and Miss. are not the only ones, it could also be for example, Dr., Prof. and so on. Since we do not know before hand what are the titles but we know the pattern, which is 'alphabets followed by a period', we look for those words alone.
([A-Za-z]+). means, look for any word that starts with A-Z or a-z and end with a fullstop.
I suggest you read about regular expressions.

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

Capital in Bibtex

I want to show some letters in Bibliography as capital. For example:
#misc{libsvm,
abstract = {LIBSVM is an implbmentation of Support vector machine (SVM).},
author = {Chang, Chih-Chung},
howpublished = {\url{http://www.csie.ntu.edu.tw/~cjlin/libsvm/}},
keywords = {svm},
posted-at = {2010-04-08 00:05:04},
priority = {2},
title = {LIBSVM.},
url = "http://www.csie.ntu.edu.tw/~cjlin/libsvm/",
year = {2008}
}
But "LIBSVM" is not shown as it is:
[3] Chih-Chung Chang. Libsvm. http://www.csie.ntu.edu.tw/ ̃cjlin/libsvm/,
2008.
How can I make the letters capital? Thanks and regards!
Generally, to keep BibTeX from turning your letters lowercase, enclose them in {}:
title = {A History Of {StudlyCaps}}
will produce "A history of StudlyCaps."
Alceu Costa is correct that all-capital abbreviations should be formatted in small capitals, but that is a different matter than this.
The \textsc is used to format the text in small capitals. You can do this in your .bib file:
title = {\textsc{LIBSVM}}
Place {} brackets around anything you want to keep in CAPS.
For example:
#type{bibkey,
title = "{M}y {B}ibliography is the {B}est!",
author = "{ABCDE}",
}
In the case of IEEEtran LaTeX Class template, one can simply do the following:
title = "{3D Open Source Framework for Something you need}"
A template can be found at the following link
http://www.ieee.org/conferences_events/conferences/publishing/templates.html

Resources