Thursday, March 29, 2012

LATEX: Hide column in table

Very nice. I forgot where I found it:

\def\ignore#1\endignore{}
\newcolumntype{I}{@{}>{\ignore}l<{\endignore}} %% blind out some colums


Now a table column with the letter "I" instead of c,r,l  will be hidden.
Of course there is a little extra space left

Needs the package:

\usepackage{array} 

Friday, March 23, 2012

KILE: Workaround for forward search in Windows

The KILE builtin functionality currently adds as space and "./" to the source file when clicking ForwardDVI under windows with the current KDE Windows release. I do not have this behavior in Linux Ubuntu 10.04 with latest patches installed.
Still, this annoys  me and I came up with a workaround for Windows:

You need:

  • Cygwin with sed installed
  • Okular (any other dvi viewer should do fine)


Generate a build command in Kile-> Settings -> Configure Kile --> Build which is exactly the same as ForwardDVI.
Than change this new command to the following:

Command: cmd
Options: /c open_okular.bat '%target'

This should call the batch file open_okular.bat within the DOS CMD shell and pass along the string containing everything you need for doing forward search.

Now place the following DOS CMD script in your TEX Project Root folder:
FILE open_okular.bat


echo "Start"
set PATH=%PATH%;c:\programdata\kde\bin\;c:\cygwin\bin\;c:\Users\<username>\kderoot\bin\
echo  %INPUT%
for /f %%a in ('echo %1 ^| sed.exe -e"s/ \.\///"') do set OUTPUT=%%a
@echo %OUTPUT%
okular.exe %OUTPUT% --unique
echo "End"

What the script does:
Line 2 updates your path so that okular.exe and sed.exe are known. Adjust paths appropriatley
Line 4 removes the " ./" in words: space dot slash; from the string and stores it in OUTPUT
Line 6 calls okular with the new string.


This should give you the forward search for Kile and Okular in Windows.
Adoptions to any other DVI viewer should be straight forward.
Adoptions to Linux should be easy as string manipulation is usually a lot easier.






KILE: Document Variables or Build wildcards

Document variables or Build wildcards of kile are not documented anywhere to my knowledge and I just found this POST which basically says the same!

So here is a quick overview copied from the site above:



The variables have the following meanings:
%source -> filename with suffix but without path <-> myBestBook.tex
%S -> filename without suffix but without path <-> myBestBook
%dir_base -> path of the source file without filename <-> /home/user/latex
%dir_target -> path of the target file without filename, same as %dir_base if 
no relative path has been set <-> /home/user/latex
%target -> target filename without path <-> without filename 


And these are special variables
%res <-> resolution of the quickpreview action set in configure 
kile->tools->preview


%AFL <-> List of all files in a project marked for archiving. You can set the 
archive flag in the "Files and projects" sidebar using the context menu.



Currently, my KILE setup is not using the correct way to call okular to jump to the correct line viewed as tex source. The wildcard %target produces the following output:

Target.dvi#source:120 Source.tex


However, there should not be a space between 120 and Source. Without this space it is working well from command line.
However I lack the variables for linenumber and source document and so I stuck. Any Ideas for solving this particular problem?



Tuesday, March 13, 2012

VisualStudio: LINK : fatal error LNK1105: cannot close file

The error:

LINK : fatal error LNK1105: cannot close file 

occurs a lot to me working on Network shares or shared folders in Virtual Machine.
In particular this error came out of nowhere in my VirtualBox Win7 System, running on a Ubuntu 10.04 host.
Fortunately, the solution was easy. Just install the current VirtualBox Addon Tools and after a restart the error was gone.
My Versions now:

Virtual Box: 4.1.8
Addons: 4.18

Of course, this error is obvious. Nevertheless, I do not care if my VirtualBox updates itself or not. I just want it running.