This was suggested on NPR's Day to Day today to opt out of getting credit card and insurance offers in an effort to save money while also saving paper.
Go to OptOutPrescreen.com to do this. They'll submit your request to the credit bureaus, and eventually that'll stop creditors and insurers from sending you CRAP.
Personal weblog of Ted Pavlic. Includes lots of MATLAB and LaTeX (computer typesetting) tips along with commentary on all things engineering and some things not. An endless effort to keep it on the simplex.
Tuesday, July 17, 2007
Thursday, July 12, 2007
Skim automatic refreshes and simpdftex
UPDATE: I've updated the script so that it works with OS/X Leopard. See comments for details.The OS X PDF viewer Skim has the ability to automatically refresh files after they have been updated on disk. In Skim version 0.4.1 and below, this was done by polling a file every second to see if it has been changed. In Skim version 0.5 and up, this feature is implemented using kqueue events. This is a much better way of doing things. However, if the file that is open gets deleted and a new file created with the same name, events for that new file will not be received by Skim.
Unfortunately, the script simpdftex that comes with a number of LaTeX distributions (e.g., gwTeX) deletes a PDF before updating it. This means that autorefreshes won't work when regenerating a PDF from its LaTeX source using simpdftex.
So, motivated by the history in a Skim bug report, I've put together a simpdftexnodel script that fixes this problem (based on the 2007/05/07 gwTeX simpdftex). To use this file:
- Place the script somewhere (probably in your PATH).
- chmod the file 0755.
- Make sure that your distillers and TeX program (or at least symlinks to them) exist in the same directory.
- Stop using simpdftex and start using simpdftexnodel.
Wednesday, July 11, 2007
PDFSync inverse searches on Vim for OS X
FINAL UPDATE: See the new post, "PDFSync Inverse Searches in MacVim," for the state of the art on this subject.
WINDOWS USERS: See "Performing inverse searches" from the VIM-LaTeX quick start guide.
I have posted information about this in a number of places [1, 2, 3, 4, 5]. I plan to add something at MacResearch sometime soon too.
The package PDFSync allows users to do "backward searches" or "inverse searches" from PDF viewers like iTeXMac, TeXniscope, Skim, and others. That is, if you generate a PDF with LaTeX (or Plain TeX or ConTeXt), you will be able to click on text in the PDF and have an editor open up and position the cursor at the TeX source code that generated that text. That can be very nice.
There is a related feature for DVI files, but there are very few good DVI viewers out there (TeXniscope comes close), so I just focus on PDFSync).
I use Vim with VIM-LaTeX to do my document preparation. I would like to also be able to use PDFSync. However, while inverse searching is supported in Windows, it is not easily done in OS X.
I found a thread describing how to do inverse searching with AppleScript that issues raw commands to Vim. I decided to take that AppleScript, package it into a bash script, and fix it so that it had no problem handling files with spaces or symlinked files or multiple files with the same base name. The result is this script:
I hope that's useful to someone.
UPDATE 8: Skim 0.6 and up supports spell checking of a PDF. This is a strange feature of a PDF viewer since Skim does not allow you to edit the PDF text directly. However, it makes a lot of sense when inverse searches are supported. After doing Shift+Command+CLICK on the misspelled word, the TeX editor will open up near the line of TeX where the word is found.
UPDATE 7: caveat Vimmer! Inverse searches in Skim are called up with Shift+Command+CLICK. This is fine; however, if you hold Shift+Command too long, the AppleScript for calling up Vim is going to get confused. In other words, be sure to release the modifier keys as soon as possible after the "click."
UPDATE 6: I found information about doing both forward and backward searches with Vim and PDFView (see also: using gotoline.sh). From these, I've made hacks to the VIM-LaTeX scripts for PDFView and other viewers (like Skim and TeXniscope). I will describe these hacks in another post.
UPDATE 5: See Vim Tip #225 and the corresponding wiki entry for information about both backward and FORWARD searches in Vim. I also found a nice LaTeX tools script for Vim that has forward searching built in. I found these pages linked from a page on xdvi inverse searches.
UPDATE 4: Very trivial updates have been made in a 1.03 version of this script.
UPDATE 3: I have posted a 1.02 version of this script. The changes are fairly trivial, but you might be interested in checking it out.
UPDATE 2: This script is now a part of the Skim wiki.
UPDATE 1: I have mirrored this post at my web site.
WINDOWS USERS: See "Performing inverse searches" from the VIM-LaTeX quick start guide.
I have posted information about this in a number of places [1, 2, 3, 4, 5]. I plan to add something at MacResearch sometime soon too.
The package PDFSync allows users to do "backward searches" or "inverse searches" from PDF viewers like iTeXMac, TeXniscope, Skim, and others. That is, if you generate a PDF with LaTeX (or Plain TeX or ConTeXt), you will be able to click on text in the PDF and have an editor open up and position the cursor at the TeX source code that generated that text. That can be very nice.
There is a related feature for DVI files, but there are very few good DVI viewers out there (TeXniscope comes close), so I just focus on PDFSync).
I use Vim with VIM-LaTeX to do my document preparation. I would like to also be able to use PDFSync. However, while inverse searching is supported in Windows, it is not easily done in OS X.
I found a thread describing how to do inverse searching with AppleScript that issues raw commands to Vim. I decided to take that AppleScript, package it into a bash script, and fix it so that it had no problem handling files with spaces or symlinked files or multiple files with the same base name. The result is this script:
Copy that script in a place (preferably in your PATH) like#!/bin/bash
filename="$1"
lineNum="$2"
[ "${filename:0:1}" == "/" ] || filename="${PWD}/${filename}"
exec osascript \
-e "set ESC to ASCII character of 27" \
-e "tell application \"Vim\" to activate" \
-e "tell application \"System Events\"" \
-e "tell process \"Vim\"" \
-e "keystroke ESC & \":set hidden\" & return " \
-e "keystroke \":if bufexists('$filename')\" & return " \
-e "keystroke \":exe \\\":buffer \\\" . bufnr('${filename}')\" & return " \
-e "keystroke \":else \" & return " \
-e "keystroke \": edit ${filename// /\\\\ }\" & return " \
-e "keystroke \":endif\" & return " \
-e "keystroke \":${lineNum}\" & return " \
-e "keystroke \"zO\" " \
-e "end tell" \
-e "end tell"
and chmod it 0755. That is, do/usr/local/bin/gvim-pdfsync
Then you can use the script likechmod 0755 /usr/local/bin/gvim-pdfsync
where %file is the name of the file to be opened and %line is the line to place the cursor on. So, for Skim, you would put in your LaTeX (or Sync) preferences under "PDFSync" support:gvim-pdfsync "%file" %line
Preset: CustomAfter configuring Skim, BE SURE TO CLICK AWAY FROM THE TEXT BOXES before closing the configuration. For example, click on one of the other tabs. Otherwise, the dialog box may not record your changes to the last text box you changed.
Command: gvim-pdfsync
Arguments: "%file" %line
I hope that's useful to someone.
Labels:
AppleScript,
backward search,
DVI viewers,
examples,
forward search,
GVim,
inverse search,
iTeXMac,
iTM,
latex,
macosx,
MacVim,
OS X,
osx,
PDF viewers,
scripts,
search,
Skim,
tex,
TeX/LaTeX,
texlatex,
TeXniscope,
typesetting,
Vim,
VIM-LaTeX,
xdvi
Women more dominant than men
WebMD : Wives Wield Decision Power in Marriage
Balance of Problem-Solving Power Weighs in Favor of Women
Men may rule the world but women rule the roost, according a new study that shows women wield considerably more decision-making power than men within marriages.
Researchers found that wives, on average, displayed more power than their husbands during problem-solving discussions, regardless of who brought up the topic of discussion.
And it’s not simply a case of women talking more than men.
“It wasn’t just that the women were bringing up issues that weren’t being responded to, but that the men were actually going along with what they said,” researcher Megan Murphy, assistant professor of human development and family studies at Iowa State University, says in a news release. “They were communicating more powerful messages, and men were responding to those messages by agreeing or giving in.”
“There’s been research that suggests that’s a marker of a healthy marriage – that men accept influence from their wives,” Murphy says.
Labels:
dominance,
marriage,
men,
power,
relationships,
typography,
WebMD,
women
Tuesday, July 10, 2007
TeX Reference Card (and others)
UPDATE 3: I found the source of the popular LaTeX cheat sheet. It includes a PS version, a PDF version, PNG views [Page 1, Page 2], and the LaTeX source. It's nice that the source is available. That makes it easier to shift from A4 to letter paper and back.
UPDATE 2: More reference cards can be found in the follow-up to this message.
UPDATE 1: Check out refcards.com and the old version old.refcards.com. There are lots of useful cards, including some of the ones I linked below. This TeX card and this Vim card look familiar. There are other EMmacs and Vim cards in the editors section. There is also a typesetting section that includes a LaTeX cheat sheet.
The Brown University Center for Fluid Mechanics, Turbulence and Computation (CFM) has a collection of computing tutorials. Buried in there somewhere is a useful Plain TeX reference card in PostScript format. I have generated a PDF version of this reference card.
I stress that this is a Plain TeX reference card, and so there are different ("better"?) ways of doing some of these things using other LaTeX macros (note TeX vs. Plain TeX vs. LaTeX differences: [1, 2, 3, 4, and more]). However, this is still a very useful reference card. It prints out as two landscape-oriented pages (weirdly sized: 11.7" x 8.3"). I plan on printing this out and taping it next to my desk at the office. I also found a useful longer Plain TeX reference sheet that may be helpful to some people. Of course, there are even longer Plain TeX reference documents also available.
Oh, I also found this AUC TeX reference card PDF with available source code. I don't use AUC TeX (I favor VIM-LaTeX), but maybe someone who does could use this. FYI, AUC TeX is a package for EMacs providing extra support for LaTeX (and others).
Speaking of Vim:
- Here's a cool set of multilingual Vim quick reference cards (again, PDF with 2 landscape-oriented pages) that include their sources and an HTML version.
- Here's a similar Vim quick reference card (PDF).
- Here's yet another Vim quick reference card (PDF).
- Finally, here's VIM-LaTeX's quick start introduction document.
Labels:
AUC TeX,
auctex,
Emacs,
latex,
Plain TeX,
productivity,
quick reference,
refcards,
reference,
reference cards,
tex,
TeX/LaTeX,
texlatex,
tutorials,
typography,
Vim,
VIM-LaTeX,
XEmacs
Correction: TeXnicians (and TeXackers) over TeXperts
I thought this correction to a Brown university TeX tutorial was really cute.
I like you page on TeX, but had to comment that TeX is properly pronounce like the Tech in Technology (Knuth "The TeXbook" page 1) and thus the proper name for a TeX hacker is a TeXnichian not a TeXpert as you stated on your page (http://www.cfm.brown.edu/tutorials/tex.html) in fact the first exercise in the TeXbook is "After you have mastered the material in this book will you be: A TeXpert or a TeXnichian?" to which the correct answer is "A TeXnician (underpaid); sometimes also called a TeXacker." (Knuth, the TeXbook)
Please change this grievous error.
Thanks,
Christopher A Craig (ccraig@cc.gatech.edu)
Labels:
Brown university,
corrections,
funny,
Knuth,
latex,
tex,
TeX/LaTeX,
TeXacker,
texlatex,
TeXnician,
TeXpert,
typography
Monday, July 09, 2007
\cref* and \crefrange*: temporarily disable cleveref hyperlinks
UPDATE:I've e-mail chatted with the author of cleveref, and it sounds like the changes below (the * macros and the new defaults) may get built into the next release. So that's exciting.The author has recently sent me new versions of cleveref that include these suggestions. Only time will tell when it's on CTAN. So that's exciting.
I've also had a chance to reflect on the poorman option of cleveref. It's an interesting idea. When loaded with this option, cleveref will generate a sed script that the author can use on the source files that will change each of the cleveref macros into old-fashioned references with everything typed out. That is, if you have a journal that does not support cleveref, you run sed on your source code before uploading it, and your journal works with the resulting files that are stripped of cleveref code. That's pretty clever.
I think that by the 1.0 version of cleveref package, it will be ready to replace hyperref's \autoref macro.
One thing that hyperref gives you that cleveref does not are starred versions of the referencing commands that disable hyperlinks. For example, in hyperref, \ref* and \autoref* work exactly like \ref and \autoref but are not hyperlinked. That's nice. Of course, there is no \Autoref or \autorefs or \Autorefs.
A major nice thing that cleveref does is let you format your expanded references with more detail than hyperref. For example, you can make an equation reference expand as "Equation (1)" where the "1" gets linked while having a figure reference expand as "Fig. 1" with the whole "Fig. 1" linked. Of course, this assumes that you've loaded both cleveref and hyperref, like this:
\usepackage{hyperref}
\usepackage[hyperref]{cleveref}Additionally, cleveref does give the equivalent of those special versions of \autoref. cleveref supports single and multiple references, including reference ranges.So consider the following, which gives you all the nice stuff about cleveref but also adds starred versions of its macros:
So there you go! That nearly beats \autoref!\makeatletter
% \cref and \cref*
\let\origcref\cref
\newcommand{\crefstar}[1]
{\begin{NoHyper}\origcref{#1}\end{NoHyper}}
\renewcommand{\cref}{\@ifstar{\crefstar}{\origcref}}
% \crefrange and \crefrange*
\let\origcrefrange\crefrange
\newcommand{\crefrangestar}[2]
{\begin{NoHyper}\origcrefrange{#1}{#2}\end{NoHyper}}
\renewcommand{\crefrange}
{\@ifstar{\crefrangestar}{\origcrefrange}}
% \Cref and \Cref*
\let\origCref\Cref
\newcommand{\Crefstar}[1]
{\begin{NoHyper}\origCref{#1}\end{NoHyper}}
\renewcommand{\Cref}
{\@ifstar{\Crefstar}{\origCref}}
% \Crefrange and \Crefrange*
\let\origCrefrange\Crefrange
\newcommand{\Crefrangestar}[2]
{\begin{NoHyper}\origCrefrange{#1}{#2}\end{NoHyper}}
\renewcommand{\Crefrange}
{\@ifstar{\Crefrangestar}{\origCrefrange}}
\makeatother
Why nearly? Unfortunately, cleveref breaks some Springer journal document classes. The author also doesn't claim that it does or does not support item labels (he mentions that it may or may not, so it's uncertain). Finally, I don't like the default choices for some of the label formats. For example, you shouldn't ever start a sentence with an abbreviation, and the parentheses that go around equation numbers should be surrounded by \textup to keep them from looking silly in an italicized theorem environment. That's why I'm saying that by the 1.0 version (it was 0.6 since June of 2007), it should be a pretty awesome package... especially if the modifications above are built into the package.
Labels:
autoref,
cleveref,
cref,
cross-references,
hyperref,
latex,
references,
tex,
TeX/LaTeX,
texlatex,
typesetting,
typography
Saturday, July 07, 2007
MacResearch - Online Community for OS X in Science
This might have potential...
MacResearch - Online Community and Research for Mac OS X in Science
MacResearch - Online Community and Research for Mac OS X in Science
MacResearch.org is an open and independent community for scientists using Mac OS X and related hardware in their research. It is the mission of this site to cultivate a knowledgeable and vibrant community of researchers to exchange ideas and information, build a community knowledge-base, and collectively escalate the prominence of Apple technologies in the scientific research community.
Labels:
Apple,
macosx,
MacResearch,
OS X,
osx,
research,
typography,
web
Breathing is carbon neutral, asshole
It's not uncommon to hear people say things like, "Carbon neutral? What's that? Wouldn't you have to stop breathing? <huh huh> <huh huh>"
The carbon in the carbon dioxide that you exhale is a product of cellular respiration inside your cells. It comes from breaking down sugar (a carbohydrate). The process liberates the carbon from the sugar so that it can bond with the oxygen that you inhale to form carbon dioxide and water (e.g., urine or "pee"), and this releases energy since carbon would much rather be a part of carbon dioxide than sugar. This energy is what you use to go about your day and say statements like the above.
So where does the sugar come from? It what is produced in the photosynthesis that goes on in plants. Photosynthesis uses energy from the sun to reshuffle water and carbon dioxide into oxygen and sugar.
That's right. The carbon you exhale comes from sugar that could not have been made without pulling carbon out of the air.
So that's why breathing is carbon neutral.
This is also why combustion, which is related to cellular respiration, of pure biofuels (hydrocarbons) is POTENTIALLY carbon neutral (see notes about sustainable yeilds); the carbon in those fuels was originally pulled out of the air by a plant somewhere, and hopefully more plants will pull it out of the air after combustion. Of course, there are lots of other things involved in combustion (e.g., processing and transporation of biofuels as well as the consumption that goes on in the process of burning those fuels) that are not carbon neutral (and, again, there's that issue of burning so many plants that you don't have any left to take the carbon out of the air; again, see sustainable yield).
You should consider these things when you think about livestock as well. Breathing does not prevent something from being carbon neutral.
So what isn't carbon neutral? If you are releasing carbon that did not (recently) come from a plant source, you are probably not being carbon neutral. Burning fossil fuels is liberating carbon that has been buried for (hundreds of) millions of years. This is why the word fossil is used. This carbon would have stayed buried if it was not for human intervention. This causes a stability problem on the surface of the earth. The carbon cycle gets out of whack because that extra carbon does not go back to its source. In fact, the only way to get that carbon back to where it came from is to have a mass extinction and then millions of years of geological processes.
So that's the scoop on carbon neutrality.
The carbon in the carbon dioxide that you exhale is a product of cellular respiration inside your cells. It comes from breaking down sugar (a carbohydrate). The process liberates the carbon from the sugar so that it can bond with the oxygen that you inhale to form carbon dioxide and water (e.g., urine or "pee"), and this releases energy since carbon would much rather be a part of carbon dioxide than sugar. This energy is what you use to go about your day and say statements like the above.
So where does the sugar come from? It what is produced in the photosynthesis that goes on in plants. Photosynthesis uses energy from the sun to reshuffle water and carbon dioxide into oxygen and sugar.
That's right. The carbon you exhale comes from sugar that could not have been made without pulling carbon out of the air.
So that's why breathing is carbon neutral.
This is also why combustion, which is related to cellular respiration, of pure biofuels (hydrocarbons) is POTENTIALLY carbon neutral (see notes about sustainable yeilds); the carbon in those fuels was originally pulled out of the air by a plant somewhere, and hopefully more plants will pull it out of the air after combustion. Of course, there are lots of other things involved in combustion (e.g., processing and transporation of biofuels as well as the consumption that goes on in the process of burning those fuels) that are not carbon neutral (and, again, there's that issue of burning so many plants that you don't have any left to take the carbon out of the air; again, see sustainable yield).
You should consider these things when you think about livestock as well. Breathing does not prevent something from being carbon neutral.
So what isn't carbon neutral? If you are releasing carbon that did not (recently) come from a plant source, you are probably not being carbon neutral. Burning fossil fuels is liberating carbon that has been buried for (hundreds of) millions of years. This is why the word fossil is used. This carbon would have stayed buried if it was not for human intervention. This causes a stability problem on the surface of the earth. The carbon cycle gets out of whack because that extra carbon does not go back to its source. In fact, the only way to get that carbon back to where it came from is to have a mass extinction and then millions of years of geological processes.
So that's the scoop on carbon neutrality.
Aurora: Ribbit all grown up
I just found out that Ribbit, the program that gave LaTeX support to Microsoft® Word (on Microsoft® Windows), has changed its name to Aurora and has lots more features. From its web page:
There's a 30-day free trial. After that, Aurora is $45 for regular users and $35 for academic users. If you don't have MiKTeX (or some alternative) installed, it can install a free micro version for you.
Other notable examples of Windows applications with LaTeX integration include AbiWord, OpenOffice (see OOoLatex), and TeXmacs.
My LaTeX-using colleagues would want me to reminder the reader that if you know enough LaTeX to be entering equations using it, you probably should just be using LaTeX directly. Why fake it? Despite Aurora's claim that it is "even better than the real thing," it's a distant second at best. That being said, it is SO much better than the Microsoft® Equation Editor, which should absoultely never be used.
In short, Aurora brings to Windows what a countless many applications (e.g., LaTeX Equation Editor) bring to OS X.
- No more mouse-hunting for symbols—enter great-looking math quickly and efficiently using the standard language of scientific typesetting.
- Express any scientific concept from mathematics, computer science, chemistry, engineering, and many other areas.
- Full integration with Microsoft® Word, PowerPoint®, Visio®, and Excel®.
- Built-in LaTeX document converter.
- Advanced support for equation numbering.
- Works with any Windows application that has an “Insert Object...” function or lets you paste images.
There's a 30-day free trial. After that, Aurora is $45 for regular users and $35 for academic users. If you don't have MiKTeX (or some alternative) installed, it can install a free micro version for you.
Other notable examples of Windows applications with LaTeX integration include AbiWord, OpenOffice (see OOoLatex), and TeXmacs.
My LaTeX-using colleagues would want me to reminder the reader that if you know enough LaTeX to be entering equations using it, you probably should just be using LaTeX directly. Why fake it? Despite Aurora's claim that it is "even better than the real thing," it's a distant second at best. That being said, it is SO much better than the Microsoft® Equation Editor, which should absoultely never be used.
Subscribe to:
Posts (Atom)

