nbstata icon indicating copy to clipboard operation
nbstata copied to clipboard

how to hide stata software information in quarto

Open 0825kangkang opened this issue 1 year ago • 13 comments

When I render qmd file in quarto, it always show that stata log and software information. Not sure where is th problem. The tool I am using is vscode and the kernel is nstata. My quarto output format is pdf.

0825kangkang avatar Sep 17 '24 08:09 0825kangkang

It sounds like you're talking about the Stata "splash" (like the first output shown in this example)? That should be turned off by default. To be sure you're using nbstata, could you share the full yaml header at the start of your .qmd file?

Are you using an nbstata config file? To check, run the %status magic by putting just that in a Stata code block.

hugetim avatar Sep 17 '24 13:09 hugetim

YAML I used before is

title: "Stata testing" format: pdf python: nbstata

But badly I uninstalled and installed nbstata. Now I cannot even run the any stata codes. It always show stata_dir is wrong. I check the path (/Applications/Stata/StataMP.app/Contents/MacOS/StataMP) and it works to open stata in the terminal.

Or the problem came out because my install process is wrong? Could you do a favor to take look at it? Thank you!

0825kangkang avatar Sep 17 '24 19:09 0825kangkang

I thought the YAML would be jupyter: nbstata

Otherwise, what would you like me to look at, your nbstata config file? Whatever it is, I'm happy to help.

hugetim avatar Sep 18 '24 00:09 hugetim

@hugetim thank you so much for your help. I pasted my config file as below.

[nbstata] stata_dir = /Applications/Stata/StataMP.app/Contents/MacOS/StataMP edition = mp splash = False graph_format = png graph_width = 5.5in graph_height = 4in echo = None missing = .

0825kangkang avatar Sep 18 '24 07:09 0825kangkang

@hugetim thank you so much for your help. I pasted my config file as below.

[nbstata] stata_dir = /Applications/Stata/StataMP.app/Contents/MacOS/StataMP edition = mp splash = False graph_format = png graph_width = 5.5in graph_height = 4in echo = None missing = .

I incorrectly closed this issue. Could you help to reopen it as it is not solved? Thank you :)

0825kangkang avatar Sep 18 '24 08:09 0825kangkang

My first thought: Have checked if it works without a config file? You could just move that one to a different directory temporarily.

hugetim avatar Sep 18 '24 19:09 hugetim

Otherwise, maybe try shortening the path to just /Applications/Stata/StataMP.app. I think that's what it's looking for.

hugetim avatar Sep 18 '24 21:09 hugetim

It is feasible in the first way. I move the config file to other folder and it works. In the second way it still shows the same error.

But the splash still existing in the pdf file. I pasted my code as below and I also pasted the first page in my pdf (just kick out my licence inforamtion). Thank you!

--- title: "Stata testing" format: pdf jupyter: nbstata ---

```{stata}

sysuse auto summarize

```

Screenshot 2024-09-19 at 08 50 05 Screenshot 2024-09-19 at 08 50 13

0825kangkang avatar Sep 19 '24 06:09 0825kangkang

To get the config file working, try re-running the install program with the --conf-file option: https://hugetim.github.io/nbstata/user_guide.html#install-nbstata

That should create a working config file for you, which you can then edit as needed.

But the splash remains puzzling. Can you provide more details about how you produced that screen shot? If possible, attach the full .qmd file, provide the nbstata and quarto versions you're using, and show the quarto command you use to create the output (or explain what you did if you are using VSCode or RStudio to produce the output).

hugetim avatar Sep 19 '24 13:09 hugetim

  • quarto version: 1.5.57 nbstata Version: 0.7.0

  • I rerun below codes but sure if it is what you mean. However, still not working and presents the same path error. python -m nbstata.install --conf-file

-Below are all contents in my qmd file, no extra codes are used to produce output in vscode. After input below things, there is a 'preview' buttom in vscode and then PDF file is created.

--- title: "Stata testing" format: pdf jupyter: nbstata ---

```{stata}

sysuse auto summarize ```

test.qmd.zip

0825kangkang avatar Sep 19 '24 14:09 0825kangkang

Have you tried the %status magic I suggested above to check that the config file you think is being used is actually the operative one? Try putting it by itself in a code block like this, and then see what the output is:

```{stata} %status ```

Otherwise, when I get a chance, I'll see if I can replicate the splash issue using VSCode (albeit on Windows), following your steps. I take it you're using the Quarto Extension for VSCode?

hugetim avatar Sep 20 '24 00:09 hugetim

Yes, I am using quarto extension for VScode. But you still need to install quarto first and then for vscode install the extension.

I tried below code and it works as long as I remove the config file to other folders.

```{stata} %status ```

However, the splash is still existing. It seems the config file does not work in my side.

0825kangkang avatar Sep 20 '24 09:09 0825kangkang

Can you paste the output from the %status? Really, I'm just wondering what it shows for which config file it is using, if any. That should be the last line: https://hugetim.github.io/nbstata/user_guide.html#status

hugetim avatar Oct 28 '24 14:10 hugetim