Below you will find pages that utilize the taxonomy term “LaTeX”
December 30, 2022
Adding Title and Author to PDFs exported from Jupyter Notebook
I am doing some end of the year cleaning on my hard drive and just uploaded the Jupyter Notebook I used in the analysis of a mobile phone lying still earlier this year.
For some future studies, I thought it would be interesting to explore the PDF export functionality from Jupyter. That worked very well except for that I didn’t get any title or author name on top:
Then I found a solution on Stack Overflow.
May 13, 2022
Em-dash is not a hyphen
I have been doing quite a lot of manuscript editing recently and realize that many people—including academics—don’t understand the differences between the symbols hyphen, en-dash, and em-dash. So here is a quick explanation:
hyphen (-): is used to join words (“music-related”). You type this character with the Minus key on the keyboard, so it is the easiest one to use. en-dash (–): is used to explain relationships between two concepts (“action–couplings”) or in number series (0–100).
October 7, 2019
What tools do I use for writing?
Earlier today I was asked about what tools I use when writing. This is not something I have written about here on the blog before, although I do have very strong opinions on my own tools. I actually really enjoy reading about how other people work, so writing about it here may perhaps also be interesting to others.
Text editor: Atom Most of my writing, whether it is e-mail drafts, meeting notes, or academic papers, is done in the form of plain text files.
February 3, 2013
Unofficial ERC Starting Grant LaTeX template
After I mentioned that I used LaTeX for an ERC Starting Grant application in a previous blog post, I have gotten several questions from people about what type of LaTeX template I used. Unfortunately, the ERC does not provide any LaTeX template, only templates for MS Word and OpenOffice. My scientific workflow is so dependent on LaTeX/BibTeX that I decided to recreate a LaTeX document setup that resembled the MS Word template.
February 7, 2012
LaTeX fonts in OSX
When creating figures for papers written in LaTeX, I have found it aesthetically unpleasing to have different fonts in the figures than in the text. Most figures I create in either OmniGraffle or Matlab, and here I have relied on regular OSX fonts.
Fortunately, I have discovered that it is possible to use LaTeX fonts in OSX. Apparently, this is now included as a feature in the latest version(s) of the MacTeX distribution (?
November 2, 2011
Compact bibliography list in LaTeX
I have already written about how to compact lists earlier today. Now is the time to compact the bibliography… This is how the regular bibliography in LaTeX looks like:
First I found a suggestion to use the setspace function, but it turns out that it is much easier to just use the bibsep option to natbib. Just add the following to the preamble:
\usepackage{natbib} \setlength{\bibsep}{0.0pt} and you will get something like this:
November 2, 2011
Compact lists in LaTeX
I have for a long time been struggling with making lists more compact in LaTeX. While the standard lists often look good, as seen in the example below, there are times when space limits, etc. makes it necessary to save some space.
{width=“600” height=“283”}
Up until now I have been using things like the rather ugly [\vspace{-7pt}]{style=“font-family: monospace; white-space: pre;”} command to remove space between list items. Now I finally decided to figure out a better solution.
June 30, 2011
Using MultiMarkDown
I tend to move between different computers/devices and OSes all the time, and have started to become very tired of storing text data in different formats that are either not compatible or tend to mess up the formatting between different applications (e.g. RTF files).
To avoid this I am now testing to write all my text-based documents (notes, memos, letters, etc.) using MultiMarkDown. This is a so-called Lightweight markup language, similar to e.
May 4, 2011
Remove chapter and part text from LaTeX documents
When using the \part and \chapter tags in LaTeX you will typically end up with parts and chapters that say “part” and “chapter” before the name you have written. Putting these lines in your preamble will remove this:
\renewcommand{\partname}{} \renewcommand{\chaptername}{} \renewcommand{\thechapter}{} \renewcommand{\thesection}{}
April 18, 2011
Use Preview instead of Adobe Reader in Texmate
I just installed Adobe Reader on my new computer, only to discover that it hijacked the PDF preview window in TextMate when working on LaTeX documents. This also happened the last time I installed a new system, and I couldn’t remember what I did to change it back to using Preview as the default PDF viewer.
After googling around, I remembered that TextMate is just using the regular browser settings when it comes to displaying PDF files.
March 25, 2011
Avoid subscript in Matlab titles
I am working on some plots in Matlab, where I am using the filename as the title of the plot. In many of the files I am using underscores (_) as separator, and the result is that Matlab creates a subscript.
So for a file called b_staccato_004, I get a title b~s~taccato~0~04.
After some googling I found that this is because Matlab per default treats such text strings as LaTeX code.
October 1, 2010
LaTeX formatting issues
I am about to submit an article for review, and had to format in a special way. Here is a quick summary of what I did:
No paragraph indents:
\setlength{\parindent}{0in} but a single line between:
\usepackage{parskip} Left text justification:
\begin{flushleft} ... \end{flushleft} Double spacing:
\renewcommand{\baselinestretch}{2}
August 18, 2010
Writing complex documents
I have been using LaTeX for most of my more advanced writing needs for so many years, that I tend to forget that there are so few other good options out there for writing what could be called “complex” documents, i.e. book-sized documents with a good portion of notes, pictures, links, etc.
I just had to help out in trying to create a large document based on 30+ individual documents in MS Word.
April 8, 2008
Writing in NeoOffice, dreaming of LaTeX
I am working on a paper for a journal that only accepts RTF documents, and to avoid the possible problems resulting from converting a LaTeX document into RTF (or possibly from PDF), I decided to try using a word processor from the beginning. For simple word processing I have grown very found of Bean recently, a lightweight application slightly more advanced than TextEdit. I started out with Bean, but since I had to include endnotes in the document I ended up moving over to NeoOffice instead.
April 21, 2007
File search in Bibdesk
Bibdesk is just getting better! In version 1.3.4 they have included searching inside linked PDF files in the library. It is not as powerful as the AI search functionality in DevonThink, but it is still very, very useful.
{width=“500”}
April 3, 2007
Oxford Dictionary in TextMate
After working with TextMate for a couple of weeks, I have decided to stay there and leave TexShop behind for my LaTeX editing. Just found out that it even supports the ctrl-apple-d trick for getting definitions from the Oxford Dictionary in the text.
March 29, 2007
Drag and drop pictures in TextMate
After being convinced by Tim, I have started using TextMate for text editing things. Right now I am mostly interested in its many nice LaTeX features, and the best so far is that it will create the necessary code when dropping and image into the text. You can’t believe how much time and effort this saves me. Very, very handy!
March 14, 2007
LaTeX Columns
Found this little trick to make columns anywhere in a LaTeX document:
Put this line in the preamble:
usepackage{palatino, url, multicol} Then add this where you want the columns:
begin{multicols}{2}{ My text... } end{multicols}
February 22, 2007
MSP tilde in LaTeX
I spent a couple of minutes trying to figure out how to create a nice tilde (~) for writing the name of Max/MSP externals in LaTeX (e.g. dac~), so I figured I could post the solution in case anyone else wonders. First I tried using \tilde{} and \widetilde{}, but they didn’t look nice. However, this little thing does the trick:
$\sim$
I guess you need the math environment to get this working.
February 21, 2007
Multiple bibliographies in LaTeX
I have been wondering how to make a separate bibliography of my own publications as an appendix in my dissertation. Vincent pointed me to multibib and its siblings, and then I came across this FAQ about all the glories of multiple bibliographies. Doesn’t look like the easiest thing to get going, but I’ll dive into it and see if I manage to get out of it successfully.
January 11, 2007
Smart programs
I had a discussion about which software tools I use for my research, so here is a list of the most important (in no particular order):
Firefox: with adblock and mouse gestures. NetNewsWire: for handling all the blogs I am reading. MarsEdit: to write blog entries. Publishes directly to my WordPress driven blog. OmniGraffle: for making diagrams. I even made my last conference poster with this program, works great also with photos.
December 29, 2006
LaTeX: Table of Contents tricks
As my dissertation draft grows bigger (and messier…), I see that I need to restrict the depth of the Table of Contents. These lines do the trick:
\setcounter{tocdepth}{1}
\tableofcontents
First I tried to use tocdepth 2, but that gave me three levels. I guess this is because it counts the chapter level as 0.
I have also been wondering why the bibliography hasn’t shown up in the table of contents. I haven’t found an explanation, but the solution is this:
April 25, 2006
Word Attachments
I have received a number of Word attachments recently. Nowadays, I only touch MS Word when I am forced to by other people, as I rely on TextWrangler, TextEdit, OpenOffice and LaTex for my various text related activities.
I started to summarize why I think people should avoid Word, especially as e-mail attchments, but then I found some web pages with more well-thought and well-rounded arguments:
- Manuel M T Chakravarty’s Attachments in Proprietary Formats Considered Harmful
February 13, 2006
PDFs with inline video/animation
I recently discovered that it is possible to generate PDFs with video/animation included in the file using LaTeX. Works like a charm, but unfortunately the files only work properly in Acrobat (not Preview).