Page 1 of 1

Table to TEX

Posted: Fri Dec 17, 2010 11:36 am
by EViews Esther
This thread is about the new version of tbl2tex add-in that converts a EViews table into LaTex-type table.

Please note that fancy styles (e.g. color/symbols/characters) and the line between header and content cannot be created.
However, we would like to actively continue working to better integrate LaTex in EViews.

[Change log]
  • 2011/02/10 Special characters (e.g. # & % $ ~ _ ^ { }) are controlled.
  • 2011/05/24 Additional special character \ (backslash) is controlled.

Re: Table to TEX

Posted: Mon Dec 20, 2010 9:20 am
by tchaithonov
Hi Esther,

I just took a look at your code and I wonder, since this is only for tables, wouldn't it be better if you make it into a table proc instead of a global one? Besides, it would require users to actually click on the table first before running the program (to get input for the _this command), maybe global is not the best idea. Just a thought.

Tchaithonov

Re: Table to TEX

Posted: Mon Dec 20, 2010 9:50 am
by EViews Gareth
Mistake in the installer. It actually works from _this, so yeah it should be a table proc. We'll update the installer.

Re: Table to TEX

Posted: Mon Dec 20, 2010 10:03 am
by EViews Esther
The install program is updated.

Re: Table to TEX

Posted: Wed Feb 09, 2011 7:18 pm
by maxchen
the "&" is not filtered!

for example

Code: Select all

%ex7 = "\Example Files\EV7 Manual Data" %ch28 = "\Chapter 28 - Quantile Regression" %wf = @evpath + %ex7 +%ch28 +"\engel.wf1" wfopen %wf equation eq00.qreg y c x freeze(tb0) eq00.output tb0.tbl2tex(name="tb0",path="e:/")
in the tex file, the line

Code: Select all

Huber Sandwich Standard Errors & Covariance
the character "&" should be changed to "\&"

Re: Table to TEX

Posted: Thu Feb 10, 2011 9:44 am
by EViews Esther
Yes. You are right. Whenever we use one of the following special characters,

# & % $ ~ _ ^ { } \

we need to include a \ in front of the character.

Let me think about how to deal with these special characters.

Re: Table to TEX

Posted: Tue May 24, 2011 2:26 am
by dagfinnrime
Hi,

I think the following works.

Replace:

Code: Select all

%special = "# & % $ ~ _ ^ { } \" for !r=1 to !nrows for !c=1 to !ncols %temp = {%tbl}(!r,!c) for !i=1 to @wcount(%special) %cha = @word(%special,!i) if @wfind(%temp, %cha) then %cha1 = "\"+ %cha %temp = @replace(%temp, %cha, %cha1) endif next
with:

Code: Select all

%special = "# & % $ ~ _ ^ { }" '\" for !r=1 to !nrows for !c=1 to !ncols %temp = {%tbl}(!r,!c) for !i=1 to @wcount(%special) %cha = @word(%special,!i) %cha1 = "\"+ %cha %temp = @replace(%temp, %cha, %cha1) next
Change amounts to dropping "\" from list of special characthers and dropping the if-statement (which seems unnecessary). Maybe the @wfind, which should return position of character, doesn't work (Haven't checked).

About dropping "\". If the code encounters "\" then it would create "\\" which is a linebreak, which is not what you want. I'm not sure you really will use "\" that often that it is a big problem. If you want "\" in the list you have to add a special condition for that character (I think).

Dagfinn

Re: Table to TEX

Posted: Tue May 24, 2011 8:48 am
by EViews Esther
Change amounts to dropping "\" from list of special characthers and dropping the if-statement (which seems unnecessary). Maybe the @wfind, which should return position of character, doesn't work (Haven't checked).
Yes. @wfind should be replaced to @instr when we want to find the position of characters.
However, as you mentioned, the step to check whether special characters are found can be ignored.
About dropping "\". If the code encounters "\" then it would create "\\" which is a linebreak, which is not what you want. I'm not sure you really will use "\" that often that it is a big problem. If you want "\" in the list you have to add a special condition for that character (I think).
We can keep the list for special characters by adding an additional condition - i.e. if %cha = "\" then - as follows.

Code: Select all

%special = "# & % $ _ { } \ ~ ^" for !r=1 to !nrows for !c=1 to !ncols %temp = {%tbl}(!r,!c) for !i=1 to @wcount(%special) %cha = @word(%special,!i) if %cha = "\" then %temp = @replace(%temp, %cha, "$\backslash$") else %temp = @replace(%temp, %cha, "\" + %cha) endif next ...

Re: Table to TEX

Posted: Tue Aug 30, 2011 12:25 am
by maxchen
it seems that the download page http://www.eviews.com/Addins/addins.shtml has not been updated for this addin

Re: Table to TEX

Posted: Tue Aug 30, 2011 7:49 am
by EViews Gareth
What do you mean?

Re: Table to TEX

Posted: Tue Sep 18, 2012 6:23 am
by CharlieEVIEWS
Perhaps I am doing something wrong here (using TeXWorks) but the compiled files look seriously disfigured - either when copied into a larger .tex or when run as the .tex produced directly by the add-in. Also, I am experiencing problems with the $\backslash$_ which occurs when you have an underscore in a variable name.

Any help? I am being a moron :roll: ? anyway, huge fan of the add-ins guys, keep up the great work.

Re: Table to TEX

Posted: Fri Nov 02, 2012 2:03 pm
by tzink
The output of this add-in doesn't compile for me. Errors are due to the fact that special characters aren't properly dealt with. For instance, the produced code snippet:

Equation: LN$\backslash$_S$\backslash$_P = P(1) + P(2)*LN$\backslash$_P$\backslash$_CU + P(3)*LN$\backslash$_P$\backslash$_FUEL + P(4) \\

results in the error:
! Missing $

The problem is that the underscores in my variables names are not filtered properly by the $\backslash$ command. I don't know enough about EViews programming to suggest a solution, unfortunately.

Has anyone on the dev team looked at GRETL's implementation? The Latex integration in GRETL is flawless, IMO.

Re: Table to TEX

Posted: Sat Nov 16, 2013 9:50 am
by CharlieEVIEWS
Dear all,

Really looking forward to more LaTeX integration in EViews 9. However, I think there is a problem with the add-in. When I Proc --> add-in from a table object in EViews 8, Nov 13 2013 build, only the following is generated:

Code: Select all

\documentclass[12pt]{article} \begin{document} \begin{table} \centering \begin{tabular}{} \hline \hline \hline \hline \end{tabular} \end{table} \end{document}
Which doesn't generate any table... Does anybody have any suggestions or ideas? Warmest wishes as always, and again, thanks for all of your hard work on such a great product.

Charlie

Re: Table to TEX

Posted: Sat Dec 14, 2013 10:22 am
by basile
Hello everyone,

I am a new user of eviews and I'm struggling to get tables in latex format... I downloaded the add in thing, but I have no idea how to generate table afterwards. So starting from a simple regression output window, can someone tell me how to get the latex table ?
Sorry for the stupid question :)
merry christmas everyone