CM2LATEX(1)
π cm2latex(1) π
okay so bestie, you found it β this is the manual page for cm2latex, straight outta the recommonmark Python package. It's giving "I write Markdown but I need LaTeX energy" and honestly? Iconic. Sit down, grab a π, let's get into it.
β¨ NAME β¨
cm2latex β convert CommonMark file to LaTeX source π¦
π SYNOPSIS π
cm2latex [options] [<source> [<destination>]]
π DESCRIPTION π
So the whole vibe is: you feed it Markdown, it hands you a LaTeX document. Main character behavior fr fr.
It reads from <source> β and plot twist, if you don't give it a source, it just reads from stdin like a chill little gremlin. And it writes to <destination>, but if you don't specify one? stdout, babe. Periodt.
If you want the full settings reference (and there are SO many settings, I'm not even kidding), go look at:
https://docutils.sourceforge.io/docs/user/config.html
π OPTIONS π
Okay this is the long part and I need you to stay with me. Every single flag is here, no skips, no shortcuts. π
πΈ General Docutils Options: πΈ
--title=TITLEβ set the document title, but as metadata, not as a big dramatic header. It's the quiet title. The mysterious title. π--generator,-gβ adds a cute little "Generated by Docutils" credit and link. Give credit where credit is due, bestie. β¨--no-generatorβ nope, no generator credit. You're keeping it lowkey.--date,-dβ slaps the date at the end of the document (UTC).--time,-tβ slaps the time and date at the end (UTC). Fancier.--no-datestampβ no datestamp of any kind. None. Zero. Not a crumb. π--source-link,-sβ adds a "View document source" link so people can peek behind the curtain.--source-url=<URL>β use<URL>for that source link. Heads up: this implies--source-linkall on its own.--no-source-linkβ no "View document source" link. The curtain stays closed. π--toc-entry-backlinksβ links go from section headers back to TOC entries. (default)--toc-top-backlinksβ links go from section headers to the top of the TOC instead.--no-toc-backlinksβ backlinks to the table of contents? Disabled. Gone. π«--footnote-backlinksβ links from footnotes/citations back to their references. (default)--no-footnote-backlinksβ no backlinks from footnotes and citations.--section-numberingβ Docutils numbers your sections. (default) Slay.--no-section-numberingβ Docutils does not number your sections.--strip-commentsβ yeets comment elements out of the document tree. π§Ή--leave-commentsβ leaves comment elements right where they are. (default)--strip-elements-with-class=<class>β removes every element withclasses="<class>"from the document tree. > β οΈ Warning: potentially dangerous; use with caution. Also: this is a multiple-use option, so you can stack it. π--strip-class=<class>β removes allclasses="<class>"attributes from elements in the document tree. > β οΈ Warning: potentially dangerous; use with caution. Also a multiple-use option.--report=<level>,-r <level>β report system messages at or higher than<level>. Your menu of levels:"info"or"1","warning"/"2"(default),"error"/"3","severe"/"4","none"/"5".--verbose,-vβ report all system messages. Literally the same as"--report=1". Spill everything. π£οΈ--quiet,-qβ report no system messages at all. Same as"--report=5". Silence. π€«--halt=<level>β stop execution at system messages at or above<level>. Same level menu as--report. Default:4(severe).--strictβ halt at the slightest problem. Same as"--halt=info". She's sensitive, okay? π--exit-status=<level>β turn on a non-zero exit status for non-halting system messages at or above<level>. Default:5(disabled).--debugβ enables debug-level system messages and diagnostics. For when you wanna see everything. π--no-debugβ disables debug output. (default)--warnings=<file>β send the output of system messages to<file>.--tracebackβ enables Python tracebacks when Docutils halts. The full dramatic backtrace. π¬--no-tracebackβ disables Python tracebacks. (default)--input-encoding=<name[:handler]>,-i <name[:handler]>β specify the encoding, and optionally the error handler, for input text. Default:<auto-detect>:strict.--input-encoding-error-handler=INPUT_ENCODING_ERROR_HANDLERβ the error handler for undecodable characters. Choices:"strict"(default),"ignore", and"replace".--output-encoding=<name[:handler]>,-o <name[:handler]>β the text encoding for output, plus optionally its error handler. Default:utf-8:strict.--output-encoding-error-handler=OUTPUT_ENCODING_ERROR_HANDLERβ error handler for unencodable output characters:"strict"(default),"ignore","replace","xmlcharrefreplace","backslashreplace".--error-encoding=<name[:handler]>,-e <name[:handler]>β text encoding and optionally the error handler for error output. Default text encoding: the system encoding. Default error handler:backslashreplace.--error-encoding-error-handler=ERROR_ENCODING_ERROR_HANDLERβ error handler for unencodable characters in error output. Default:backslashreplace.--language=<name>,-l <name>β pick the language (as a BCP 47 language tag). Default:en.--record-dependencies=<file>β writes output file dependencies into<file>. Receipts. π§Ύ--config=<file>β reads configuration settings from<file>... but only if it exists. No file, no drama.--version,-Vβ show the program's version number and dip. π--help,-hβ show this help message and dip.
π Generic Parser Options: π
--no-file-insertionβ disables directives that insert the contents of an external file. Instead you get a"warning"system message. Sorry bestie. π--file-insertion-enabledβ enables directives that insert the contents of an external file. (default)--no-rawβ disables the"raw"directive; replaced with a"warning"system message.--raw-enabledβ enables the"raw"directive. (default)--line-length-limit=<length>β the max number of characters in an input line. Default10 000.
π¦ Standalone Reader Options: π¦
--no-doc-titleβ disables the promotion of a lone top-level section title to document title (and the follow-up promotion of a section title to document subtitle β that whole thing is enabled by default).--no-doc-infoβ disables the bibliographic field list transform (which is enabled by default).--section-subtitlesβ activates promotion of lone subsection titles to section subtitles (disabled by default).--no-section-subtitlesβ deactivates that promotion of lone subsection titles.
π LaTeX-Specific Options: π
Okay this section is the whole personality of the page, buckle up. π
--documentclass=DOCUMENTCLASSβ specify the LaTeX documentclass. Default:"article".--documentoptions=DOCUMENTOPTIONSβ specify document options. You can give multiple, separated by commas. Default:"a4paper".--footnote-references=<format>β the format for footnote references: either"superscript"or"brackets". Default:"superscript".--use-latex-citationsβ use the\citecommand for citations. (future default) π--figure-citationsβ use figure floats for citations. Heads up: it might get mixed with real figures. (provisional default)--attribution=<format>β format for block quote attributions:"dash"(em-dash prefix),"parentheses"/"parens", or"none". Default:"dash".--stylesheet=<file[,file,...]>β specify LaTeX packages/stylesheets. A style gets referenced with"\usepackage"if the extension is".sty"or omitted, and with"\input"otherwise. This overrides previous--stylesheetand--stylesheet-pathsettings. π₯--stylesheet-path=<file[,file,...]>β a comma separated list of LaTeX packages/stylesheets. Relative paths get expanded if a matching file is found in the--stylesheet-dirs. With--linkstylesheet, the path is rewritten relative to the output*.texfile.--link-stylesheetβ link to the stylesheet(s) in the output file. (default)--embed-stylesheetβ embed the stylesheet(s) in the output file. Note: stylesheets must be accessible during processing.--stylesheet-dirs=<dir[,dir,...]>β comma-separated list of directories where stylesheets are found. Used by--stylesheet-pathwhen expanding relative path arguments. Default:".".--latex-preamble=LATEX_PREAMBLEβ customization via LaTeX code in the preamble. Default: select PDF standard fonts (Times, Helvetica, Courier).--template=<file>β specify the template file. Default:"default.tex".--use-latex-tocβ table of contents by LaTeX. (default)--use-docutils-tocβ table of contents by Docutils (no page numbers, soz).--use-part-sectionβ add parts on top of the section hierarchy.--use-docutils-docinfoβ attach author and date to the document info table. (default)--use-latex-docinfoβ attach author and date to the document title instead.--topic-abstractβ typeset the abstract as a topic. (default)--use-latex-abstractβ use the LaTeX abstract environment for the document's abstract.--hyperlink-color=HYPERLINK_COLORβ the color of any hyperlinks embedded in text. Default:"blue"(use"false"to disable).--hyperref-options=HYPERREF_OPTIONSβ extra options for the"hyperref"package.--compound-enumeratorsβ enable compound enumerators for nested enumerated lists (like"1.2.a.ii"). Cute, right? β¨--no-compound-enumeratorsβ disable compound enumerators for nested enumerated lists. (default)--section-prefix-for-enumeratorsβ enable section ("."subsection ...) prefixes for compound enumerators. Careful: this has no effect without--compound-enumerators.--no-section-prefix-for-enumeratorsβ disable section prefixes for compound enumerators. (default)--section-enumerator-separator=<char>β set the separator between the section number and the enumerator for compound enumerated lists. Default:"-".--literal-block-env=LITERAL_BLOCK_ENVβ when possible, use the specified environment for literal-blocks. Default:""(falls back to"alltt").--use-verbatim-when-possibleβ deprecated alias for"--literal-block-env=verbatim". It's giving legacy, bestie. π«--table-style=<format>β table style."standard"gets horizontal and vertical lines,"booktabs"(LaTeX booktabs style) gets only horizontal lines above and below the table and below the header, or"borderless". Default:"standard".--graphicx-option=GRAPHICX_OPTIONβ LaTeX graphicx package option. Possible values are"dvipdfmx","dvips","dvisvgm","luatex","pdftex", and"xetex". Default:"".--font-encoding=FONT_ENCODINGβ LaTeX font encoding. Possible values are"","T1"(default),"OT1","LGR,T1"or any other combination of options to thefontencpackage.--reference-label=REFERENCE_LABELβ by default the latex-writer puts the reference title into hyperreferences. Specify"ref*"or"pageref*"to get the section number or the page number instead.--use-bibtex=USE_BIBTEXβ specify style and database for bibtex, for example"--use-bibtex=mystyle,mydb1,mydb2".--legacy-class-functionsβ bestie, this one goes old school: it uses the legacy functions with a class value list for\DUtitleand\DUadmonition. Retro vibes π--new-class-functionsβ the glow-up option β¨ it uses\DUroleand"DUclass"wrappers for class values, and it tucks your admonition content inside an environment. This is the default, so it's already what you're getting unless you say otherwise.--legacy-column-widthsβ uses the legacy algorithm to figure out table column widths. It's the provisional default rn, so likeβ¦ it's what happens, but it's not forever, ok? π--new-column-widthsβ uses the new algorithm for table column widths. It's the future default π so get familiar, the algorithm is in its main character era.--docutils-footnotesβ footnotes get numbers/symbols, courtesy of Docutils. This is the default π
heads up bestie: the alternative to that last one, --latex-footnotes, is not implemented yet π so don't come for it, it literally does not exist yet.
π AUTHOR π
Steve Genoud and Luca Barbato π«Ά
πΈ COPYRIGHT πΈ
Copyright (C) 2014 Steve Genoud and Luca Barbato
and that's the whole page, bestie, you made it to the end π this gorgeous lil doc comes from recommonmark, Debian 0.7.1+ds-5, dated February 2023 β iconic behavior, fr fr. now go convert some markdown to LaTeX, you've got this π β¨
π¦ where this page comes from
- debian bookworm: recommonmark-scripts 0.7.1+ds-5 Β· MIT
- ubuntu noble: recommonmark-scripts 0.7.1+ds-5 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms