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

how to hide stata software information in quarto #49

Open
0825kangkang opened this issue Sep 17, 2024 · 13 comments
Open

how to hide stata software information in quarto #49

0825kangkang opened this issue Sep 17, 2024 · 13 comments
Labels
question Further information is requested

Comments

@0825kangkang
Copy link

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.

@hugetim
Copy link
Owner

hugetim commented Sep 17, 2024

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.

@0825kangkang
Copy link
Author

0825kangkang commented Sep 17, 2024

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!

@hugetim
Copy link
Owner

hugetim commented Sep 18, 2024

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.

@0825kangkang
Copy link
Author

@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
Copy link
Author

@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 :)

@hugetim hugetim reopened this Sep 18, 2024
@hugetim
Copy link
Owner

hugetim commented Sep 18, 2024

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

@hugetim
Copy link
Owner

hugetim commented Sep 18, 2024

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

@hugetim hugetim added the question Further information is requested label Sep 18, 2024
@0825kangkang
Copy link
Author

0825kangkang commented Sep 19, 2024

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

@hugetim
Copy link
Owner

hugetim commented Sep 19, 2024

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).

@0825kangkang
Copy link
Author

  • 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

@hugetim
Copy link
Owner

hugetim commented Sep 20, 2024

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?

@0825kangkang
Copy link
Author

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.

@hugetim
Copy link
Owner

hugetim commented Oct 28, 2024

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

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

No branches or pull requests

2 participants