How to get list Level in Word(with Pandoc+Markdown) - ms-word

I'm trying Pandoc with Markdown to Make various Documents.
I built a Word(.docx) Document from a Markdown document but that document get no nest at lists, example below images.
Exsample
Markdown document source is here.
* contentA
+ contentA-1
+ contentA-2
- contentA-2-1
As you can See, Left tab is OK, but indent is not working.
I want to get lists with indent.
Please Tell me how to get indented list on Pandoc.

If you notice in your screenshot, the lines in your list are separated with a line break rather than a new paragraph. So that's why there is no nesting on subsequent lines; each is considered a continuation of the first list item.
Try using the "loose" list format in pandoc's markdown. That should format each line of your list as a separate paragraph, which should make them nest properly.
Later, that same evening...
Hmm. Perhaps I was wrong. I just copy/pasted your markdown into a new file and converted it to docx and it nested just fine for me.
This was just using a simple:
pandoc -f markdown -t docx -o test_nested_lists.docx test_nested_lists.md

Related

Page numbers in scribble/acmart

I'm creating a pdf with the scribble/acmart language. How can I add page numbers to my document?
Make a LaTeX file with the line \settopmatter{printfolios=true}
If the file is named texstyle.tex, invoke Scribble with the command:
scribble ++style texstyle.tex --pdf FILE.scrbl
The rendered FILE.pdf should have line numbers.
(If you already had a ++style file, just add the \settopmatter line to that.)
The solution Ben gave is one way. But you can actually do this without modifying your texstyle.tex file.
If you add the following lines to your document, the appropriate topmatter will be added to your pdf file:
#para[#:style 'pretitle]{
#elem[#:style "settopmatter"]{
printfolios=true}}
You can see it doing this by running:
> scribble --latex myfile.scrbl
If you do this, you will notice the following line in your pdf file:
\settopmatter{printfolios=true}\titleAndVersionAndAuthors{Hello}{6.9.0.4}{\SNumberOfAuthors{1}\SAuthor{World}}
(Where Hello and World is the name and author of your paper, and the \title... macro runs \maketitle.)
This works because the 'pretitle style (when given to a paragraph), pulls its entire body above the title.
And whenever a string is given as the style for an element, it maps to the a latex command.
That is, this scribble code:
#elem[#:style "mycommand"]{Thebody}
Maps to:
\mycommand{Thebody}
The result of composing these two forms together is to drag this to the top of the file.
And because you've done this in scribble rather than latex, you can use Racket's semantics to add page numbers. For example, if you use your own #lang, you can now have the language decide whether or not you want pages.

asciidoc: is there a way to create an anchor that will be visible in libreoffice writer?

Tl;dr;
What is the correct way to create an anchor in docbook? and is there a way that will make the anchor visible in writer?
Background
I am trying to split up documentation that was previously in single open office documents into smaller asciidoc documents which are both included in the main open office document and also converted to either or both of html & pdf.
I have this mostly working. I use asciidoctor to create html. asciidoctor-pdf to create pdf and a combination of asciidoctor and pandoc to create .odt files. I also tried the python implementation of asciidoc but found the interface less useable.
Round tripping between asciidoc and odt is obviously not possible. This is sort of a fusion where the master document is word processed but pieces of content that can be produced independently (think man pages - in fact that is one of several use cases) are included.
asciidoc to html:
asciidoctor -b html5 foo.adoc -o foo.html
asciidoc to pdf:
asciidoctor-pdf -b pdf foo.adoc -o foo.pdf
asciidoc to odt
asciidoctor -b docbook foo.adoc -o foo.docbook
pandoc --base-header-level=3 -V date:"" -V title:"" -f docbook foo.docbook -o foo.odt
With pandoc I have to nullify the date and title and set the header-level as desired for the section to be inserted as an extra complication.
I insert the resulting .odt into the main document using insert section inside open office.
Note that the main document is not a master document as I could not find a way of creating a master document without also automatically splitting the file on h1 boundaries.
I have two main problems to resolve with this set-up. I would like to add headings in the asciidoc document as cross references and also create entries for them in the alphabetical index (actually the first heading would be suffcient). Is there a way to do this?
Index markers in asciidoc do not result in entries in .odt file being created.
I am able to cross reference content in the inserted section using "insert reference/heading" and referencing the uniquely named header. However, whenever I use "update all" these cross references are invalidated. They are shown as "Error: Reference source not found".
[On a separate note I would also like a way to find broken cross references automatically]
I am currently using libreoffice - Version: 4.3.7.2
I am not adverse to switching version or flavours (i.e. apache) if one behaves better than the other.
I'm not sure if the answer is in the asciidoc or docbook parts of the chain. I would accept an answer which inserts a index entry at the start of the inserted section (top of the .adoc/docbook file) automatically.
I am also open to changing my toolchain to something that will work.
For example I tried the asciidoc-odt backend and fell foul of https://github.com/dagwieers/asciidoc-odf/issues/47 which does not inspire confidence.
Using asciidoc-odt I avoid the need to create an intermediate docbook file. However, I still can't get the anchor to appear.
I can get a macro to create an anchor but at present I haven't figured out how to run the macro from the command line.
To create an anchor in DocBook, make an inline anchor in the .adoc file. For example, giving this to asciidoctor:
[[X1]]Section1
---------------
produced this:
<title>
<anchor xml:id="X1" xreflabel="[X1]"/>
Section1
</title>
Conversely, putting this on separate lines did not create an anchor tag in my test:
[[X1]]
Section 1
Now for some bad news. From the Pandoc User's Guide:
Internal links are currently supported for HTML formats (including HTML slide shows and EPUB), LaTeX, and ConTeXt.
I interpret this to mean that currently, Pandoc does not create internal links in Writer. When I tried it, the link was ignored.
Note: It looks like I did not answer all of your questions. If you want to ask more about LibreOffice cross references and headings (the big bold paragraph towards the end of the question), maybe you could make a separate question just for that part.

Include *prewritten* documentation in Doxygen

To distinguish this question from Doxygen: Adding a custom link under the "Related Pages" section which has an accepted answer that is not a real answer to the question, I specifically add prewritten to the question.
What I want:
Write one document tex file (without preamble, since this file will be \input-ed into a full document)
Import the document into Doxygen's HTML output.
Using Doxygen to produce tex file will probably not work, since it does too much layout work [This holds for its HTML output too like empty table rows 2015]. If Doxygen takes some other input that can easily be transformed into LaTeX, that will do.
You can easily add an already existing Latex file to your doxygen documentation using \latexonly\input{yourfile}\endlatexonly.
I would assume you put it e.g. under a doxygen \page.

Org-Mode Tags inside text instead of Headline

I have a half-made latex presentation in a org-mode file. I want to insert tags in paragraphs which are incomplete. Something along these lines,
* Related Work
Prior work was done by ... :incomplete:
Is this possible?
The solution might be in transforming your plain lists or lines to headlines
* Prior work was done by ... :incomplete:
and use following line into the .org file header
#+OPTIONS: H:2 num:2
that describes to which level headlines are enumerated and included into table of contents.

how can I display knitR markdown in a pandoc rendered pdf

I wish to show the knitR code in the final PDF together with its execution result.
I did not find yet a working way to fence "tripple-backticks"{r}..."tripple-backticks" blocks in the knitR code and see them as-is in the final PDF.
The backticks get interpreted whatever I do.
This is for tutorial purpose so that people see how to write knitR markdown. The use of html "pre" tags around the block of code leads to removal of the code.
for instance I wish to see this example fully first and then the result thereof
adding 4 spaces before each line like here does not work in RStudio and knit HTML fails
```{r test-haskell, engine='haskell', engine.path='ghc', cache=TRUE}
[x | x <- [1..10], odd x]
```
follow-up addition
I include here some RStudio Rmd code that leads to unexpected PDF content
in the pdf, the pre-code block simply disappeared.
The only fix I found is to invent a fake tag 'rmd' to fence the pieces of markdown I wish to keep as-is. I suspect this is a pandoc issue rather than knitr, unless there is a better way to fence code in knitr. The code I wish to keep can be any of bash, perl, R, or any other manguage used to process the data in the knitr tutorial.
my pandoc command was:
pandoc --variable=geometry:'top=1.5cm, bottom=1.5cm, left=2cm,
right=1cm' --variable=papersize:'a4paper' --number-sections
--table-of-contents --template=default.latex --highlight-style tango testrmd.md -o testrmd.pdf
Can it come from the template I used (default.latex)? It is the only template I found that meets my needs for vignette-like output. Same about 'tango' which is the only coloring scheme that shows some light background in code blocks.
As you see from the screenshots above I am a new-bee here (both in markdown and latex). Thanks for any help