# Tag Archives: PDF

## Attach source to PDF when exporting in Org-Mode

I am a strong advocate in keeping the source of everything.

However, a source can easily be lost if it doesn’t follow the document. In LaTeX, there’s a package to attach a file to a PDF (like when you attach a file to an email). By doing so, the source will follow the PDF even if the common reader have no clue what it’s for, or even how to use it.

Here is how I attach my org source to every document I export to PDF:

;; Include the source file for every exported PDF (org-mode)
"Add the source (org file) to the resulting pdf file"
(let ((filename (buffer-name)))
(set-buffer latex-buffer)
(while (re-search-forward "\\\\usepackage{.+}" nil t)); go to the end of packages
(insert "\n\\usepackage{attachfile2}"); the package needed to attach files
(when (re-search-forward "\\\\end{document}" nil t)
(forward-line -1)
(insert
(concat
"\\vfill\n"
"\\footnotesize\n"
"The source of this document is an Org-Mode file attached here:"
"\n\\attachfile"
"{" filename "}")))
(save-buffer)))))


Simply add this code to your .emacs and you’re good to go! Please note that is simply a quick hack. Hopefully an org-mode developper will make a more integrated approach.

## Once upon a time, in a strange land…

Ah, the strange land that is HVAC. It looks as if it has been frozen in time, with some glimpse anachronistic piece of technology. The best comparison would be with the steampunk genre, where technology continued to evolve, but (almost) solely with steam power.

One can quickly see the downfalls that such technological path would have brought in the real word. (Mechanical computers? Yeah, right, if you don’t mind it being gigantic and slower than a snail.) But at least steampunk’s machine look cool.

How is the building world so different than every other field? Somehow, those in the field convinced themselves that giving info about their product was a bad idea. Instead, they hold onto it as much as they can.

## You would think price is important

If I want a new micro-controller for a project, I can go at mouser, or digikey, or even octoparts (a search engine for electronics parts! How cool is that!) and get the price instantly. And I mean it: Instantly. I can even see what I could save by buying in bulk! For ordinary computer components, one quick visit to futureshop or tigerdirect and I have everything I need.

Now, enter the weird land of HVAC… “You want a globe valve? No problem, just tell me want you want and I’ll send you a quote.” Hmmm… how about “NO!”? At least give the list price on your site! When I design a system, I don’t have time to send an email to every would-be valve-seller! Here’s my work flow: I find the different characteristics needed, hump on google and find the best price/quality I can in a timely manner. If you don’t show me your price, I will move along and go to the next website. I don’t have time for your silly games.

## Datasheet

How hard can it be to host a datasheet? My previously mentioned mouser.com host thousands of them! Mark my words: if I can’t see what I’m buying, I will not buy. Take Siemens for example, a successful international company. Good luck finding anything interesting on their website. As of the writing of this article (2011-11-25), the online catalog is broken. How can I get the precious info I’m seeking then? The only way is to download a monolithic PDF file. Let’s give it a try, shall we?

Microsoft VBScript runtime error '800a005e'

Invalid use of Null: 'Replace'

/gip/general/dlc/dlc_get_singlefile.asp, line 29


SonOfABitch! Don’t try to get fancy websites script if you can’t handle them! I would be a thousand time happier with a simple working HTML link. In addition, these scripts messes with download programs such as wget. By trying to get fancy, your are crippling your users!

Ok. I will calm myself. Take a deep breath… Even If I had the PDF catalog, what should I do with it? Scroll mindlessly like a monkey for hundreds of pages? If I’m lucky, the text will be searchable. However, in these catalogs, valves and actuators are in different sections, so I have to constantly go to one section, then come back and check if the components are compatible. To avoid this, I’ll have to open a second time the same document and place the windows side by side. (If I need a third component, I kill myself.) Finally, when I’ve made my choice, I have to keep the datasheet in order to transmit it to my client. Of course, I won’t send them the whole catalog. I have to manually print the PDF by carefully entering each pages in the print prompt. All of this could have been avoided by a great website design. One that lets you browse all the products as you would in a database. One that combines the datasheet of multiple components if needed and offer you the finished document. One such website almost exist. Belimo‘s website isn’t perfect, but is so, so, soooo much better than others I’ve seen.

And where do you think I start my searches when I need an actuator or a control valve?