I use natbib for referencing in latex file. Using the style plainnat it give me this:
In [29] they present an ...
Is there a way to make it looks like:
Wolska et al. [29] present ...
Thanks for your help.
This isn't too hard to do with natbib. the command you want is \citeauthor{} which, for example, gives "Gossens, et al" in the text.
The LaTeX WikiBook (Natbib section here) is a great resource. Hope this helps!
Related
I was trying to compile an article, so I could see the PDF version of it, but it appeared an error that says "Impossible to start the command. latex -interaction=nonstopmode %.tex". Does someone knows what this means? (This was supposed to be my first article in LaTeX. I'm using MilkTex and Tex Maker). Thank you.
(I've been looking for what it could be, and some say it is about path, but I don't understand what is that)
\documentclass[a4paper, 11pt]{article}
\usepackage[portuguese]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\author{-------}
\title{xxxxxx}
\date{\today}
\begin{document}
\maketitle
First adocument in LaTeX
\end{document}
Let's assume I have got correct .RIS and/or .bib files imported into Mendeley.
When I create the Mendeley Bibliography in a Office Word file articles with many authors are not written correctly by Mendeley with Geophysical Research Letters style.
E.g. see the following pic (note article chosen randomly):
The article above has 13 authors in total but Mendeley only displays 7 of them with also ... as gap between the 6th and 13th author.
I need all authors shown in my bibliography as per Geophysical Research Letters' style.
How can I solve this?
Any help would be really appreciated.
Thanks
The answer to this has multiple parts:
Note that the AGU, which publishes GRL, has recently changed its citation format to APA style as described here: https://eos.org/editors-vox/new-style-for-agu-journals-and-books What you have pasted above is an APA-style citation.
using et al. for 8 or more authors is correct in the new style
However, the elipsis between the 6th and the last author is not supposed to be there, a deviation from APA rules by the AGU style. I have just fixed this in the upstream repository from which Mendeley draws its styles and it should be available for updating within 48hs in Mendeley. The style that actually updates, btw., is American Geophysical Union, all their journals (such as GRL) just point to that style
If you do want to edit et al settings in a CSL style by yourself for used in Mendeley, the easiest way is probably Mendeley's CSL Editor. There, you would click on "Bibliography" on the left and adjust the et al settings. There are three of relevance:
et-al-min which determines the number of authors at which et al kicks in. E.g., it's set to 8 for AGU which means "start using et al for 8 or more authors".
et-al-use-first which determines how many authors are listed before et al. (currently 6 for AGU)
et-al-use-last which determines whether elipsis are used as described above. This can only be true or false.
I was having the same problem and besides changing the Bibliography section, I changed the Global Formatting section and it worked well
I've export my bookmarks from FF in to a html file but it's too huge and complicated, so I need to remove some firefox lines from it to make it more lighter and plain.
I can replace basic things in the Notepad++ but I guess I do need some operators for this and I have no idea how to make it work right.
For example here is the line from the file containing a link to Logodesignlove :
Logo Design Love
I need to remove all those tags I don't care about, like LAST_MODIFIED="1256428672", ICON_URI="bunch of digits" ICON="bunch of characters" etc.
And of course I need to remove all those tags in every link in the list.
So I was thinking like use something like "Find all tags LAST_MODIFIED="anynumbers" and replace it with nothing/remove it" - it doesn't work though.
Examle how it should like:
Logo Design Love
So far I removed LAST_MODIFIED and ADD_DATE lines thanks to Aleksandr. So LAST_MODIFIED="\d+" worked just fine. But ICON and ICON_URI are still there. I've tried ICON="\w+" - but it doesn't work. I guess it has something to do with the slashes.
Why look for what you don't want when it's easier to keep hold of what you do want and drop the junk?
(<A HREF=".*?").*?(>.*?>)
with
$1$2
Code edited to suit Notepad++ now I know it doesn't need the special chars escaped. Thanks Aleksandr.
Read up on using regular expressions (the java regex tutorials are a good start http://docs.oracle.com/javase/tutorial/essential/regex/), and try one of the online regex tools to help write and test it, such as this one http://gskinner.com/RegExr/
Eg, remove "LAST_MODIF..." with the regex LAST_MODIFIED="\d+"
Otherwise, you may want an XML-specific tool, or even write an XSL. However, I don't know much about that.
I have seen .gnu, .plt, and .gplot as file extensions for gnuplot scripts.
I know Linux doesn't care about file extensions, but what extension most universally declares to human beings "I am a gnuplot script!"?
As Romain, Dr. Person and neillb all point out and this wikibooks article confirms, there is no official standard extension for gnuplot files.
These three file extensions do seem popular:
.gpi
.plt
.gp
Of these .gp is shortest and seems like it would have the fewest collisions with other programs. But the other two extensions aren't in heavy use either. It appears that .plt was used by HPGL plotters and therefore some old Autocad files may have this extension. And files with a .gpi extension are used by Garmin GPS devices. Fwiw, googling for "gnuplot file extension gp" returns a few more results than similar searches for .gpi and .plt
While .gnuplot is a fair choice, it is seven characters long. Long file extensions can potentially detract from readability in the terminal because they open up the possibility of file names that are shorter than the file extension and because longer extensions are more likely to cause lines to wrap.
vim recognises .gpi, for more see Gnuplot Wikibook.
Gnuplot uses .gnu for the demos on their website, so I take that to be the standard.
what extension most universally
declares to human beings "I am a
gnuplot script!"?
For that, ".gnuplot" is hard to beat!
It's not common (probably because it's a bit long) but it unambiguously tells a human being what's inside the tin.
In contrast, wikipedia lists six other file formats with the extension .plt.
I don't think that ".gnuplot" should have been accepted as THE answer. There really isn't an answer. I've seen and used ".gp" before which is nice.
Wikipedia seems to suggest .plt would be standard-ish. That being said, GnuPlot itself doesn't define any standard and makes it freeform, so there isn't really an extension that tells "this is a gnuplot script".
Worth noting. Visual Studio Code has an extension for gnuplot syntax highlighting. It defines 5 extensions for gnuplot files:
.gp
.gnuplot
.gnu
.plot
.plt
I'm a newbie to both R and LaTeX and have just recently found how to plot a standard time series graph using R and save it as a png image. What I'm worried about is that saving it as an image and then embedding it into LaTeX is going to scale it and make it look ugly.
Is there a way to make R's plot() function output a vector graphic and embed that into LaTeX? I'm a total beginner in both so please be gentle :) Code snippets are highly appreciated!
I would recommend the tikzDevice package for producing output for inclusion in LaTeX documents:
http://cran.r-project.org/web/packages/tikzDevice/index.html
The tikzDevice converts graphics produced in R to code that can be interpreted by the LaTeX package tikz. TikZ provides a very nice vector drawing system for LaTeX. Some good examples of TikZ output are located at:
http://www.texample.net/
The tikzDevice may be used like any other R graphics device:
require( tikzDevice )
tikz( 'myPlot.tex' )
plot( 1, 1, main = '\\LaTex\\ is $\\int e^{xy}$' )
dev.off()
Note that the backslashes in LaTeX macros must be doubled as R interprets a single backslash as an escape character. To use the plot in a LaTeX document, simply include it:
\include{path/to/myPlot.tex}
The pgfSweave package contains Sweave functionality that can handle the above step for you. Make sure that your document contains \usepackage{tikz} somewhere in the LaTeX preamble.
http://cran.r-project.org/
The advantages of tikz() function as compared to pdf() are:
The font of labels and captions in your figures always matches the font used in your LaTeX document. This provides a unified look to your document.
You have all the power of the LaTeX typesetter available for creating mathematical annotation and can use arbitrary LaTeX code in your figure text.
Disadvantages of the tikz() function are:
It does not scale well to handle plots with lots of components. These are things such as persp() plots of large matricies. The shear number of graphic elements can cause LaTeX to slow to a crawl or run out of memory.
The package is currently flagged as beta. This means that the interface or functionality of the package is subject to change if the authors find a compelling reason to do so.
I should end this post by disclaiming that I am an author of both the tikzDevice and pgfSweave packages so my opinion may be biased. However, I have used both packages to produce several academic reports in the last year and have been very satisfied with the results.
Shane is spot-on, you do want Sweave. Eventually.
As a newbie, you may better off separating task though. For that, do this:
open a device: pdf("figures/myfile.pdf", height=6, width=6).
plot your R object: plot(1:10, type='l', main='boring') -- and remember that lattice and ggplot need an explicit print around plot.
important: close your device: dev.off() to finalize the file.
optional: inspect the pdf file.
in LaTeX, use usepackage{graphicx} in the document header, use
\includegraphics[width=0.98\textwidth]{figures/myfile} to include the figure created earlier and note that file extension is optional.
run this through pdflatex and enjoy.
You might want to consider using Sweave. There is a lot of great documentation available for this on the Sweave website (and elsewhere). It has very simple syntax: just put your R code between <<>>= and #.
Here's a simple example that ends up looking like this:
\documentclass[a4paper]{article}
\title{Sweave Example 1}
\author{Friedrich Leisch}
\begin{document}
\maketitle
In this example we embed parts of the examples from the
\texttt{kruskal.test} help page into a \LaTeX{} document:
<<>>=
data(airquality)
library(ctest)
kruskal.test(Ozone ~ Month, data = airquality)
#
which shows that the location parameter of the Ozone
distribution varies significantly from month to month. Finally we
include a boxplot of the data:
\begin{center}
<<fig=TRUE,echo=FALSE>>=
boxplot(Ozone ~ Month, data = airquality)
#
\end{center}
\end{document}
To build the document, you can just call R CMD Sweave file.Rnw or run Sweave(file) from within R.
This is a dupe of a question on SO that I can't find.
But:
http://r-forge.r-project.org/projects/tikzdevice/ -- tikz output from r
and
http://www.rforge.net/pgfSweave/ tikz code via sweave.
Using tikz will give you a look consistent with the rest of your document, plus it will use latex to typeset all the text in your graphs.
EDIT
Getting LaTeX into R Plots