Using LaTeX, Mendeley, and Bibtex in Windows

Most publications such as a Thesis, Dissertation, conference paper, Journal article, etc. have specific required formatting. We’ve all hit the point where we simply can’t get our word processor to format things the way we want, and we can’t figure out why. The way these apps work is to code in manipulations to raw text. It is kind of like HTML code in Micro$oft Word and LibreOffice formats. In fact if you have a .docx or .odt file, you an open them in an unzipping tool such as 7zip and see all the nitty gritty, including saved images, etc.

LaTeX is basically programming what a document should look like directly. You have to write code to tell the document where to create a subsection, bulleted list, insert images, even to italicize or bold something, but it (usually) gives you much more direct control over formatting.  All through college, I wrote only a few documents in LaTeX because honestly, it was a pain. It is not WYSIWYG editing at all. After you make changes to the code of your document, you have to compile it into a PDF document before you can see what the end result will look like. I avoided using it because I hadn’t found an editor I liked.  Now I have found a workable setup and I’ve solved a few problems for myself that I think might be helpful for others (as well as my future self).

Firstly, you must install an editor, as well as the compiler tools. There are many editors out there and two compilers.

Editor:

I tested several editors (namely Texmaker, TexWorks) but I settled on using TeXstudio.  Texmaker looks nice, but I had trouble getting it to display a recompiled version of my PDF. Texworks has a much more “Linuxy” feel, as it uses two separate windows to display the code and the resulting PDF.  Again, the winner for me was TeXstudio.

Compiler:

There are two LaTeX compiler setups. TexLive and Miktex. I had used Miktex in the past so I tested out TexLive with this installation.

Setup:

Open TeXstudio, then select “Options–>Configure TeXstudio”  then select the “commands” tab.  Here, we must tell TeXstudio where all the compiler programs live. The main thins to fill out are “LaTeX”, “PdfLaTeX”, “External PDF Viewer”, “BibTex”, and “Biber”.  Don’t worry about the other text in the file paths in my screenshot here, That’s automatically entered by TeXstudio when you select the path. Simply click on the file icon on the right hand side for each of these entries and drive to the compiler installation. Here you see that my texlive installation is directly on my C drive. Miktex can be installed the same way. Then wind your way through the fines until you find the “binaries” (which are the actual executable programs) in the “bin” folder.

texstudio

 

Templates:

Now you can start editing and compiling your paper. You can start from scratch, or if the conference or journal you are submitting your paper to has a template you can download, start there.  In my case, IEEE has templates available for download here. Now I recommend you go through a few tutorials  and play with some files like these before using a full-on journal template just to get your bearings with LaTeX. There are commented things in the template that you can add in (uncomment) and multiple ways of doing things you might want to do, so research is king.  Once you’ve written some of the paper and formatting code, compile it by clicking the “compile and View” button in TeXstudio.compile and display  You might need to compile the bibliography separately. For finer grain compiling options, click the “Tools”menu.

References:

You already know I love Mendeley, but you can actually get Mendeley to export a .bib file.  A .bib file is a list of all your references in a format called BibTex, which you can open in any text editor, even in TeXstudio.  The .bib file Mendeley exports is only as good as the data you entered in Mendeley, so make sure it is correct first! You can enter these reference entries directly into your .tex file (the code  you are writing describing your paper) or keep the references in the .bib file and import that file into your paper.   What is great is that you cite something using /cite{nameOfBibtexEntry} and LaTeX and BibTex do all the rest for you. It will enter the citation in the correct format, then it’ll generate your references section of your paper.  The format,  like MLA, APA, etc, is different for each conference, journal, and even discipline in which you are submitting. You can tell your document which format to use using some simple commands, however the template you download likely already sets you up for the correct format.  To get the name you must use in your /cite{} command, open the .bib file and find the entry you want to cite. The first name next to the @article{ tag is the name to use. for example:

In my bibtex file I have the following entry:

@inproceedings{Rao2003,
address = {New York, New York, USA},
author = {Rao, Ananth and Papadimitriou, Christos and Shenker, Scott and Stoica, Ion},
booktitle = {Proceedings of the 9th annual international conference on Mobile computing and networking – MobiCom ’03},
doi = {10.1145/938985.938996},
isbn = {1581137532},
keywords = {Vehicle,Wireless,ad-hoc,coordinate-based,detection,geographoc,routing,sensornets},
mendeley-tags = {Vehicle,Wireless,detection},
month = {sep},
pages = {96},
publisher = {ACM Press},
title = {{Geographic routing without location information}},
url = {http://dl.acm.org/citation.cfm?id=938985.938996},
year = {2003}
}

In my LaTex file, I might have the following line:

Ad hoc wireless sensor networks can be used to track vehicle locations as shown in /cite{Rao2003}.

Once I “compile and view” this document, it will generate a PDF with references automatically generated and in all it’s two-column perfectly formatted glory…. if all goes right.

DIY Caffeine-Free Cherry Cola

I’m fairly sensitive to caffeine and I love Cherry cola. Being that for some reason soda companies don’t make caffeine-free cherry cola, I decided to make my own. It is very simple and only takes two ingredients.

  1. One can of Caffeine-free soda
  2. About 1/2 teaspoon of Rose-Grenadine cherry syrup. You might need to tweak the measurements to taste. I think this amount tastes exactly like Wild Cherry Pepsi.

You may be tempted to to use the cap of the cherry syrup to measure, and I’ll go ahead and tell that’s a terrible idea. The syrup will dry and make it impossible top open next time. I hope you enjoy!

Capture

 

 

CNC Bottle Opener

bottleOpener6bottle-Open4A good friend of mine celebrated his birthday recently, and I  wanted to make him somethingon a CNC machine as a gift.  My friend brews beer and is an avid cyclist. In fact, his beer is on tap at the local bike shop.  I Figured the best gift would be a customized bottle opener with a few symbols of his interest engraved into the handle.

First, I ordered the Bottle Opener kit from Inventables.com.  I had seen the project online and assumed this kit included the raw parts I could CNC, but instead, the parts were already milled out.  I just had to engrave them and apply a finish to the wood before screwing the wooden parts onto the steel plate.

My wife is great at graphics so I asked if she would draw up something nice for me.  I wanted each wooden piece of the handle to have an image on both sides so my friend would be able to choose what he wanted the handles to display.  My wife gave me 4 good designs to use: one of just my friends name, the other with the word “Brewmaster”  a third with a bicycle with my friend’s initials embedded in the wheels, and finally a logo of the beer my friend brews for the bike shop.  You can see some of those original images below.

bikeLogoSouthMainIPA

I would need to mill a pocket in some scrap wood exactly the size of the wooden blanks of the bottle opener, stick the blanks into the pocket, and then mill out the designs.  This was much tougher than I realized.

 

The DXF file template from inventables of a the original bottle opener was not the same size as the actual wood blanks, so I had to break out the calipers and scale everything up. Secondly, nothing about the wooden blanks was standard.  Each one was a slightly different size and the holes for the screws were in different places.

The process is fairly simple. Take the SVG files of the designs, then import them in some CAM software which will also ask for the size of the endmill (drill bit thingy) and plan a path in XYZ coordinates to mill out the design in the SVG file.  There’s lots of different software out there. A good (but slightly pricy) one is Vcarve. There are others out there as well including some free and open source tools. A good free one is Makercam.  You can actually download makercam to your computer and use it like a regular program, even though it runs in your browser.  Another very simple CAM software is Easel which is made by the people over at inventables. They have lots of projects you can download directly to Easel as well with full settings.  I recommend you doublecheck feedrates, bit size and all that before actually using the designs though.

When I made the toolpaths for this design I used a 1/64th inch endmill to mill pockets for everything, including the text.   I chose this bit because it was small enough to fit into all of the detailed parts of the designs.  I used a pass depth of 0.1 inches, stepover of 0.0061 (which is about 39%).  For my spindle speed, I set it to 12,000rpm with a feedrate and plunge rate both set at 1 inch/minute.  

I placed a wooden blank in the pocket I had previously milled in the scrap board on the machine and began milling the “Brewmaster” design.  It is important to note here that since milling the pocket in the scrap board, I never turned off the CNC machine. This allowed me to keep the same Zero position for my X and Y coordinates between each milling.  If I changed this, then none of the designs would line up correctly with the wooden blanks.    After the first design was milled I realized the design template from inventables was really wrong about where the holes for the screws had been drilled.  So I scaled the design down and tried again.  Luckily I bought 2 of the bottle opener kits, so I had extra parts to use in case of a disaster like this.

bottle-Open2

After about 5 hours of milling, everything was finished. I had to go in and manually clean up the edges of the cuts a little with a razor knife and sand paper. Then I rubbed on a few coats of linseed oil to protect the wood.  Any food-safe finish can be used such as Mineral oil or Olive oil, but I happened to have linseed oil in the garage.  I forgot to take pictures of the final product, but you can see what one of the blanks looks like. I did both sides of each wood blank, each with a different design so he could flip them around.      

Easy Kitchen Backsplash

 

before 1

after

After our first kitchen backsplash experience, my mom wanted to do something similar. Our first project was very involved and required special tools, etc. She wanted to do something simpler. We stumbled on a solution that requires no special tools. The only tools we used were a pair of ordinary scissors.

While roaming the big box hardware stores, we found some neat peel and stick vinyl backsplash tiles.  These were perfect for the job at hand!  They have faux glass relief over printed stones which looks so much like a piece of glass that you can’t tell the difference until you touch it. They only come in two patterns of the same colors.

Tip 1: Get as much variety as you can  in the sheets. We only had two options so we got half with the first pattern and half with the second. 

We also grabbed a few faux pressed tin sheets along with the plastic edging and a corner piece.  We used this behind our stove in our house. It is really easy to install and looks great. It’s also fairly easy to clean as well.  We didn’t realize how useful the edging pieces would be. We ended up edging the entire top and bottom of the backsplash with them.  We also grabbed some silicone and spray adhesive to stick things to the wall.

supplies

tiles  glues

The first step was to match the tiles with the granite my mom has in her kitchen.  This was easy since these big box stores carry a variety of granite. We just held up the tile to the samples of granite and picked what we liked best. The tiles we chose look like a better match in person, for some reason the white balance on my camera ended up making the tiles look more blue than they really are.

matching

When we got back to the house, we started right away with the stove area. My mom wanted to cover the side wall as well as the back with the faux pressed tin. This worked out well because the side wall was exactly as wide as one of the tin sheets.  We used the remainder of the Simple Mat but could have just as easily used the silicone to stick this to the wall. We cut some of the edging with scissors (no special tools required, yay!) and glues that with silicone to the top and front edges of the tin. In the back corner, we used a corner piece made specially for this material. It makes a smooth transition in a 90 degree bend. The back wall was a little wider, so we ended up using more than one sheet of the tin. We used some more edging on the right-hand side to clean up all the edges. Here you can see the finished product. It looks really nice!

stoveArea

We then placed a few sheets temporarily on the wall to see which direction we liked the tiles to run. I thought vertical tiles gave the illusion of more space.

determine orientationThen came the hard part. The tile sheets only come in two different patterns.  In order to make the wall look random, we had to do some cutting.  I’m not sure if vertical tiles made this part easier or harder. I remember at our house, this was the most time consuming portion. We spent just about the same amount of time randomizing the pattern in both cases, but installation of these tiles was WAY faster.

in progressSince the tile sheets come in a specific pattern of a row of thick tiles, then two rows of thinner ones, we split each sheet into 4 pieces.  This allowed us to mix and match not with only the two options we were given, but now we had 8 options to mix and match.

Tip 2: When cutting these sheets, be sure to cut in the center of the grout area to allow yourself the ability to cover overlap and make the grout look seamless.

Tip 3: Before you press the sheets to the wall, spray the wall with adhesive.

Since the sheet didn’t cover the whole wall, we had to add a portion of another sheet on top of the bottom row. The pattern of stone lengths on the sheets forced us to arrange the  in a certain way. We ended up using more sheets than we would have liked because of this. We also ended up replacing a single row of stones, and even in some cases individual stones to keep the pattern random.

To keep all the grout looking seamless, we used metallic sharpies in some of the gaps between the stones before pressing the stones to the wall. Since the grout on the sheets is a silver color, we used the silver Sharpie, but we also ended up using both the gold and bronze in certain areas as well. Hence:

Tip 4: Use Sharpies to hide where the grout doesn’t overlap.

sharpies

After we finished both walls, we wanted to hide the cut stones at the top and the edges. For this we simple bought a lot of extra plastic edging pieces for the faux pressed tin. Being the same as what we used by the stove, it really tied everything together well.  We simply used silicone adhesive to glue these in place.

Tip 5: Use the plastic edging to tie together the whole look.

edging detail

Overall Verdict:

The makers of these tiles did a good job. When you press the grout from one tile to another, the seam disappears almost completely. Also, the stones are made of a flexible rubbery material which is easy to cut with scissors.  This was really easy to work with when we did our second row of these sheets because we had to cut some stones in half. It took no time at all.  I would liked to have seen a little more variety in the stone patterns, but overall it worked out well for us.

I have to say that while it took us a while to do this job, it was nowhere near as tough as the when we used actual tile and grout. I wish I had come across these sheets earlier!  Randomizing the pattern still took just as long, but once you stick the tile on the wall you are done. There’s no grouting to deal with which means no mess or extra work. We also don’t have to seal this material which is usually done after grouting to prevent staining. This stuff is waterproof since it is on a vinyl sheet so it protects the wall just as much as real tile.

Overall, I enjoyed this project MUCH more than real tile. It was cheaper, cleaner, and took fewer steps. The end result looks great. I would argue that for a novice, this is better than using real tile because the grout lines and stones are perfectly straight.  Even using the stones attached to mesh sheets on our first kitchen makeover left room for the stones to wiggle and inconsistent grout widths. This product wins in almost every category so far. If I remember, I’ll post an update in a few months to a year to let you know the long-term results.

 

 

 

 

 

NAND to Tetris Free Online Class at Coursera

If you are interested in electronics and haven’t heard of this class, where have you been?  This class is a great introduction to how digital electronics works and for the first time (as far as I know) they’ve opened it up to the public online. It is free to audit the course and they just started March 14th, so it is still Week 1! Here’s the introduction video for the class which gives a great overview of it.

So why is this class so great? Well it starts off with a single piece of electronic digital logic, think of it as a 2×1 lego piece.  Then you use connect some of these together to build other more functional lego bricks, like a 2×2 brick, then a 2×4 brick, etc. Eventually you end up building your own Central Processing Unit (CPU), then you learn to code it in Assembly language (the lowest human-readable programming language),  then you build up to eventually a full blown computer with keyboard and monitor connections that you can write video games like pong, tetris and slightly more complicated things. That’s about as close to starting from scratch as you can get.  The real name of it is “the Elements Of Computer Systems” but everyone called it “From NAND to Tetris in 12 easy steps”.  NAND is the type of digital logic gate that you start with.

I know it  sounds super hard, but it isn’t!

This class is so well laid out that you can do it in your spare time.

The first half of the book is on their website for free, but you can buy the book for about $30. That’s one of the cheapest textbooks I know of, and it is a really good book to have for reference. The Massively Open Online Course (MOOC) is free to audit, but if you want an official Coursera certificate showing you took it, it’s only $50 or so. Some workplaces let you use that for Professional Development credit. This is some of the most fun PD credit I know of. If you aren’t familiar with MOOCs or Coursera, imagine hundreds or even thousands of people all around the world watching videos that are released about once a week with a lecture and homework assignment. Everyone can communicate in an online forum to help each other out. You can even get your work graded (in some classes). Many courses are free, some you have to pay for. Coursera is one of many places offering these kinds of classes. Heck, MIT and other universities have been posting their courses online for free for years now. MIT will let you earn a fancy certificate too (for a cost).

My tips:  I used Logisim to build circuit and simulate the logic gates, but you don’t have to. All the software you need is available for free on the class webpage. If you are familiar with FPGA devices, you can build this computer for reals on a cheap FPGA development board like this guy. Either a Xilinx board with Vivado to build and simulate or Altera boards (<– warning, I’ve never used this one before) using Quartas software to design and simulate it should work. This little CPU isn’t super complicated. I warn that actually building it on one of these boards is no easy task, you’ll have to design stuff that is not covered in the class to get it to work with your particular board.

Join the class now before they get too far ahead!