Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes Cut Off #31

Closed
alexkellogg47 opened this issue Jun 10, 2015 · 5 comments
Closed

Notes Cut Off #31

alexkellogg47 opened this issue Jun 10, 2015 · 5 comments

Comments

@alexkellogg47
Copy link

After the update, it seems like the notes are being cut off at around 45 characters -- couldn't tell why from looking at the .ado.

Thanks again for getting to the other issue so quickly.

@derekwolfson
Copy link
Owner

Hey Alex,

That is strange behavior. I’ll take a look at this, what version of stata are you using? I’ll try and recreate the problem when I get some time. I’m in the middle of a move, so who knows when that’ll be!

If you can provide an MWE I can just run, that might be useful.

-D

@alexkellogg47
Copy link
Author

Thanks; I'm using Stata 12.

Here's an example, if you run this, the notes cut off.

sysuse auto
replace price=price/1000

            qui eststo example111: reg price mpg weight 
            qui eststo example112: reg price mpg weight headroom trunk length
            qui eststo example113: reg price mpg weight i.foreign
            qui eststo example114: reg price mpg weight headroom trunk length i.foreign



            esttab example11* using "test11", /// 
                    replace fragment booktabs ///
                    label b(3) se(3) se ///
                    star(* .1 ** .05 *** .01) ///
                    mgroups("Group 1" "Group 2", ///
                     pattern(1 0 1 0) ///
                     prefix(\multicolumn{@span}{c}{) ////
                     suffix(}) ///
                     span erepeat(\cmidrule(lr){@span}) ///
                    ) ///end mgroups
                    stats(r2 N, ///
                     fmt(3 0) ///
                     layout("\multicolumn{1}{c}{@}" "\multicolumn{1}{c}{@}") ///
                     labels("R-Sq" "Observations") ///
                    ) // end stats

            tex3pt "test11.tex" using "master11.tex", ///
                    page ///
                    clearpage ///
                    title("Tex3pt Example Table") ///
                    tlabel("tab1") ///
                    star(ols) ///
                    note("This is a note in tex3pt! Now for some Vonnegut quotes: I say in speeches that a plausible mission of artists is to make people appreciate being alive at least a little bit. I am then asked if I know of any artists who pulled that off. I reply, 'The Beatles did'. All time is all time. It does not change. It does not lend itself to warnings or explanations. It simply is. Take it moment by moment, and you will find that we are all, as I've said before, bugs in amber. Just because some of us can read and write and do a little math, that doesn't mean we deserve to conquer the Universe.")

@NilsEnevoldsen
Copy link
Contributor

I am unable to replicate with Stata 14.

Although it does not change the testcase, note that you would want \The Beatles did'instead of'The Beatles did'`.

Can you add set trace on before the tex3pt command, and set trace off after it, and then search the output for "vonnegut"? When I run it, I see

- tokenize `"`macval(note)'"', parse(",")
  = tokenize `""This is a note in tex3pt! Now for some Vonnegut quotes: I say in speeches that a plausible mission of artists is to make people appreciate being alive at least a little bit. I am then asked if 
> I know of any artists who pulled that off. I reply, `The Beatles did'. All time is all time. It does not change. It does not lend itself to warnings or explanations. It simply is. Take it moment by moment, a
> nd you will find that we are all, as I've said before, bugs in amber. Just because some of us can read and write and do a little math, that doesn't mean we deserve to conquer the Universe.""', parse(",")
  - local token = 1
  - local notelines = 1
  - while "``token''" != "" {
  = while "This is a note in tex3pt! Now for some Vonnegut quotes: I say in speeches that a plausible mission of artists is to make people appreciate being alive at least a little bit. I am then asked if I kno
> w of any artists who pulled that off. I reply, . All time is all time. It does not change. It does not lend itself to warnings or explanations. It simply is. Take it moment by moment, and you will find that 
> we are all, as I've said before, bugs in amber. Just because some of us can read and write and do a little math, that doesn't mean we deserve to conquer the Universe." != "" {
  - if "``token''" == "," {
  = if "This is a note in tex3pt! Now for some Vonnegut quotes: I say in speeches that a plausible mission of artists is to make people appreciate being alive at least a little bit. I am then asked if I know o
> f any artists who pulled that off. I reply, . All time is all time. It does not change. It does not lend itself to warnings or explanations. It simply is. Take it moment by moment, and you will find that we 
> are all, as I've said before, bugs in amber. Just because some of us can read and write and do a little math, that doesn't mean we deserve to conquer the Universe." == "," {
    local ++notelines
    }
  - else {
  - local note`notelines' = "`macval(note`notelines')' `macval(`token')'"
  = local note1 = " This is a note in tex3pt! Now for some Vonnegut quotes: I say in speeches that a plausible mission of artists is to make people appreciate being alive at least a little bit. I am then asked
>  if I know of any artists who pulled that off. I reply, `The Beatles did'. All time is all time. It does not change. It does not lend itself to warnings or explanations. It simply is. Take it moment by momen
> t, and you will find that we are all, as I've said before, bugs in amber. Just because some of us can read and write and do a little math, that doesn't mean we deserve to conquer the Universe."
  - }

and a little later

  - file write `tex_file' `"\Figtext{{`notefontsize' `macval(note`i')'}} %%TABLE NOTE"' _n
  = file write __000000 `"\Figtext{{\footnotesize This is a note in tex3pt! Now for some Vonnegut quotes: I say in speeches that a plausible mission of artists is to make people appreciate being alive at least
>  a little bit. I am then asked if I know of any artists who pulled that off. I reply, `The Beatles did'. All time is all time. It does not change. It does not lend itself to warnings or explanations. It simp
> ly is. Take it moment by moment, and you will find that we are all, as I've said before, bugs in amber. Just because some of us can read and write and do a little math, that doesn't mean we deserve to conque
> r the Universe.}} %%TABLE NOTE"' _n

@derekwolfson
Copy link
Owner

Strange - I'm working on this now and I can't replicate it either. @alexkellogg47 are you still having this issue?

@derekwolfson
Copy link
Owner

derekwolfson commented May 2, 2017

This has to do with the line of code:

local note1 ="stuff that is longer than 128 characters or something"

Stata 13+ deals with this much better... but if the equal sign is used in Stata 12 it cuts off a bunch of the local.

I fixed it by changing the code to

local note1 "stuff that is longer than 128 characters or something"

I'm not sure what commit this is in, but it is fixed in the current release (3.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants