pagebreak in markdown while creating pdf

前端 未结 6 435
囚心锁ツ
囚心锁ツ 2021-01-30 03:45

I am creating a pdf of markdown text file using doxygen (1.8.6). Now I want to get page break at specific stage in markdown file, I used this link.

In the given link the

6条回答
  •  再見小時候
    2021-01-30 04:17

    Blockquotes vs. line breaks

    > is not used for line breaks in Markdown. It's used for blockquotes. For example, the following Markdown code

    > A man provided with paper, pencil, and rubber, and
    > subject to strict discipline, is in effect a universal machine.
    

    becomes

    A man provided with paper, pencil, and rubber, and subject to strict discipline, is in effect a universal machine.

    (This is a quote from Alan Turing.)

    Note how it is rendered with a yellow background by Stack Overflow. If you examine the generated markup you will find

    tags being used.

    Line breaks can usually be inserted by ending a line with two or more spaces (Markdown syntax) or by using raw
    tags (most Markdown processors allow inline HTML). For example (using to represent a space), this Markdown

    123 Fake Street␣␣
    Springfield, USA
    

    becomes

    123 Fake Street
    Springfield, USA

    Page breaks

    Since the original specification Markdown was designed for HTML output (which doesn't have the concept of pages) there is no support for page breaks.

    Doxygen uses LaTeX to generate its PDFs. It doesn't seem to support inline LaTeX¹, but you should be able to modify the intermediate .tex file and then use pdflatex to generate your PDF:

    1. Use Doxygen to generate a .tex file
    2. Edit the .tex file manually add \newpage wherever you want page breaks
    3. Run pdflatex documentation.tex
    4. Examine documentation.pdf

    This question may be a useful reference for step 3 above.

    ¹Doxygen does support inline LaTeX formulas, but I wasn't able to find any mention of arbitrary inline LaTeX commands like \newpage that operate in the text environment.

提交回复
热议问题