Posting a LaTeX manuscript on arxiv is straightforward. Compile your document (say, main.tex). It is okay to leave all your figures in a "figs/" subfolder. Unlike some outlets, you don't have to flatten your directory structure. Apart from main.tex, main.bbl [bibliography], and figures, you may delete all other files. You need the bbl file because arxiv does not run bibtex. Zip the folder, and…
Vector graphics (SVG/PDF) outputs of scatterplots with thousands of points lead to bloated files, unlike say raster formats like PNG. This makes scrolling PDF documents that include such bloated files a painful affair. The reason is fairly obvious: vector files scale with the number of data-points, while raster files scale with the number of pixels. There are many potential solutions. The simplest…
Suppose you want to merge two bib files (f1.bib and f2.bib) that have considerable overlap. One easy solution using Jabref works as described below. Suppose the target bibliography file without duplicates is merge.bib. 1. Copy f1.bib to merge.bib [cp f1.bib merge.bib] 2. Open merge.bib with Jabref 3. Then click File > Import into current database and select the other file [f2.bib] 4. You get a…
1. Latexify_py latexify is a Python package to compile a fragment of Python source code to a corresponding expression. 2. Pylustrator Pylustrator offers an interactive interface to find the best way to present your data in a figure for publication. Added formatting an styling can be saved by automatically generated code. To compose multiple figures to panels, pylustrator can compose different…
Often I have a document in LaTeX, and somebody else needs an editable copy in Word. Here is a list of hacks I have learnt to use: 1. If the document is relatively free of math and figures then the simplest course is often to compile a PDF, and "import" the PDF into MS Word. This works out remarkably well in many cases. 2. The same thing above applies to figures. You can now directly drop PDF…
Often, I have a big folder like Lectures/ which may have sub-folders based on topics, and each topic might have additional folders. To clean auxillary LaTeX files in one fell swoop use, find ./ \( -iname "*.bbl" -o -iname "*.aux" -o -iname "*.log" -o -iname "*.blg" -o -iname "*.nav" -o -iname "*.snm" -o -iname "*.toc" -o -iname "*.vrb" -o -iname "*.out" -o -iname "*.synctex.gz" -o -iname _minted*"…
Christopher Bishop has an excellent set ( 1 , 2 , and 3 ) of introductory lectures on "Probabilistic Graphical Models". They are well-motivated and cover topics that include: directed and undirected graphs conditional independence factor graphs inference using factor graphs and sum/product rules
On a Mac OSX system, the default app Preview allows you to cut and paste pages from a PDF. On Linux you can use PDFChain to manipulate PDFs. If you simply want to extract a certain range, then qpdf is quite handy. A CLI solution is to use ghostscript as described here : gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \ -dFirstPage=1 -dLastPage=15 -sOutputFile=outfile.pdf inpfile.pdf You can make…
This gist has python functions that help Matplotlib draw lines connecting points, and to draw boxes. def drawBox(xlim, ylim): pts = [[xlim[0], ylim[0]], [xlim[1], ylim[0]], [xlim[1], ylim[1]], [xlim[0], ylim[1]], [xlim[0], ylim[0]]] x, y = zip(*pts) return x, y def connectPoints(pts): x, y = zip(*pts) return x, y
To convert all the DOCX files the current working directory to PDF lowriter --headless --convert-to pdf *.docx Similarly, to convert ODT files, lowriter --headless --convert-to pdf *.docx
Sometimes you want to write a sequence of steps, and write the explanation for each step next to it. abc = xyz pythagoras rule = uvw triangle inequality = ABC It is easy to do this with the amsmath package as detailed in this StackOverflow question . \usepackage {amsmath} \begin {align*} abc & = xyz \\ & = uvw & & \text {pythagoras rule} \\ & = D & & \text {triangle inequality} \\ &= ABC & & \end…
Stitching together two functions is sometimes required as a way to transition from one dependence to another. The following schematic describes the idea pictorially: Two different approaches are considered in this PDF (or this Jupyter Notebook ).
Consider the problem described in this StackOverFlow post . You have a function with certain smoothness properties that are apparent on a log-log plot. This is often accompanied by a large domain of integration. It seems worthwhile to "integrate in logspace", whatever that means. This Jupyter notebook probes this question and makes some recommendations.
Suppose part of a python file uses spaces for indentation, while another part uses tabs. This will throw up exceptions at runtime. So the question is how to fix it. One answer is to use the python script reindent.py . Stick it in some folder (~/bin/) in the default path and make it executable ( chmod +x reindent.py ). The usage is straightforward: reindent -n file.py modifies the original file in…
Problem : I have a manuscript TeX file (main.tex), and an independent supporting information file (si.tex). I was to cross-reference (using \label and \ref) items across the two files. For example, I might want to reference figure 1 from si.tex in main.tex. Solution : As this SO answer suggests, the answer lies in the CTAN package xr . In main.tex, just include "si.tex" as an external documents,…
Say you want to fit a line to (x,y) data. With polyfit , you can say, coeff = np.polyfit(x, y, 1) With numpy 1.7 and greater, you can also request the estimated covariance matrix , coeff, cov = np.polyfit(x, y, 1, cov=True) The standard error on the parameters is the square-root of the diagonal elements print(np.sqrt(np.diag(cov))) This report referenced in the SO page is quite useful!
I've been studying up Gaussian process modeling for machine learning. For someone seeing these concepts for the first time, I would recommend the following sequence based on my experience: 1. A Visual Exploration of Gaussian Processes It hits the key points of what makes multinormal distributions special (conditionals and marginals are normal too!), and the visuals help build intuition. 1a.…
I use Preview (on my Mac laptop) and Foxit Reader (on my Linux Desktop) to read PDFs. While reading papers, I often find myself clicking on links to citations. This takes me to the reference section. After looking up the citation, I like to go back to the previous location on the paper (right before clicking on the link). How to go back to the "previous view" isn't well documented. In Preview, the…
Matplotlib (v2 and higher) uses " mathtext " to render math by default. It is quite capable, but I don't like the default font, and prefer the classic "Computer Modern" font. You can fix this globally by modifying the rc file in your custom-style file (use the command matplotlib.get_configdir() to find location) by adding the line: mathtext.fontset : cm If you want to render all text using LaTeX…
Mathpix Snip looks like an amazing tool. You take a screenshot of some math and get it rendered in LaTeX. The process as illustrated on their website: It is available for download on all major OS.
A triangle has three corners. A pentagon has five. A decagon has ten. As the number of corners becomes large, the polygon becomes more "circular". When the number of corners is infinity , the polygon is a circle - a shape with zero corners!
1. Stay in the Game : There is hope in humanity! 2. Kevin Simler's graphical essay on going critical 3. The force of Gilbert Strang 4. Strogatz's " Beauty of Calculus " Lecture