Tuesday, December 16, 2008

 

New Blog Address

I am going to try out the Blogger hosting service, since it allows much faster publshing. The new address of this blog will be:

http://rasmusen1.blogspot.com/

Labels:

 

To view the post on a separate page, click: at (the permalink). 0 Comments Links to this post

 

Single-Click Double Click Stuck Problem

On my Dell computer, running XP, the mouse single-click was stuck acting like a double click and opening files. Redoing the setting in Control Panel didn't help. I checked Geeks to Go and it suggested trying a different mouse, which did work. I was using a Dell mouse.

Labels:

 

To view the post on a separate page, click: at (the permalink). 0 Comments Links to this post

Thursday, December 11, 2008

 

Web Rudeness


A post at Baylyblog inspired me to commment thusly:

'm glad Baylyblog is doing its bit to try to bring civility to the Web. Anonymity isn't the only reason the Web has so much rudeness. The other reason is that we tolerate rudeness. We don't have to. If someone sends me a web comment that would cause me to punch him, admonish him, or walk away from him if it were said to me in person, why should I tolerate it any more just because it is on a computer? The blogger at least has the ability to delete the comment. It is like painting over grafitti. And as with graffiti, it not only reduces the amount of ugliness in the world; it reduces the temptation for the sinner.

Labels: ,

 

To view the post on a separate page, click: at (the permalink). 0 Comments Links to this post

Tuesday, December 9, 2008

 

Trackback in Blogger

Blogger does not support Trackbacks. To fix that, click on first Greasemonkey and then Stephen Weber. Andrew Beard pointed me to this, but the Singpolyma site he points to is broken.

Labels:

 

To view the post on a separate page, click: at (the permalink). 0 Comments Links to this post

Thursday, December 4, 2008

 

The Miktex Tex Processing Freeware Program

This is a post from 2005 that I'll copy here, with the old comments as part of the post.

The free Miktex (http://www.miktex.org/) looks to be an excellent latex and tex Windows processor program. I’ve been using SWP, and putting figures in looks to work better in Miktex. Miktex gets PDF’s right, which my version of SWP does not always do, and it processes straight from myfile.tex to myfile.pdf. On the other hand, it has some problems, noted below, which make it unhandier to use.

(1) I have a suggestion for the standard installation instructions: say more about the Windows command prompt. I haven’t used it for years, though I happened to remember it was in Accessories. Also, the user should know that he can change the default directory in teh command prompt to wherever he keeps his tex input files– say, d:/smith/latex-input, using the Properties (reachable by right clicking the command prompt).

(2) The command prompt requires you to type in all your commands, which is burdensome if they are long, e.g.,

pdflatex D:\_home\_HomeWD\INCOMING\FIGURECOPY/myfilewithalongname.tex

You can’t copy and paste in the usual way with CTRL-C and CTRL-V. What you can do, though is to copy to the clipboard with CTRL-C and then paste by rightclicking on the Command Prompt program and choosing PASTE.

I will put a comment line like this at the start of my tex files:

% pdflatex chap07_MoralHazard.tex

then I can copy all but the % part and paste it into the command prompt, and it will process chap07_MoralHazard.tex and write to chap07_MoralHazard.pdf

(3) Something better would be a graphic interface to replace the command prompt. I don’t know how to write such an interface, but here is what it would be: It would be simple: just a window in which the user could do two things:

1. Browse and choose a tex file to process, e.g., myfilewithalongname.tex, instead of having to type in the full name in the command prompt, and instead of having to have it in the command prompt’s directory.

2. Issue the processing command— most simply “latex myfilewithalongname.tex”, or “pdflatex”, or others that might be useful. There should be two to five choices, and the user would check the box of the command he wants to use.

The command would take the file from (1) and put the output in the same directory as the input.

The interface could be fancier, but that covers what the user needs every single time he uses Miktex, and it would save a lot of tricky typing.

(4) Miktex is fouled up by carriage returns, even ones that are not hard breaks. Thus, before I tex my files using it I need to strip off all the carriage returns, thus making all my equations, nicely separated into separate lines for visibility, into unreadable paragraphs. The solution, from Alan, the commentor below, is to make sure my input file is in UTF-8 Ascii, not ANSI. What I do in Textpad is (a) make sure it is set to UTF-8 as the standard encoding, (b) copy the entire file, and then close the file, (c) open a new file and paste what I copied, (d) save the new file with the old file’s name, on top of it. That converts from the ANSI coding I initially had to the UTF-8.

(5) The command which takes us straight from myfile.tex to the output myfile.pdf produces pdf files which are not crystal clear on the screen. The commands

latex -job-name=chap07_MoralHazard temp.tex dvips -Ppdf chap07_MoralHazard.dvi

do better, but then I can’t use JPG files in my input.

(7) Will I switch from SWP to Miktex? Money is not really a concern for me, but usability is. I’ll try it for a while and see.

13 Responses to “The Miktex Tex Processing Freeware Program”

  1. Alan Says:

    Eric,

    I am not a user of SWP myself, but I do believe there are a number of ways in which SWP deviates from “standard” LaTeX (I’ve had these cause problems when sharing files with SWP users). MiKTeX, along with TeXLive, teTeX, and most other TeX distributions will have the same issues you describe here with respect to SWP. That said, allow me to attempt to address a few of your points:

    (2) and (3): I have rarely invoked LaTeX from the command line, whether using MiKTeX or another LaTeX distribution. Many, if not most, LaTeX users use an editor that handles the direct interaction with the LaTeX executable and friends. SWP is really nothing more than a very fancy LaTeX front-end. While the editors that most folks use are not as fancy, they do handle all of the command line work and make invoking LaTeX transparent to the user. Some popular Windows-friendly text editors than can be configured in this way are WinEdt (shareware), TeXnicCenter (freeware), and Emacs with appropriate plug- ins (open source), though there are a number of others.

    (4): Not sure why you’re experiencing problems with hard carriage returns. My files are chock full of them and MiKTeX handles them without complaint, so I suspect SWP is to blame here. Perhaps it is using an odd end-of-line character? Open one of your SWP files in a plain text editor (Notepad — but not Wordpad — will do) and see if it is read correctly, or if garbage appears at the end of the line. Alternatively, write a dummy LaTeX file with hard carriage returns using Notepad and see how it goes. Finally, I understand there’s a way to export files from SWP in a way that is supposed to make them more compatible with “standard” LaTeX systems — if true, you might try exporting your files in this manner before running them through MiKTeX.

    (5): The problem here is that pdfLaTeX is using Type 3 Postscript fonts instead of the more desirable Type 1 fonts. Since I don’t use pdfLaTeX myself, I can’t tell you for sure how to change it (though installing the cm-super package via the MiKTeX package manager might do the trick). A search of the usenet newsgroup comp.text.tex (via groups.google.com) should get you an answer pretty quickly, though.

    (6): MiKTeX does not recognize \tag because it is not part of standard LaTeX. To use it, you must call \usepackage{amsmath} in your preamble. Apparently, SWP does this for you whether you like it or not. Fortunately, amsmath is distributed with MiKTeX and virtually every other LaTeX distribution, so it should already be installed.

    (7): SWP insulates you from some of the low-level LaTeX drudgery at the cost of making your .tex files a little less portable. Another side-effect of this insulation is that you don’t always know what’s going on “behind the scenes,” as you saw when you tried to use the \tag command without \usepackage{amsmath}.

    Alan

  2. Administrator Says:

    Thanks!

    Adding \usepackage{amsmath} makes the tag command work again for equation special labelling.

    I still have the problem with line returns. It isn’t SWP– I actually write my latex files in Textpad, a text editor, and then used SWP only as a front-end— hence its inferiority to Miktex for me, since I don’t use most of SWP’s special features anyway. Also, the line return problem occurs when there are line returns in equations.

  3. Administrator Says:

    I updated the original post in light of Alan’s comments, so his comments won’t apply well any more.

  4. Stefan Moebius Says:

    On (3): Maybe a tool modelled after OggDrop (http://www.vorbis.com/software.psp?pid=2) would be what you need? You just grab the .tex or .mp or .dvi file and drag it to a floating icon. Dropping it would invoke the correct program based on file type and configuration (e.g., pdflatex or latex).

  5. Administrator Says:

    Yes, Stefan. Oggdrop is just for sound files, it seems. What would be a nice utility is a program that lets you say that any file dropped into an icon gets sent to the command line and processed using a particular command, with the output returned to the directory of the original file. I tries looking in the freeware site http://www.nonags.com/nonags/cl.html but couldn’t find such a thing.

  6. Harald Oehlmann Says:

    I use Textpad too (but pdftex to generate postscript directly). You can invoke the pdftex processor from the editor by assigning for example Cntrl-1 to invoke latex. I use: Menue: Config->Settings:Extras -> Add Program and edit properties: Parameter: $File

  7. Stefan Grosse Says:

    I also must say that using command prompt is a very unusual way for working with miktex. The perfect editor for me is winedt where you just have to push a button for texifying and pdf-texifying.

    With the carriage return- I noticed that there is a problem by opening a book chapter from your page. Winedt corrected it but I did not try to compile since there was a lot of scientific word stuff inside.

    If you like to use scientific workplace with miktex as LaTeX distro see the notes of Prof. Söderlind: http://home.tiscalinet.ch/paulsoderlind/Software/Software.html

    By the way the game trees do not look that great there is a package of Martin Osborn using pstricks to improve that: http://www.chass.utoronto.ca/~osborne/latex/index.html

  8. Misha Says:

    Actually, I have another suggestion on how to improve MiKTeX. It takes relatively long to load all the definitions and packages every time TeX starts. Wouldn’t it be nice if there were a running instance of TeX, that would remember all those .sty files. In this case, LaTeX would just invoke that process rather than loading the definitions again.

  9. Administrator Says:

    Thanks, everyone, for these very useful comments. Harald Oehlmann’s suggestion seems to work perfectly, though I had to set it up a bit differently than he suggested, perhaps because of my version of Textpad. Here is what I’ve just added to my latex notes in http://rasmusen.org/x/myfiles/latex-rasmusen.txt

    RUNNING MIKTEX FROM THE TEXTPAD TEXT EDITOR

    Harald Oehlmann told me how to do this. Here are precise instructions for running miktex from Textpad 4.7.3. Maybe other text editors have similar features.

    1. Click on Configure, then Preferences, then Tools.

    2. In Tools, click ADD, then choose DOS Command. A box will appear, and write “pdflatex a file” as a title for the tool. Then click APPLY.

    3. Click on the + sign next to Tools. Several tool titles will appear, including your new “pdflatex a file”. Click on it, and a Properties box will appear with various things for you to type in.

    4. Under Parameters, type in “pdflatex $File”. Make sure that under Initial Folder,there is $FileDir. Make sure none of the options boxes are checked, including CAPTURE OUTPUT. Click OK when you’re done.

    5. Load a tex file into Textpad. To process it, click on Tools from the front set of headings (File, Edit, Search, View, Tools, … ) Then click on “pdflatex a file”, which you will have added.

    6. The Command Prompt window will appear, and the tex file in textpad will be processed. The PDF file will be generated as output.

    I hope I didn’t miss any steps.

  10. Bob Says:

    First, hello Eric, from the distant past. We knew each other at MIT.

    Here’s another simple way to compile a .tex file using the MikTeX texify command. (I have to admit I live at the command prompt. Just a matter of preference. I also live in Emacs!) I turn .tex into .pdf using this batch file:

    texify %1.tex dvips -tletter -Ppdf -G0 %1 call ps2pdf13 %1.ps %1.pdf

    You put these commands in a file called “makepdf.bat”, and place the file somewhere in your path. Then if you have a .tex file called “foo.tex”, at the command prompt you type

    makepdf foo

    and you will end up with a pdf version of your document.

  11. bob wolfe Says:

    Eric,

    I used to be an avid fan of SWP. I now use Miktex.

    1) I used to run into problems with carriage returns. They all arose when I shared files with colleagues who used UNIX. They have now all switched away from UNIX (despite them calling me all kinds of nasty names a decade ago for using Windows) so the problem is now fixed.

    2) SWP is not standard. I use a lot of math. \mbox does not work right in SWP. That prevented me from sharing with lots of colleagues who use standard latex. I think there are other things that are not standard in SWP. That makes it a pain to collaborate.

    3) SWP consultants used to have an attitude. Maybe the attitude is now fixed, so I apologize for any aspersions suggested by these comments. When I asked for work arounds on how to solve the problem of working with colleagues who use standard latex, the SWP consultants were extremely defensive in their responses. Not vulgar, but close to it. Almost as bad as the Apple community used to be towards Windows users.

    4) The real raison d’etre for SWP is its integration with Maple. Beautiful. Wonderful. I love the concept. Maple does simple math very well, up to algebra and closed form calculus. It does not do hard problems well at all, such as infinite sums. So, you have to do the math to see if it is right anyway, and then it is about as easy to type it in yourself in latex as to use the simplify verbs available in maple. If you are teaching calc 101 or high school algebra, then SWP is great. If you are teaching quantitative graduate courses, then be careful with SWP.

  12. Maciej Radziejewski Says:

    Your idea of having a simple IDE (point (3) of your original post) is already implemented in Windows! Well, almost.

    You can browse your files using Windows Explorer. Then you can compile (texify) by right-clicking a TeX file and selecting an appropriate command from the context menu. You just have to define a context menu action for .tex files. I usually define “Latex”, but you may prefer to use pdfLatex or to call some batch file for more complex processing.

    Defining actions takes some knwoledge and it may be a good idea to suggest it to Christian Schenk to do it in the installer as an option (if it is not already there). You can define actions using the “file types” tab (in WinXP accessible from the explorer window - Tools - Options) or using regedit (dangerous if you misuse it).

  13. Eric Wilson Says:

    Maybe I’m missing something here. Why not use WinEdt? It’s a great editor, designed particularly for LaTeX. TexShop is ok for macs.

Labels: ,

 

To view the post on a separate page, click: at (the permalink). 1 Comments Links to this post

Saturday, November 15, 2008

 

Card Party Nameplates

Here is an MS-WORD document that makes card party nameplates that one can cut out and fold over.

Labels:

 

To view the post on a separate page, click: at (the permalink). 0 Comments Links to this post

Wednesday, August 20, 2008

 

Removing Duplicate Email Addresses in an Address Book

[cross posted from the IU Computers Blog]

After searching for a free easy program to do this for me, a Mozilla Thunderbird user, I decided the best way is to use Excel, like this: First, export the address book to *.csv comma-separated format. From: http://office.microsoft.com/en-us/excel/HA010346261033.aspx Open the file in Excel. Select all of it. Do DATA then FILTER, then ADVANCED FILTER, then check off UNIQUE RECORDS ONLY. That will show only the unique records. Then COPY what is showing to the clipboard. Go back to DATA then FILTER then ADVANCED FILTER then Do NOT check off UNIQUE RECORDS ONLY. Then the whole file will show. Press the DELETE key to delete all the rows. Then do CTRL-V to paste in the uniquely filtered rows. Then SAVE the file, and all the duplicates will be gone. Then import the *.cxv file back into the email address book. There isn't a way I know of to filter on just duplicates in one column and deleting all rows that have duplicates in that column even if they are different in other columns. This and other Mozilla tips are at: http://rasmusen.org/a/mozilla-rasmusen.txt

Labels:

 

To view the post on a separate page, click: at (the permalink). 0 Comments Links to this post

Monday, August 11, 2008

 

New Latex Commands

I've gotten a couple of new Latex books (the typesetting language) and found a bunch of commands I didn't know about. I've written them up at http://rasmusen.org/a/latex-rasmusen.txt and http://rasmusen.org/a/latex-rasmusen.pdf and http://rasmusen.org/a/latex-rasmusen.tex. An example is doing footnotes inside tables and math:

Use the \footnotemark command to insert the footnote number. To insert the footnote itself, use

\addtocounter{footnote}{-1}\footnotetext{Here is my footnote} \stepcounter{footnote}

outside the table or math but trying to be on the same page.

$$
x = y\footnotemark
$$

\addtocounter{footnote}{-1}\footnotetext{Except when $ x= 8$. } \stepcounter{footnote}

\begin{tabular}{|l|l|r|l|}
\hline
lattice & $d$ & $q$ & last column\footnotemark \\
\hline
square & 2 & 4 & 1.763 \\
\hline
\end{tabular}
\addtocounter{footnote}{-1}\footnotetext{ That's two words in that entry. } \stepcounter{footnote}

Labels:

 

To view the post on a separate page, click: at (the permalink). 0 Comments Links to this post

Thursday, June 19, 2008

 

DEFINING YOUR OWN COUNTERS AND LABELS in Latex

From my latex notes at http://rasmusen.org/a/latex-rasmusen.txt

This is tricky in Latex, because while you can define new counters, I can't see how you would attach their values to labels. The \label command can only be used in environments that have their own counters (such as \begin{equation}), and you can't fool those environments into adding to a counter without having them print the value on the printed page somewhere. So I used Tex programming, like this. I create a new counter named \fignum and then attach it to a label called \1f, \2f, and so forth, advancing the counter in between. I used \edef rather than \def because \edef inserts the value at the particular time, while \def would repeat the command \number\fignum each time \1f was written.

\newcount\fignum\fignum=1

\edef\1f{\number\fignum}

\advance\fignum by 1

\edef\2f{\number\fignum}

Example: Figure \1f says this. The second part of it, Figure \1fa, says something different. Figures \2f and \2f-a say something still different.

This is plain Tex, not Latex.

You need to write backslash-1-f rather than backslash-f-1. I'm not sure why-- it must be that the number gets interpreted as doing something special to the definition rather than being part of the name.

You have to remember to put your definitions earlier in the document than when you use the term defined. You could put them all the start, actually, but then you might forget to re-order them when you change the order of the diagrams.

I think you can advance the fignum variable by a negative number if you want to.

Labels: ,

 

To view the post on a separate page, click: at (the permalink). 0 Comments Links to this post

Tuesday, June 10, 2008

 

Bibtex and Miktex: A bibliography program

I'm not sure if this is worth using or not. Here's how it works with Miktex.


1. For your file myfile.tex, construct a bibliography database file
myfile.bib with a bunch of entries like this, which do not not have to
be in alphabetical order:

 @article{hotelling:1929:ej,
  author = {Hotelling, Harold},
  journal = {Economic Journal},
  month = {mar},
  number = {153},
  pages = {41--57},
  publisher = {Royal Economic Society},
  title = {Stability in Competition},
  volume = {39},
  year = {1929}
}

You can do this from Google Scholar by going to Scholar Preferences and
checking off towards the bottom that you want a Bibtex-format link.
After you set your prferences,  Import into BibTeX will be a link  fror
each item a   Google Scholar search turns up.

2. Pick a style file such as econometrica.bst.  Put that file and the
myfile.bib file into the same directory as myfile.tex.

3. Wherever you want the references in myfile.tex, insert the commands

\bibliographystyle{econometrica} %needs  econometrica.bst file in folder
 \bibliography{myfile} %needs myfile.bib file in folder

 \nocite{*}

 The nocite command makes sure that all the entries in the myfile.bib
file get put into the references. Otherwise, only the ones cited using
bibtex commands get put in. The bibtex citing commands are just extra
commands to remember and make reading latex input files harder, so I
don't think I'll use them.


4. Change the name of myfile.tex to plain myfile.

5. Run myfile  through pdflatex.  That will create myfile.aux.

6. Run myfile through bibtex. That will use myfile.aux and
econometrica.bst and myfile.bib to create myfile.blg, a log file, and
also myfile.bbl, the bibliography formatted nicely.

7. Run myfile through pdflatex again.
My files of latex tips, including this one, is at http://rasmusen.org/a/latex-rasmusen.txt.

Labels:

 

To view the post on a separate page, click: at (the permalink). 0 Comments Links to this post

Monday, May 12, 2008

 

Shrinkwrap Contracts

Mark Lemley has a 2006 Minnesota Law Review paper, http://papers.ssrn.com/sol3/papers.cfm?abstract_id=917926 on shrinkwrap contracts that gives updates on what courts have been doing since Easterbrook's opinion.

Labels: ,

 

To view the post on a separate page, click: at (the permalink). 0 Comments Links to this post

Monday, April 21, 2008

 

Word Counts in PDF

Translator's Abacus is a free program, downloadable from http://www.globalrendering.com/download.html, that does word counts for pdf and html documents. It is 640K, one file, easy to use, andwell designed.

Labels:

 

To view the post on a separate page, click: at (the permalink). 0 Comments Links to this post