TRUEPRINT(1)
trueprint(1) β straight outta the User Manual, and ngl bestie, this one is a whole personality π β¨
π NAME π
trueprint β print program listings on postscript printer. π¨οΈπ
πΈ SYNOPSIS πΈ
trueprint [ options ] [ files ]
π¦ DESCRIPTION π¦
okay so trueprint is a general purpose program printing program. it literally tries to produce everything that anybody could ever need in a program printout, and it does it without making you wrangle a million switches or build some cursed pipeline. it's giving "one command, full fantasy" β¨
as of right now it can handle: C, C++, Java, Perl, Verilog, shell (including ksh), Pascal, pseudo C, report files (that's the trueprint report file β see the NOTES), listing files, and text files.
every page in the output gets a default header made of the date or a user-defined string, plus the current function name, plus the overall page number (which is what the indexes use). and a footer made of the date, the current file name and the page number within that file, and the overall page number. and if the language has the concept of braces, trueprint will drop a braces depth count in the left-hand margin. iconic behavior honestly. π«Ά
the printout has two function indexes at the front β one is an alphabetical list of all the functions, and the other is a list of files with the functions in each file, in alphabetical order. the first one gets suppressed if there are no functions, and the second gets suppressed if there's only one file. (no filler content, we love that for us. β¨)
if you don't specify a language on the command line, the options just default to whatever suits the first file you named on the command line. the filetype comes from the suffix β valid suffixes are:
- C β suffixes
.c.hβ language option-language=c - C++ β suffixes
.cxx.cpp.cc.C.hpp.Hβ language option-langauge=cxx - Java β suffix
.javaβ language option-language=java - Shell β suffix
.shβ language option-language=sh - Perl β suffix
.plβ language option-language=perl - Pascal β suffix
.pasβ language option-language=pascal - Verilog β suffix
.vβ language option-language=v - Pseudo C β suffixes
.pc.phβ language option-language=pseudoc - Report format β suffix
.repβ language option-language=report - Listing β suffix
.lstβ language option-language=list - Plain Text β default β language option
-language=text
when trueprint starts up, it pulls from four sets of options:
- Hard-coded defaults
- Language-specific defaults
- Options taken from the environment variable
$TP_OPTS - Command-line options
each set overrides the ones before it, so command-line options override literally everything else. periodt. π
and if you wanna set up some personal default options? just set the environment variable $TP_OPTS and you're done, bestie. π
π OPTIONS π
β¨ Miscellaneous Options β¨
-D <string>,--debug=<string>β set debug options to<string>(peep USAGE for what<string>actually is).-O <string>,--diff=<string>β if<string>is a file, print the diffs between<string>and the input file; otherwise use it as a prefix and print diffs. See USAGE for more on how to actually use this.-t <string>,--language=<string>β treat the input as this language. use--help=languagefor the list. π-U <string>,--username=<string>β set the username for the coversheet.-H,--help[=<string>]β type out help info, and if you give it the<string>option it lists options for these topics:all-optionsβ all optionsmisc-optionsβ miscellaneous optionspage-furniture-optionsβ page furniture optionstext-format-optionsβ text formatting optionsprint-optionsβ options that select what to printpage-format-optionsβ page format optionsoutput-optionsβ options affecting outputlanguageβ languagespromptβ format for--print-pagesstringdebugβ format for--debugstringheaderβ format for header & footer stringsreportβ file format for--language=reportinputenvironmentβ environment vars used
-V,--versionβ type out version information. π©·-N,--use-environmentβ use environment variables.--N,--ignore-environmentβ don't use values from the environment, like time,$USER, etc. this is for test purposes, so test results come out more reproducible. π§ͺ-R 1,--ps-level-oneβ use level one postscript.-R 2,--ps-level-twoβ use level two postscript.
πΈ Text Formatting πΈ
-b,--no-page-break-after-functionβ don't print page breaks at the end of functions.--b,--page-break-after-functionβ print page breaks at the end of functions.-W,--no-intelligent-line-wrapβ wrap lines at exactly the line-wrap column.--W,--intelligent-line-wrapβ wrap lines intelligently at significant characters, like a space.-L <number>,--minimum-line-length=<number>β the minimum line length that intelligent line wrap will allow (default10).-T <number>,--tabsize=<number>β set the tabsize (default8).-E,--ignore-form-feedsβ don't expand form feed characters into a new page.--E,--form-feedsβ expand form feed characters into a new page.-p <number>,--point-size=<number>β specify the point size (default10).-g <number>,--leading=<number>β specify the interline gap in points (default1).-w <number>,--line-wrap=<number>β specify the line-wrap column.--no-line-wrapβ turn off line-wrap entirely.-l <number>,--page-length=<number>β specify how many lines are on a page; the point size gets calculated appropriately.
π Page Formatting π
-I,--no-holepunchβ don't leave space for holepunch at the side of each page.--I,--holepunchβ leave space for holepunch at the side of each page.-J,--no-top-holepunchβ don't leave space for holepunch at the top of each page.--J,--top-holepunchβ leave space for holepunch at the top of each page.-o p,--portraitβ print using portrait orientation.-o l,--landscapeβ print using landscape orientation.-S 1,--single-sidedβ print single-sided.-S 2,--double-sidedβ print double-sided.-1,--one-upβ print 1-on-1 (this is the default).-2,--two-upβ print 2-on-1.-3,--two-tall-upβ print 2-on-1 at 4-on-1 pointsize.-4,--four-upβ print 4-on-1.
π Page Furniture π
-X <string>,--left-header=<string>β specify the string for the left side of the header.-x <string>,--left-footer=<string>β specify the string for the left side of the footer.-Y <string>,--center-header=<string>β specify the string for the center of the header.-y <string>,--center-footer=<string>β specify the string for the center of the footer.-Z <string>,--right-header=<string>β specify the string for the right side of the header.-z <string>,--right-footer=<string>β specify the string for the right side of the footer.-m <string>,--message=<string>β a message to be printed over the page. it gets printed in a very large, light gray font, so it's giving watermark energy. there are a few escapes you can use as a replacement for<string>β see USAGE for more info. π-G <number>,--gray-bands=<number>β emulate that old lineprinter paper with gray bands across each page. the<number>gives the width of the bands and the gaps between them.-K,--headersβ include the header on each page.--K,--no-headersβ suppress the header on each page.-k,--footersβ include the footer on each page.--k,--no-footersβ suppress the footer on each page.-u,--page-furniture-linesβ draw lines around the header & footer boxes and down the left side of the page.--u,--no-page-furniture-linesβ don't draw lines around the header & footer boxes or down the left side of the page.-i,--no-braces-depthβ exclude the braces depth count.--i,--braces-depthβ include the braces depth count.-n,--no-line-numbersβ exclude the line number count.--n,--line-numbersβ include the line number count.
π¨οΈ Output Options π¨οΈ
by default, trueprint sends the postscript output to lp or lpr, and it explicitly sets the destination to the value of the environment variable $PRINTER. so that's your default pipeline, bestie. π
-d <string>,--printer=<string>β use printer<string>.-P <string>,--printer=<string>β use printer<string>.-s <string>,--output=<string>β send output to filename<string>; use-for stdout.-r,--redirect-outputβ redirect output to a.psfile named after the first filename.--r,--no-redirect-outputβ don't redirect output.-c <number>,--copies=<number>β specify how many copies get printed.
β Print Selection β
-C,--no-cover-sheetβ don't print a cover sheet.--C,--cover-sheetβ print a cover sheet.-A <selection>,--print-pages=<selection>β specify the list of pages to be printed (see USAGE for what<selection>is).-a,--no-promptβ don't prompt for each page about whether it should be printed or not.--a,--promptβ prompt for each page about whether it should be printed or not.-F,--no-file-indexβ don't print the file index.--F,--file-indexβ print the file index.-f,--no-function-indexβ don't print the function index.--f,--function-indexβ print the function index.-B,--no-print-bodyβ don't print the body of text.--B,--print-bodyβ print the body of text.
we are SO not done here β there's more of this page coming, don't go anywhere bestie π
π USAGE π
π the -D / --debug situation
okay so bestie, the -D <string> / --debug=<string> thing works like this:
every single letter flips on a whole lil family of debugging messages, and the digit sitting next to it is the level β 1 means the least messages, 9 means ALL the messages. and the letter @? that one turns on every area at once, so --debug=@9 is literally the "give me everything" button. if you wanna know which letter does which area, run --help=debug and it will spill the whole tea. β¨
ngl this feature is not uniformly implemented β messages were only typically added where they were needed. also, plot twist: messages will not be generated in code prior to the code that sets the debug string! so set that string early, bestie. π«Ά
π the -O / --diff situation
for -O <string> / --diff=<string>, here's the vibe:
you hand over the old version of your file(s) with --diff=<pathname>. if <pathname> with the current filename stuck on the end is a valid file, then it shows you the differences between <pathname>/<filename>. or alternatively, if <pathname> is itself a file and you're only printing one file, then you get the differences between <pathname> and the current file. iconic. examples? say less:
trueprint --diff=../old- this.c that.c
that one prints the differences between ../old-this.c and this.c, and ../old-that.c and that.c.
trueprint --diff=../old/ this.c that.c
that one prints the differences between ../old/this.c and this.c, and ../old/that.c and that.c. and the trailing / is important, do not skip it. π
trueprint --diff=this.c that.c
and that one prints the differences between this.c and that.c. slay.
π the -A / --print-pages situation
for -A <selection> / --print-pages=<selection>, your <selection> is a comma-separated list of page selections, and here's the whole menu:
<number>β print that specific page<number>-<number>β print all the pages between, and including, the specified pages<function-name>β print all pages that include function-namedβ print all pages that have changed (only useful with the--diffoption above π)Dβ print all pages containing functions that have changed (also only useful with--diffabove)fβ print the function indexFβ print the file index
like, for example:
--print-pages=1-5,main,f
that will print the function index, pages 1 to 5, and all the pages for the function main. no notes. π
π¬ the --prompt tea
if you specify --prompt then trueprint will literally ask you about each page, one by one, whether or not it should print that page. it gives you the deets β current filename, current functionname, page number, etc. β and here are all the responses you can throw back at it:
yβ print this pagey<number>β print number pagesy*β print all the remaining pagesnβ skip this pagen<number>β skip number pagesn*β skip all the remaining pagesp<selection>β print all remaining pages that match selection, where selection is in the format defined above?β print a help message
π the --message escapes
the --message=<string> option takes a few % escapes inside <string>, and here they all are:
%%β print a simple%%mβ print the current month of the year as a number, e.g.05%dβ print the current day of the month, e.g.01%yβ print the current year, e.g.1999%Dβ print the date in the formatmm/dd/yy%Lβ print the date and time in long format, e.g.Fri Oct 8 11:49:51 1999%cβ print the last modified date of the current file in the formatmm/dd/yy%Cβ print the last modified date and time of the current file in long format, e.g.Fri Oct 8 11:49:51 1999%Hβ print the current hour%Mβ print the current minute%Sβ print the current second%Tβ print the time in the formatHH:MM:SS%jβ print the day of the year, e.g.095%wβ print the day of the week, e.g.Sunday%aβ print the abbreviated day of the week, e.g.Sun%hβ print the abbreviated month name, e.g.Mar%rβ print the time in am/pm notation, e.g.10:45pm%pβ print the page number in the current file%Pβ print the overall page number%fβ print the total number of pages of the current file%Fβ print the total number of pages%nβ print the current filename%Nβ print the current function name%lβ print the username of the current user
and the default values are, drumroll please π₯:
left-headerβ%Lcenter-headerβ%Nright-headerβPage %P of %Fleft-footerβ%Lcenter-footerβ%n %pright-footerβPage %P of %F
πΈ NOTES πΈ
for most of the languages, trueprint uses the language itself to figure out where the comments live (so it can print them in italics) and where the function names live (so it can print them in bold and pop them into the function index). cute, right? but some languages get extra special treatment:
Pseudo C is like C, except it has a way more forgiving syntax. in particular it ignores strings, so if you leave off a closing quote then pseudo C will still print out using a vaguely sensible format. it's intended for printing code that doesn't even compile yet β we've all been there. π
Listing format assumes very wide lines and a fixed page length of sixty-six characters, so it turns off line-wrap and sets the page length appropriately.
Report format uses a few special characters: anything between ^A and ^E gets printed in bold and included in the function index, and anything between a pair of ^Cs gets printed in italics. β¨
π ENVIRONMENT π
by default Trueprint uses environment variables and the current username. here's the whole squad:
PRINTERβ specify the printer to use when sending postscript output to the printer.TP_OPTSβ specify options. these options override any default options including language defaults, but they get overridden by command line options. so command line stays winning, periodt.TP_DIFF_CMDβ specify the diff command to be used. the command must produce output in the same format as the classic Unix diff. you can use this variable to add flags to the diff command used, for example to make diff ignore whitespace.TP_PRINT_CMDβ specify the print command. the default islpr. if this is set then it should be set to a command that takes standard input. and heads up: if this is set then the destination and number of copies have no effect, i.e. there is no mechanism to pass these values to your print command. oh and if you set this to/bin/catthen the postscript output will appear on stdout. πTP_PRINTERS_FILEβ specify the printers file. the default is the printers file that was initially configured when trueprint was installed. you can use this to test out a new printers file.
π«Ά AUTHOR π«Ά
the program was written by Lezz Giles. please send bug reports to bug-trueprint@gnu.org and ideas for enhancement or similar things to enhance-trueprint@gnu.org. the manpage was written by Othmar Pasteka othmar@tron.at.
okay bestie that's the whole page!! this one's from GNU, dated 7. 1. 2000, and it's TRUEPRINT(1) β go forth and print pretty code, you absolute icon π
π
π¦ where this page comes from
- debian bookworm: trueprint 5.4-5 Β· GPL-2.0-only
- debian trixie: trueprint 5.4-6 Β· GPL-2.0-only
- ubuntu jammy: trueprint 5.4-4 Β· GPL-2.0-only
- ubuntu noble: trueprint 5.4-5 Β· GPL-2.0-only
- ubuntu questing: trueprint 5.4-6
- ubuntu resolute: trueprint 5.4-8 Β· GPL-2.0-only
- ubuntu stonking: trueprint 5.4-8 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms