JabRef citation in LibreOffice with institutional author - latex

I'm using JabRef as a reference manager and LibreOffice writer as document editor.
I'm using the ooPluging to cite JabRef sources in LibreOffice, but I'm having troubles with sources with institutional authors. For example, the following source
#Misc{RevistaSemana2013,
Title = {Un buen año para la economía},
HowPublished = {Online. Available at http://www.foo.bar},
Institution = {Revista Semana},
Month = {Dec},
Year = {2013},
Comment = {Last visited 21-10-2015},
}
will be appear in the references as:
Revista Semana (2013a). Un buen año para la economía. Online. Available at http://www.foo.bar. Last visited 21-10-2015.
But will be cited as (Semana 2013a).
My style file can be found in http://pastebin.com/j5vNgyDR
Thanks,

It looks to me like JabRef always splits up the last name, even if it's an institution (java code):
AuthorList al = AuthorList.getAuthorList(author);
sb.append(getAuthorLastName(al, 0));
However I found a simple workaround. In the source, use a non-breaking space instead of an ordinary space between Revista and Semana. Then we get the desired result in LibreOffice:
(Revista Semana 2013)

you might use an additional curly bracket:
{{Revista Semana}}
as mentioned in the biblatex manual, section 2.3.3, for corporate authors:
http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/biblatex/doc/biblatex.pdf

Related

R/exams unicode char in *.Rnw question files are not propoerly displayed: é displayed as <U+00E9> in final PDF

I am struggling to produce an exam sheet in French using exams2nops. There are accents in the text provided in the intro and title argument of this function and also in the Rnw files containing the function. The formers are correctly displayed in the resulting PDF, but not the later, for example é from a Rnw file is displayed as <U+00E9>.
The call to exams2nops looks like this:
exams2nops(file=myexam, n = N.students, dir = '.',
name = paste0('exam-', exam.date),
title = "Examen écrit",
course = course.id,
institution = "",
logo = paste(exams.dir, 'input/logo.jpg', sep='/'),
date = exam.date,
replacement = TRUE,
intro = intro,
blank=round(length(myexam)/4),
duplex = TRUE, pages = NULL,
usepackage = NULL,
language = "fr",
encoding = "UTF-8",
startid = 1,
points = c(1), showpoints = TRUE,
samepage = TRUE,
twocolumn = FALSE,
reglength = 9,
header=NULL)
Note that "Examen écrit" is correctly displayed in the final PDF, the problem is with the accent in the Rnw files. The function call yields no error.
The *.tex files by generated by exams2nops, already have the problem. For example, the sentense 'Quarante patients ont été inscrits' in the original Rnw file, becomes 'Quarante patients ont <U+00E9>t<U+00E9> inscrits' in the tex file.
I use exams_2.4-0 with R 4.2.2 with TeXShop 4.70 on OSX 11.6.
I checked that Rnw are utf-8 encoded, for example:
$ file -I question1.Rnw
question1.Rnw: text/x-tex; charset=utf-8
It seems they are utf-8-encoded, indeed. These files were translated with deepl or google translate, then edited in emacs.
I tried setting the encoding parameter of exams2nops to latin-1. It did not help.
Any Idea?
The problem disapeared after setting R 'locales' properly. A recurrent problem with OSX R installs. The symptome is:
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_COLLATE failed, using "C"
3: Setting LC_TIME failed, using "C"
4: Setting LC_MESSAGES failed, using "C"
5: Setting LC_MONETARY failed, using "C"
at start up. This thread explains how to fix it: Installing R on Mac - Warning messages: Setting LC_CTYPE failed, using "C".
I'm collecting a few further comments here in addition to the existing answer:
The only encoding (beyond ASCII) supported by R/exams, starting from version 2.4-0, is UTF-8. Support for other encodings like latin1 etc. has been discontinued.
As only UTF-8 is supported the encoding does not have to be specified in R/exams function calls anymore (as still might be advised in older tutorials).
To leverage this support of UTF-8, R has to be configured with a suitable locale. A "C" locate (see the answer by #vdet) is not sufficient.
When using R/LaTeX (Rnw) exercises all issues with encodings can also be avoided entirely by using LaTeX commands for special characters, e.g., {\'e}t{\'e} instead of été. The latter is of course more convenient but the former can be more robust, especially when working with teams of instructors living on different operating systems with different locale settings.
When using LaTeX commands instead of special characters in R strings (as opposed to the exercise files), then remember that the backslash has to be escaped. For example, the argument title = "Examen écrit" becomes title = "Examen {\\'e}crit".

Where to download BibLaTEX

I'm trying to write my thesis using overleaf, but having trouble with the referencing. I've been told to use BibLaTEX but it doesn't seem to be formatting correctly see 1. From what I gather it's because I don't have the external software downloaded, but I'm confused as to what specifically I need and where to find it. I thought I downloaded this from CTAN, but all I found was a folder of .bib files and I'm not sure how that helps? 2 is the error message I recieve :/
Any advice would be much appreciated!
Here is my code, I try changing the style and the brackets in my doc change (but not the citation).
This is my new ref.bib
#book{williams_transmission_2008,
location = {New York},
edition = {2nd ed},
title = {Transmission electron microscopy: a textbook for materials science},
isbn = {978-0-387-76500-6},
shorttitle = {Transmission electron microscopy},
pagetotal = {4},
publisher = {Springer},
author = {Williams, David B. and Carter, C. Barry},
date = {2008},
keywords = {Materials, Microscopy, Transmission electron microscopy}
}
And this is my new test document, and the same image issue 3
\documentclass{report}
\usepackage[style=science, citestyle=numeric, sorting=ynt]{biblatex}
\addbibresource{ref} % the ref.bib file
\begin{document}
Hi there, Stackoverflowers \cite{williams_transmission_2008}
\printbibliography
\end{document}

Insert Latex to Inkscape in Windows

I have Windows 7 64 bit. I installed these with the given order:
Miktex (Basic-miktex-2.9.4521.exe)
Ghost script (gs905w32.exe)
GSView (gsv50w32.exe)
Pstoedit (pstoeditsetup_win32.exe)
Inkscape (Inkscape-0.48.2-1-win32.exe)
However, I still am not able to see Extensions -> Render -> Latex Formula in Inkscape. What is missing?
Okay, after adding miktext, gs and pstoedit to the PATH; it worked fine.
For example, in order to add pstoedit to the path:
Computer > Properties > Advanced > Environment Variables > PATH > Edit
Add the following:
;C:\Program Files (x86)\pstoedit;
PS: Don't forget semi colons.
Good luck.
This helped me, but I still got errors. I solved them after a while though, so this is what you have to look out for:
When you add the programs to the path, don't use spaces after a semicolon!!
When you type your code later in Incscape, it requires the dollar signs to indicate a formula, even though it asks for LaTeX Formula, so it seems you should already be in math mode. Example: $\vec{r_p}$. You still get lots of warnings, but at least it produces what you want.
Just adding this in case others may have the same problem :)
I would like to add that the latest ghostscript version (at the time of writing) 9.22 throws some depriciation errors but using the version suggested in the accepted answer (by Sait), 9.05, fixed everything for me. Thanks!
I used the following versions on Windows 10:
Miktex (MiKTeX2.9, 32 bit I think; this one may be Basic-miktex-2.9.4521.exe)
Ghost script (gs905w32.exe and NOT the latest at the time, gs922w32.exe)
GSView (gsv50w32.exe)
Pstoedit (pstoeditsetup_win32.exe)
ImageMagick (ImageMagick- 7.0.7-Q16)
Inkscape (Inkscape 0.92.2 (5c3e80d, 2017-08-06), presumably 32 bit)
Caveats:
I used 32 bit versions, the 64 bit did not work at first some other problem)
Ghost Script version 9.22 was throwing some depreciation errors. Version 9.05 worked like a charm.
While installing pstoedit I checked: ".h and .lib files for using the pstoedit.dll in other programs" and "plugins SVG, MIF, EMF, CGM format (shareware)"
I had image magick installed.
Source: http://knowledgepayback.blogspot.be/2017/09/surface-pro-2017-optimising-for.html
I found the existing answer unsatisfactory. MikTeX already ships with tools to convert PDF to SVG, and to compile LaTeX to PDF, so the dependencies seem rather artificial. I have found that one can build a newer version of the LaTeX extension which uses these tools https://github.com/juanjosegarciaripoll/inkscape-latex-miktex
Just copy the *.inx and *.py files into the Inkscape/share/extensions folder and start Inkscape. The interface is very primitive, and equations cannot be edited, but it works.
The procedure to make latex work with Inkscape is explained in this site ...
The only things that should be checked are the paths added to environment variables if more recent versions are used.
Here is a quote of the proposed procedure (sorry, it is in Frensh):
Choisissez les fichiers d’installation 32 ou 64 bits en fonction de votre système. Si vous ne savez pas lequel il vous faut : Clic droit sur l’icône Ordinateur (sur le Bureau ou dans le Menu Windows) → Propriétés, l’information est affichée dans Système : Type du système.
Installer Miktex, Ghostscript, Ghostview, ImageMagick
Installer pstoedit en personnalisant l’installation :
Installation dans le dossier de Gostgum : C:\Program Files\Ghostgum\pstoedit
Cocher : « .h and .lib files for using the pstoedit.dll in other programs » et « plugins SVG, MIF, EMF, CGM format (shareware) »
Copier les fichiers textext.py et textext.inx dans : C:\Program Files\Inkscape\share\extensions
Extraire site-packages.zip dans : C:\Program Files\Inkscape\python\Lib\site-packages
Clic droit Ordinateur (sur le Bureau ou dans le Menu Windows) : Propriétés → Paramètres système avancés → Variables d'environnement… Dans Variables système → Path, ajouter :
;C:\Program Files\gs\gs9.15\lib;C:\Program Files\gs\gs9.15\bin;C:\Program Files\ghostgum\pstoedit

Latex and multibib

I want to split my bibliography into two parts, and found the multibib package which seems to be perfect for this.
But: somehow it doesn't work, not even the simple example works:
\documentclass{article}
\usepackage{multibib}
\newcites{ltex}{\TeX\ and \LaTeX\ References}
\begin{document}
References to the \TeX book \citeltex{Knuth:1991} and to Lamport’s \LaTeX\ book, which appears only in the references\nociteltex{Lamport:1994}. Finally a cite to a Postscript tutorial \cite{Adobe:1985}.
\bibliographystyleltex{alpha}
\bibliographyltex{lit}
\renewcommand{\refname}{Postscript References}
\bibliographystyle{plain}
\bibliography{lit}
\end{document}
With the bib file looking like that
#book{Knuth:1991, author = {Knuth, Donald E.}, title = {The TEC book}, publisher = {Addison-Wesley, Reading, Massachusetts}, year = {1991}}
#book{Lamport:1994, author = {Lamport, Leslie}, title = {LATEX: A Document Preparation System}, publisher = {Addison-Wesley, Reading, Massachusetts, 2 edition}, year = {1994} }
#book{Adobe:1985, author = {Adobe System Incorporated}, title = {Postscript Language Tutorial and Cookbook}, publisher = {Addison-Wesley, Reading, Massachusetts}, year = {1985}}
As expected, two aux files are created (one for each part), but the created pdf file only contains the references for the "normal", not for the created bib.
Any ideas? Thanks!
Ok, I found it out by myself:
I'm using Texniccenter and tought all the compiling is done automatically, but an additional bibtex call is needed for the ltex.aux file, so you need to run
bibtex ltex.aux
manually on the command line, then it works.
Perhaps someone knows a way to do that call from Texniccenter?
Open the ltex.aux file in Texnic Center (through File then Open...).
Once it is open and it is the selected tab in Texnic Center, go to Build, Current File... and click Bibtex. The key here is to choose the Bibtex command in the Current File option.
This performs the same as bibtex ltex.aux in Texnic Center

How to link to a glossary item (using package glossaries)

In my document i'm using the package glossaries to create a glossary. Everything works fine except that the is no link between the words in the text and the corresponding entry in my glossary (so you can click the word to be explained and get to the glossary entry).
The most important parts of my document:
%----Header----
...
\usepackage[nonumberlist,acronym,toc,style=altlist]{glossaries}
\usepackage[
colorlinks=true,
pdfborder=0 0 0,
pdfpagelabels,
plainpages=false,
linktocpage=false,
pdfcreator={LaTeX}]{hyperref}
...
%Glossary entries
\newglossaryentry{glos:twitter}{name=Twitter,
description={Mikroblogging-Service.}}
%----Main document----
\begin{document}
\chapter{Introduction}
This text is a normal glossary item: \gls{glos:twitter}.
This text should also link to the glossary item: \glslink{glos:twitter}{Link to Twitter}
but there is no link
...
\printglossary
\end{document}
As you see i'm also using the package hyperref, but there seems to be no mechanism that automatically links words in the main text to the glossary.
I also tried to use \ref and \label, but this doesnt' work when the element that is referred is outside the main document (like my glossary is).
I'm using the makeglossaries-script coming from miktex (calling makeglossaries main on build), but this also doesn't give me a link.
Anyone knows a way to do that? Or maybe i should use another package than glossaries which supports a functionality like that?
I would also appreciate any working examples where this functionality works.
EDIT:
I just got a working minimal example where gls/glslink actually works. Seems like the linking of glossary items interfers with one of the packages im using in my document. Will have to try by adding my packages one by one to the example to see which package is the reason. The example:
\listfiles
\documentclass{article}
\usepackage[
colorlinks=true,
pdfborder=0 0 0,
pdfpagelabels,
plainpages=false,
linktocpage=false,
pdfcreator={LaTeX}]{hyperref}
\usepackage[nonumberlist,acronym,toc,style=altlist,]{glossaries}
\makeglossaries
%Glossary entries
\newglossaryentry{glos:twitter}{name=Twitter,
description={Mikroblogging-Service.}}
%----Main document----
\begin{document}
\chapter{Introduction}
Ein normales Wort aus dem Glossar: \gls{glos:twitter}.
Dieses Wort soll zum Glossar verlinkt werden: \glslink{glos:twitter}{Link to Twitter}
funktioniert aber nicht...
\clearpage
\printglossary
\end{document}
As not mentioned in the extract of my latex-code, in my documentclass, the draft property was set to true. When removing this property or setting it to false, the gls/glslink work fine.

Resources