-
Notifications
You must be signed in to change notification settings - Fork 391
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
Allow multiline comments for text cells in the py:percent format #305
Comments
Hello @hpmsi1 , well, yes and no. Currently the Markdown cell should only use line comments, i.e. your input should be # %% [markdown]
# $$
# \begin{align}
# \dot{x} & = \sigma(y-x) \
# \dot{y} & = \rho x - y - xz \
# \dot{z} & = -\beta z + xy
# \end{align}
# $$ We could think of implementing support for multiline strings - but I won't be available for that before a few weeks. |
Thank you for responding so quickly. |
You're welcome! Yes we will do that in the future. By the way, if you are looking for a way to embed large markdown blocks, I suggest you open and edit your Note also that if you plan to input a lot of Markdown content, maybe the Markdown format is a better fit for your notebooks... (use Jupytext at the command line to convert from one formats to the other). |
Thank you for the suggestions: I am writing all code in .py as these are easier to maintain, develop and debug. |
Oh that's interesting, actually you're implementing one example of #247. There's one comment there that may be of interest to you: nbsphinx can take Jupytext scripts directly as inputs. |
To follow up on my comment in #247 about scaled images --I found this pair of functions that can go back and forth between img tags (for ipynb) and gfm markdown (for pandoc rst). You can put them in a precommit hook to handle the translation needed for nbspninx
|
Thank you, this is really useful. I will follow up on this. |
@hpmsi1 , would you like to give a try to the new RC? Markdown cells defined with triple quotes should work now, see jupytext/tests/test_read_simple_percent.py Lines 212 to 225 in bf6049b
The RC is available on pypi:
|
Great!
Thank you so much for this upgrade. I will give it a try and let you know.
Kind regards,
Mohammad
…On Sat, Oct 12, 2019 at 8:22 PM Marc Wouts ***@***.***> wrote:
@hpmsi1 <https://github.com/hpmsi1> , would you like to give a try to the
new RC? Markdown cells defined with triple quotes should work now, see
https://github.com/mwouts/jupytext/blob/bf6049b9107fef171647345f84364cdb4c5aaf5e/tests/test_read_simple_percent.py#L212-L225
The RC is available on pypi:
pip install jupytext==1.3.0rc0
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#305?email_source=notifications&email_token=ABVIKDXQ366WPZLYBKFVWGDQOJZ53A5CNFSM4IGRBJR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCL6DA#issuecomment-541376268>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVIKDSAVLNB5CC2RMC4KKDQOJZ53ANCNFSM4IGRBJRQ>
.
|
Thank you it works.
output: However, this line break issue is fixed by doing this:
|
Oh, that's interesting! A line break in tex is |
@hpmsi1 , in the current implementation Jupytext takes the content of the markdown cell verbatim from the string. So the latex line break is simply |
Thanks, I will use two slashes for line breaks.
My comment in edit mode shows the equations ending with two slash. But it changes it to a single slash when I submit it. |
Oh I see! I've edited your comment and used code markers ( |
Thank you, very much appreciated.
…On Tue, Oct 22, 2019 at 2:27 PM Marc Wouts ***@***.***> wrote:
Oh I see! I've edited your comment and used code markers (```) to
preserve the raw text. I'm still a bit puzzle by the line return with a
single slash, I'll do a few more experiments about that when time permits,
and add the corresponding tests to Jupytext to make sure we understand this
well.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#305?email_source=notifications&email_token=ABVIKDT3UP3PPVCBZUYDK5DQP5H3PA5CNFSM4IGRBJR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB65B7Y#issuecomment-545116415>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVIKDSG4X7NFOAXVW7KL6TQP5H3PANCNFSM4IGRBJRQ>
.
|
Hello @hpmsi1 , I have added a test notebook, and made sure that round trips are consistent, whatever is in the markdown cell. Just to confirm, I found no way to trigger a line break in the LaTeX equation with a single slash. Two backslash seem to be necessary: The notebook is at jupytext/tests/notebooks/mirror/ipynb_to_percent/Line_breaks_in_LateX_305.py Lines 31 to 42 in 3ef0e73
|
Thank you for your very useful program jupytext.
I am trying to convert a markdown section in .py file to .ipynb. It works but produces extra """ and beginning and end of the cell. Example given below:
#%% [markdown]
'''
'''
Is it possible that these """ don't appear in the converted ipynb cell?
Thank you
The text was updated successfully, but these errors were encountered: