public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Pandoc not maintaining newlines from .txt file to Word file
@ 2018-01-18 20:08 Serena De Stefani
       [not found] ` <e1d030fa-3ac1-4fb7-b6c8-3f7a29356d9a-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Serena De Stefani @ 2018-01-18 20:08 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2143 bytes --]

I am using Pandoc to integrate Scrivener with Zotero. I write in Scrivener 
adding the Zotero citation keys, compile a .txt file, then use Pandoc to 
convert the .txt file into a Word file in which the citation keys are 
effectively translated in my preferred citation style (APA in this case). 
Following the instructions on this 
<https://davepwsmith.github.io/academic-scrivener-howto/> webpage, I also 
set up "Marked 2" to show the output of what I was writing in Scrivener 
using markdown.

Here comes the problem: newlines.
If I write in Scrivener:

    I want a newline after this.
    This should be a newline.

then Marked 2 is showing:

    I want a newline after this. This should be a newline.

So then I wrote in Scrivener:

    I want a newline after this.<br>
    This should be a newline.

Marked 2:

    I want a newline after this.
    This should be a newline.

Great! Now I compile into a .txt file and I get:

    I want a newline after this.<br>
    This should be a newline.

OK, now it is time to use Pandoc.

I type the following command into the terminal:

    pandoc -s -S --normalize --bibliography  
    ~/Dropbox/_Research/Master_Thesis/Master.bib --csl 
    ~/Dropbox/_Research/apa.csl 
    -f markdown -t docx -o trial.docx /Users/S/Desktop/test_st.txt

I get my .docx file (and when I do this with a full document, all my 
citations are there, so that works!), but then I read:

    I want a newline after this. This should be a newline.

Note that the <br> that was present in the .txt file is gone, but still I 
did not get a newline.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e1d030fa-3ac1-4fb7-b6c8-3f7a29356d9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3093 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pandoc not maintaining newlines from .txt file to Word file
       [not found] ` <e1d030fa-3ac1-4fb7-b6c8-3f7a29356d9a-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2018-01-18 20:22   ` James AUSTIN
  2018-01-18 20:25   ` John MACFARLANE
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: James AUSTIN @ 2018-01-18 20:22 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 3355 bytes --]

Hi Serena

I think you want \n (backslash n) rather than <br>

Take care
James 

> On 18 Jan 2018, at 20:08, Serena De Stefani <serenadestefani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> I am using Pandoc to integrate Scrivener with Zotero. I write in Scrivener adding the Zotero citation keys, compile a .txt file, then use Pandoc to convert the .txt file into a Word file in which the citation keys are effectively translated in my preferred citation style (APA in this case). Following the instructions on this <https://davepwsmith.github.io/academic-scrivener-howto/> webpage, I also set up "Marked 2" to show the output of what I was writing in Scrivener using markdown.
> 
> Here comes the problem: newlines.
> If I write in Scrivener:
> 
>     I want a newline after this.
>     This should be a newline.
> 
> then Marked 2 is showing:
> 
>     I want a newline after this. This should be a newline.
> 
> So then I wrote in Scrivener:
> 
>     I want a newline after this.<br>
>     This should be a newline.
> 
> Marked 2:
> 
>     I want a newline after this.
>     This should be a newline.
> 
> Great! Now I compile into a .txt file and I get:
> 
>     I want a newline after this.<br>
>     This should be a newline.
> 
> OK, now it is time to use Pandoc.
> 
> I type the following command into the terminal:
> 
>     pandoc -s -S --normalize --bibliography  
>     ~/Dropbox/_Research/Master_Thesis/Master.bib --csl 
>     ~/Dropbox/_Research/apa.csl 
>     -f markdown -t docx -o trial.docx /Users/S/Desktop/test_st.txt
> 
> I get my .docx file (and when I do this with a full document, all my citations are there, so that works!), but then I read:
> 
>     I want a newline after this. This should be a newline.
> 
> Note that the <br> that was present in the .txt file is gone, but still I did not get a newline.
> 
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e1d030fa-3ac1-4fb7-b6c8-3f7a29356d9a%40googlegroups.com <https://groups.google.com/d/msgid/pandoc-discuss/e1d030fa-3ac1-4fb7-b6c8-3f7a29356d9a%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/A1DEFD5D-5499-4A95-8785-7AF6045D1C89%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 5571 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pandoc not maintaining newlines from .txt file to Word file
       [not found] ` <e1d030fa-3ac1-4fb7-b6c8-3f7a29356d9a-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2018-01-18 20:22   ` James AUSTIN
@ 2018-01-18 20:25   ` John MACFARLANE
  2018-01-18 20:30   ` Mikolaj Machowski
  2018-01-18 22:32   ` Serena De Stefani
  3 siblings, 0 replies; 5+ messages in thread
From: John MACFARLANE @ 2018-01-18 20:25 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Try

-f markdown+hard_line_breaks

and the newlines in your document will be interpreted as
line breaks, if that's what you want.  (Don't include
raw '<br>' tags in the markdown; they will only be passed
on to HTML output, not docx.)

+++ Serena De Stefani [Jan 18 18 12:08 ]:
>   I am using Pandoc to integrate Scrivener with Zotero. I write in
>   Scrivener adding the Zotero citation keys, compile a .txt file, then
>   use Pandoc to convert the .txt file into a Word file in which the
>   citation keys are effectively translated in my preferred citation style
>   (APA in this case). Following the instructions on [1]this webpage, I
>   also set up "Marked 2" to show the output of what I was writing in
>   Scrivener using markdown.
>   Here comes the problem: newlines.
>   If I write in Scrivener:
>       I want a newline after this.
>       This should be a newline.
>   then Marked 2 is showing:
>       I want a newline after this. This should be a newline.
>   So then I wrote in Scrivener:
>       I want a newline after this.<br>
>       This should be a newline.
>   Marked 2:
>       I want a newline after this.
>       This should be a newline.
>   Great! Now I compile into a .txt file and I get:
>       I want a newline after this.<br>
>       This should be a newline.
>   OK, now it is time to use Pandoc.
>   I type the following command into the terminal:
>       pandoc -s -S --normalize --bibliography
>       ~/Dropbox/_Research/Master_Thesis/Master.bib --csl
>       ~/Dropbox/_Research/apa.csl
>       -f markdown -t docx -o trial.docx /Users/S/Desktop/test_st.txt
>   I get my .docx file (and when I do this with a full document, all my
>   citations are there, so that works!), but then I read:
>       I want a newline after this. This should be a newline.
>   Note that the <br> that was present in the .txt file is gone, but still
>   I did not get a newline.
>
>   --
>   You received this message because you are subscribed to the Google
>   Groups "pandoc-discuss" group.
>   To unsubscribe from this group and stop receiving emails from it, send
>   an email to [2]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [3]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [4]https://groups.google.com/d/msgid/pandoc-discuss/e1d030fa-3ac1-4fb7-
>   b6c8-3f7a29356d9a%40googlegroups.com.
>   For more options, visit [5]https://groups.google.com/d/optout.
>
>References
>
>   1. https://davepwsmith.github.io/academic-scrivener-howto/
>   2. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   3. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   4. https://groups.google.com/d/msgid/pandoc-discuss/e1d030fa-3ac1-4fb7-b6c8-3f7a29356d9a-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>   5. https://groups.google.com/d/optout


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pandoc not maintaining newlines from .txt file to Word file
       [not found] ` <e1d030fa-3ac1-4fb7-b6c8-3f7a29356d9a-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2018-01-18 20:22   ` James AUSTIN
  2018-01-18 20:25   ` John MACFARLANE
@ 2018-01-18 20:30   ` Mikolaj Machowski
  2018-01-18 22:32   ` Serena De Stefani
  3 siblings, 0 replies; 5+ messages in thread
From: Mikolaj Machowski @ 2018-01-18 20:30 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 838 bytes --]

Pandoc doesn't support raw html in docx export.

For simple test document worked combination

pandoc -f markdown+raw_html -t html -s -o test.html test.md
pandoc -f html -t docx test.html

But I don't know if it will work with additional bibliography processing.

m.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/3bebca44-f8aa-4701-a016-88ac3ed5d39b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 1289 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pandoc not maintaining newlines from .txt file to Word file
       [not found] ` <e1d030fa-3ac1-4fb7-b6c8-3f7a29356d9a-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
                     ` (2 preceding siblings ...)
  2018-01-18 20:30   ` Mikolaj Machowski
@ 2018-01-18 22:32   ` Serena De Stefani
  3 siblings, 0 replies; 5+ messages in thread
From: Serena De Stefani @ 2018-01-18 22:32 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2388 bytes --]

Thank you all for your help. I found that -f markdown+hard_line_breaks 
worked!

On Thursday, January 18, 2018 at 3:08:38 PM UTC-5, Serena De Stefani wrote:
>
> I am using Pandoc to integrate Scrivener with Zotero. I write in Scrivener 
> adding the Zotero citation keys, compile a .txt file, then use Pandoc to 
> convert the .txt file into a Word file in which the citation keys are 
> effectively translated in my preferred citation style (APA in this case). 
> Following the instructions on this 
> <https://davepwsmith.github.io/academic-scrivener-howto/> webpage, I also 
> set up "Marked 2" to show the output of what I was writing in Scrivener 
> using markdown.
>
> Here comes the problem: newlines.
> If I write in Scrivener:
>
>     I want a newline after this.
>     This should be a newline.
>
> then Marked 2 is showing:
>
>     I want a newline after this. This should be a newline.
>
> So then I wrote in Scrivener:
>
>     I want a newline after this.<br>
>     This should be a newline.
>
> Marked 2:
>
>     I want a newline after this.
>     This should be a newline.
>
> Great! Now I compile into a .txt file and I get:
>
>     I want a newline after this.<br>
>     This should be a newline.
>
> OK, now it is time to use Pandoc.
>
> I type the following command into the terminal:
>
>     pandoc -s -S --normalize --bibliography  
>     ~/Dropbox/_Research/Master_Thesis/Master.bib --csl 
>     ~/Dropbox/_Research/apa.csl 
>     -f markdown -t docx -o trial.docx /Users/S/Desktop/test_st.txt
>
> I get my .docx file (and when I do this with a full document, all my 
> citations are there, so that works!), but then I read:
>
>     I want a newline after this. This should be a newline.
>
> Note that the <br> that was present in the .txt file is gone, but still I 
> did not get a newline.
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/43a87a2f-359d-4437-8ac5-57d444667a4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3865 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-18 22:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-18 20:08 Pandoc not maintaining newlines from .txt file to Word file Serena De Stefani
     [not found] ` <e1d030fa-3ac1-4fb7-b6c8-3f7a29356d9a-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-01-18 20:22   ` James AUSTIN
2018-01-18 20:25   ` John MACFARLANE
2018-01-18 20:30   ` Mikolaj Machowski
2018-01-18 22:32   ` Serena De Stefani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).