I'm writing a readme.md file, I wanted it to be like this:
#create a new env
$some code
$code
But in markdown, the first line will become very big and displayed as a header, like this:
I just want it to be displayed as a normal format, any suggestions?
Related
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
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.
Output of Python code cell seems to be not processed by Markdown.
For example in Python code cell there could be something like that:
print "**bold**"
And the output is: **bold** instead of bold. Is there a way to make it really bold?
To get markdown formatted output, you can use the Markdown object of the display machinery. A print-like function could thus look like
from IPython.display import Markdown, display
def printmd(string):
display(Markdown(string))
printmd('**bold**')
I am trying to read the text content of a pdf file into a Perl variable. From other SO questions/answers I get the sense that I need to use CAM::PDF. Here's my code:
#!/usr/bin/perl -w
use CAM::PDF;
my $pdf = CAM::PDF->new('1950-01-01.pdf');
print $pdf->numPages(), " pages\n\n";
my $text = $pdf->getPageText(1);
print $text, "\n";
I tried running this on this pdf file. There are no errors reported by Perl. The first print statement works; it prints "2 pages" which is the correct number of pages in this document.
The next print statement does not return anything readable. Here's what the output looks like in Emacs:
2 pages
^A^B^C^D^E^C^F^D^G^H
^D^A^K^L^C^M^D^N^C^M^O^D^P^C^Q^Q^C ^D^R^K^M^O^D ^A^B^C^D^E
^F^G^G^H^E
^K^L
^M^N^E^O^P^E^O^Q^R^S^E
.... more lines with similar codes ....
Is there something I can do to make this work? I don't understand pdf files too well, but I thought that because I can easily copy and paste the text from the PDF file using Acrobat, it must be recognized as text and not an image, so I hoped this meant I could extract it with Perl.
Any guidance would be much appreciated.
PDFs can have different kinds of content. A PDF may not have any readable text at all, only bitmaps and graphical content, for example. The PDF you linked to, has compressed data in it. Open it with a text editor, and you will see that the content is in a "/Filter/FlateDecode" block. Perhaps CAM::PDF doesn't support that. Google FlateDecode for a few ideas.
Looking further into that PDF, i see that it also uses embedded subsets of fonts, with custom encodings. Even if CAM::PDF handles the compression, the custom encoding may be what's throwing it off. This may help: Web page from a software company, describing the problem
I'm fairly certain that the issue isn't with your perl code, it is with the PDF file. I ran the same script on one of my own PDF files, and it works just fine.
I'm writing a README.mediawiki file for my project called plainBlog on GitHub, but I want to add some inline code on it. What is the syntax for this? Also, what is the syntax for XML code (multiple lines)?
An example of inline code is located at github/markup, where we have lines like this: gem install wikicloth
There's a few:
Start each line with a space.
Text is '''preformatted''' and
''markups'' '''''can''''' be done
or:
<pre> Text is '''preformatted''' and
''markups'' '''''cannot''''' be done</pre>
For inline <code> spans there is no special syntax:
<code>Source code</code>
From http://www.mediawiki.org/wiki/Help:Formatting