Cross-referencing between different files with LaTeX

Sometimes I want to refer labels I placed in external .tex files. I mean, I want o refer (using the command \ref) a \label from a .tex file I created in another project. A valid solution it to use the command \include. But I in this case I don’t want to include the .tex, I only want to be able to refer their labels. This can be done using the xr package.

Change the title of Table of Contents (ToC) in LaTeX

The steps to change the title of the table of contents (ToC) depends on if you are using the babel package or not. Without babel The title of the table of contents can be changed using the command \contentsname. Let’s see a small example: \documentclass{article} \renewcommand{\contentsname}{Index} % ToC will show "Index" instead of "Content" \begin{document} \tableofcontents \section{Section} \subsection{Subsection} \end{document} With babel When using babel package the name of the table of contents needs to be changed for the particular language used with babel.

Getting docker virtual environment IP in Windows 10

Docker is a full development platform for creating containerized apps. It is a platform available for Windows, GNU/Linux and MAC here. Unfortunately, for Windows users, the docker version you can get depends on the Windows you are running. Windows Docker Access Windows Home Docker Toolbox link Windows Pro Docket link This is because Windows Home systems goes without Hyper-V.

Comparing 'user' Internet connection from some Catalan research centers

Using the same technique seen in the old post “Comparing ping time between connections” I asked some colleges to run the following command in their research centers. ping -c 200 > ping_google.txt So, I load the multiple ping-files to create a data.frame with the icmp_seq number, the time spend per ping and the institution where the ping was promoted. ping <- lapply( files, function( file ) { dta <- read.

From Barcelona to Boston in R

Today I am traveling to Boston to attend the BioC 2017: Where Software and Biology Connect. In this trip to Boston, I stop in Lisbon to take the transoceanic flight. Let’s see a map Boston-Barcelona “centered” using the package maps: library( maps ) xlim <- c( -140, 20 ) ylim <- c( 25, 50 ) map( "world", lwd = 0.75, xlim = xlim, ylim = ylim ) Using ggmap we can get the longitude and the latitude of the cities:

Designing rexposome's (hex-)sticker

A workmate from ISGlobal introduced me to the hexSticker from Guangchuang Yu. To install hexSticker on my Ubuntu I needed to install some system libraries: sudo apt-get install libtiff5-dev libfftw3-3 libfftw3-dev Then, the only unsatisfied dependency on my laptop was: BiocInstaller::biocLite( "ggimage" ) So, I installed hexSticker using devtools: devtools::install_github( "GuangchuangYu/hexSticker" ) The goal of the post was to create the hex-sticker for rexposome, my package/framework/project for exposome data analysis.

Comparing ping time between connections

To perform this test I ping 200 times Google from my PC at ISGlobal (running Linux Mint in a Virtual Machine) and from my laptop (running native Ubuntu). I saved the output in two TXT files with a command like the following one: ping -c 200 > ping_google_work_wifi.txt I processed both files in R to create a data.frame. pwm <- read.delim( file1, nrows = 200, skip = 1, header = FALSE, sep = " ", stringsAsFactors = FALSE ) pwm <- pwm[ , c( 6, 8 ) ] colnames( pwm ) <- c( "icmp_seq", "time" ) pwm$icmp_seq <- as.

Creating a jobs time-lime for resume in R

Let’s say we define a data.frame with the jobs I’ve got from 2008 to 2017: jobs <- data.frame( employer = c( "GICO", "TES", "UAB", "IFAE", "ISGlobal" ), year_start = as.Date( c( "2008-07-01", "2009-11-01", "2010-09-01", "2011-07-01", "2013-09-01" ) ), year_end = as.Date( c( "2009-10-31", "2010-07-31", "2011-06-30", "2012-09-30", "2017-08-31" ) ), id = 1, stringsAsFactors = FALSE ) The content of the data.frame is easy understandable: The employer shows the nanme of the compaty/institution who employed me.

How to add a PDF in a LaTeX document

First, we update the preamble of our LaTeX document by adding pdfpages reference: \usepackage{pdfpages} The package includes the command \includepdf that is used to include a PDF file in the current .tex file: \includepdf[pages=-]{myfile.pdf} As can be seen I’m using the option pages. By default includepdf only inserts the first page of the PDF document. By setting adding the option pages=- we ask to include all the pages of the document.

Check if value exists in another column of a Microsoft Excel document

Today I spent some time looking for this trick. The function to use is called VLOOKUP. From Office Support web page: Use VLOOKUP, one of the lookup and reference functions, when you need to find things in a table or a range by row. For example, look up a price of an automotive part by the part number. Function VLOOKUP requires 4 arguments. the first two are easy to understand, but the third