From 719115f258000daa4b04332aef9fb9ad73440e49 Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 27 Apr 2013 16:37:12 +0200 Subject: Remove double spaces when relevant --- doc/ledger3.texi | 104 +++++++++++++++++++++++++++---------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index d680bc5a..4db9cd5d 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -1,4 +1,4 @@ -\input texinfo @c -*-texinfo-*- +\input texinfo @c -*-texinfo-*- @setfilename ledger3.info @settitle Ledger: Command-Line Accounting @@ -1531,7 +1531,7 @@ commodity name must be enclosed in double quotes: Buying stock is a typical example that many will use that involves multiple commodities in the same transaction. The type of the share -(AAPL for Apple Inc.) and the share purchase price in the currency +(AAPL for Apple Inc.) and the share purchase price in the currency unit you made the purchase in ($ for AAPL). Yes, the typical convention is as follows: @@ -1970,7 +1970,7 @@ apply account Personal Would result in all postings going into @code{Personal:Expenses:Groceries} and @code{Personal:Assets:Checking} -until and @code{end apply account} directive was found. +until and @code{end apply account} directive was found. @item alias @c instance_t::alias_directive @@ -2393,7 +2393,7 @@ organization, just keep in mind this maxim: Do whatever keeps you doing it. @node Transactions, Building Reports, Keeping a Journal, Top -@chapter Transactions +@chapter Transactions @menu * Basic format:: @@ -2445,7 +2445,7 @@ A transaction can have any number of postings: @end smallexample @node Eliding amounts, Auxiliary dates, Basic format, Transactions -@section Eliding amounts +@section Eliding amounts The first thing you can do to make things easier is elide amounts. That is, if exactly one posting has no amount specified, Ledger will @@ -2702,7 +2702,7 @@ journal file, which would let me know right away that it is an invalid date. @node Virtual postings, Expression amounts, Metadata, Transactions -@section Virtual postings +@section Virtual postings Ordinarily, the amounts of all postings in a transaction must balance to zero. This is non-negotiable. It's what double-entry accounting @@ -2796,7 +2796,7 @@ to be for the total in Assets:Cash to be $500.00 after the posting. If the resulting amount is not $-20.00 in this case, it is an error. @node Resetting a balance, Balancing transactions, Balance assignments, Balance verification -@subsection Resetting a balance +@subsection Resetting a balance Say your book-keeping has gotten a bit out of date, and your Ledger balance no longer matches your bank balance. You can create an @@ -2816,7 +2816,7 @@ may be empty --- and then only because it's not true empty, it is indirectly provided by the balance assignment's value. @node Balancing transactions, , Resetting a balance, Balance verification -@subsection Balancing transactions +@subsection Balancing transactions As a consequence of all the above, consider the following transaction: @@ -3845,10 +3845,10 @@ invested in equities, and partially invested in bonds and cash. Below is the asset allocation for each of the instruments listed above: @multitable @columnfractions .2 .2 .3 .3 -@item @tab Domestic @tab Global @tab -@item Symbol @tab Equity @tab Equity @tab bonds/cash +@item @tab Domestic @tab Global @tab +@item Symbol @tab Equity @tab Equity @tab bonds/cash @item VIFSX @tab 100% @tab @tab -@item VTHRX @tab 24.0% @tab 56.3% @tab 19.7% +@item VTHRX @tab 24.0% @tab 56.3% @tab 19.7% @item VSGBX @tab @tab @tab 100% @end multitable @@ -4932,7 +4932,7 @@ commands. @end multitable @node Error Checking and Calculation Options, Output Customization Quick Reference, Report Filtering Quick Reference, Command Line Quick Reference -@subsection Error Checking and Calculation Options +@subsection Error Checking and Calculation Options @multitable @columnfractions .1 .25 .65 @item @strong{Short} @tab @strong{Long} @tab @strong{Description} @@ -4975,7 +4975,7 @@ commands. @item @code{} @tab @code{--register-format STR} @tab @item @code{} @tab @code{--prices-format STR} @tab @item @code{-w register} @tab @code{--wide-register-format STR} @tab -@item @code{} @tab @code{--anon} @tab Print the ledger register with anonymized accounts and payees, useful for filing bug reports +@item @code{} @tab @code{--anon} @tab Print the ledger register with anonymized accounts and payees, useful for filing bug reports @end multitable @node Grouping Options, Commodity Reporting Quick Reference, Output Customization Quick Reference, Command Line Quick Reference @@ -4984,12 +4984,12 @@ commands. @multitable @columnfractions .1 .25 .65 @item @strong{Short} @tab @strong{Long} @tab @strong{Description} @item @code{-P} @tab @code{--by-payee} @tab Group postings by common payee names -@item @code{-D} @tab @code{--daily} @tab Group postings by day +@item @code{-D} @tab @code{--daily} @tab Group postings by day @item @code{-W} @tab @code{--weekly} @tab Group postings by week @item @code{-M} @tab @code{--monthly} @tab Group postings by month -@item @code{} @tab @code{--quarterly} @tab Group postings by quarter -@item @code{-Y} @tab @code{--yearly} @tab Group postings by year -@item @code{} @tab @code{--dow} @tab Group by day of weeks +@item @code{} @tab @code{--quarterly} @tab Group postings by quarter +@item @code{-Y} @tab @code{--yearly} @tab Group postings by year +@item @code{} @tab @code{--dow} @tab Group by day of weeks @item @code{-s} @tab @code{--subtotal} @tab Group posting together, similar to balance report @end multitable @@ -5002,10 +5002,10 @@ commands. @item @code{-L MINS} @tab @code{--price-exp MINS} @tab Set expected freshness of prices in minutes @item @code{-Q} @tab @code{--download} @tab Download quotes using @code{getquote} @item @code{} @tab @code{--getquote} @tab Sets path to a user defined script to download commodity prices. -@item @code{-O} @tab @code{--quantity} @tab Report commodity totals without conversion +@item @code{-O} @tab @code{--quantity} @tab Report commodity totals without conversion @item @code{-B} @tab @code{--basis} @tab Report cost basis @item @code{-V} @tab @code{--market} @tab Report last known market value -@item @code{-G} @tab @code{--gain} @tab Report net gain loss for commodities that have a price history +@item @code{-G} @tab @code{--gain} @tab Report net gain loss for commodities that have a price history @end multitable @node Detailed Options Description, Period Expressions, Command Line Quick Reference, Command-line Syntax @@ -5957,7 +5957,7 @@ Set the value expression used for the ``totals'' column in the @c Valid Ledger invocations look like: @c @smallexample -@c ledger [OPTIONS] +@c ledger [OPTIONS] @c @end smallexample @c Where @code{COMMAND} is any command verb (@pxref{Reporting @@ -5965,25 +5965,25 @@ Set the value expression used for the ``totals'' column in the @c @code{SEARCH-TERM} is one or more of the following: @c @smallexample -@c word search for any account containing 'word' -@c TERM and TERM boolean AND between terms -@c TERM or TERM boolean OR between terms -@c not TERM invert the meaning of the term -@c payee word search for any payee containing 'word' -@c @@word shorthand for 'payee word' -@c desc word alternate for 'payee word' -@c note word search for any note containing 'word' -@c &word shorthand for 'note word' -@c tag word search for any metadata tag containing 'word' -@c tag word=value search for any metadata tag containing 'word' -@c whose value contains 'value' -@c %word shorthand for 'tag word' -@c %word=value shorthand for 'tag word=value' -@c meta word alternate for 'tag word' -@c meta word=value alternate for 'tag word=value' -@c expr 'EXPR' apply the given value expression as a predicate -@c '=EXPR' shorthand for 'expr EXPR' -@c \( TERMS \) group terms; useful if using and/or/not +@c word search for any account containing 'word' +@c TERM and TERM boolean AND between terms +@c TERM or TERM boolean OR between terms +@c not TERM invert the meaning of the term +@c payee word search for any payee containing 'word' +@c @@word shorthand for 'payee word' +@c desc word alternate for 'payee word' +@c note word search for any note containing 'word' +@c &word shorthand for 'note word' +@c tag word search for any metadata tag containing 'word' +@c tag word=value search for any metadata tag containing 'word' +@c whose value contains 'value' +@c %word shorthand for 'tag word' +@c %word=value shorthand for 'tag word=value' +@c meta word alternate for 'tag word' +@c meta word=value alternate for 'tag word=value' +@c expr 'EXPR' apply the given value expression as a predicate +@c '=EXPR' shorthand for 'expr EXPR' +@c \( TERMS \) group terms; useful if using and/or/not @c @end smallexample @c So, to list all transaction that charged to ``food'' but not @@ -5991,9 +5991,9 @@ Set the value expression used for the ``totals'' column in the @c commands would be equivalent: @c @smallexample -@c ledger reg food not dining @@chang -@c ledger reg food and not dining and not payee chang -@c ledger reg food not dining expr 'payee =~ /chang/' +@c ledger reg food not dining @@chang +@c ledger reg food and not dining and not payee chang +@c ledger reg food not dining expr 'payee =~ /chang/' @c @end smallexample @node Output Customization, Commodity Reporting, Report Filtering, Detailed Options Description @@ -6976,12 +6976,12 @@ Useful specifying a date in plain terms. For example, you could say @multitable @columnfractions .3 .2 .5 @item @strong{Function} @tab @strong{Abbrev.} @tab @strong{Description} @item @code{amount_expr } @tab @code{} @tab -@item @code{abs } @tab @code{} @tab --> U +@item @code{abs } @tab @code{} @tab --> U @item @code{ceiling } @tab @code{} @tab Return the next integer toward +infinity @item @code{code} @tab @code{} @tab Return the transaction code, the string between the parenthesis after the date. @item @code{commodity } @tab @code{} @tab -@item @code{display_amount } @tab @code{} @tab --> t -@item @code{display_total } @tab @code{} @tab --> T +@item @code{display_amount } @tab @code{} @tab --> t +@item @code{display_total } @tab @code{} @tab --> T @item @code{date } @tab @code{} @tab @item @code{format_date } @tab @code{} @tab @item @code{format } @tab @code{} @tab @@ -6992,7 +6992,7 @@ Useful specifying a date in plain terms. For example, you could say @item @code{join } @tab @code{} @tab @item @code{market --> P } @tab @code{} @tab @item @code{null } @tab @code{} @tab -@item @code{now --> d m } @tab @code{} @tab +@item @code{now --> d m } @tab @code{} @tab @item @code{options } @tab @code{} @tab @item @code{post } @tab @code{} @tab @item @code{percent } @tab @code{} @tab @@ -7348,10 +7348,10 @@ as @table @code @item %m-%d-%Y %A -yields @code{02-10-2010 Wednesday} +yields @code{02-10-2010 Wednesday} @item %A %m-%d-%Y -yields @code{Wednesday 02-10-2010} +yields @code{Wednesday 02-10-2010} @end table @noindent @@ -7382,10 +7382,10 @@ as @table @code @item %m-%d-%Y %B -yields @code{ 02-10-2010 February} +yields @code{ 02-10-2010 February} @item %B %m-%d-%Y -yields @code{February 02-10-2010} +yields @code{February 02-10-2010} @end table @noindent @@ -7418,11 +7418,11 @@ week of the year 01–53 @item %C @code{cc} century 00–99 @item %D -yields @code{mm/dd/yy 02/10/10} +yields @code{mm/dd/yy 02/10/10} @item %x locale’s date representation @code{02/10/2010} for the U.S. @item %F -yields @code{%Y-%m-%d 2010-02-10} +yields @code{%Y-%m-%d 2010-02-10} @end table @menu -- cgit v1.2.3 From fa9eb2e0f51f7c8ce5f42883ac8f234c1bf83cb4 Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 27 Apr 2013 16:52:57 +0200 Subject: CSV is Comma Separated Values --- doc/ledger3.texi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 4db9cd5d..3b4b5d9c 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -4062,7 +4062,7 @@ file whose formatting has gotten out of hand. @section Reports in other Formats @menu -* Comma Separated Variable files:: +* Comma Separated Values files:: * The lisp command:: * Emacs Org mode:: * Org mode with Babel:: @@ -4071,15 +4071,15 @@ file whose formatting has gotten out of hand. * prices and pricedb:: @end menu -@node Comma Separated Variable files, The lisp command, Reports in other Formats, Reports in other Formats -@subsection Comma Separated Variable files +@node Comma Separated Values files, The lisp command, Reports in other Formats, Reports in other Formats +@subsection Comma Separated Values files @menu * The csv command:: * The convert command:: @end menu -@node The csv command, The convert command, Comma Separated Variable files, Comma Separated Variable files +@node The csv command, The convert command, Comma Separated Values files, Comma Separated Values files @subsubsection The @code{csv} command The @command{csv} command will output print out the desired ledger @@ -4087,7 +4087,7 @@ transactions in a csv format suitable for import into other programs. You can specify the transactions to print using all the normal limiting and searching functions. -@node The convert command, , The csv command, Comma Separated Variable files +@node The convert command, , The csv command, Comma Separated Values files @subsubsection The @code{convert} command @cindex csv conversion @cindex reading csv @@ -4188,7 +4188,7 @@ match on the new payee field. During the @code{ledger convert} run only the original payee name as specified in the csv data seems to be used. -@node The lisp command, Emacs Org mode, Comma Separated Variable files, Reports in other Formats +@node The lisp command, Emacs Org mode, Comma Separated Values files, Reports in other Formats @subsection The @code{lisp} command The @command{lisp} command outputs results in a form that can be read -- cgit v1.2.3 From d78c336741b8dcef7835b3b632314c519d57e86e Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 27 Apr 2013 17:05:40 +0200 Subject: Use @headitem in @multitable. This prints nicer in Info output. This prints the same in TeX output. --- doc/ledger3.texi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 3b4b5d9c..23343770 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -4880,7 +4880,7 @@ commands. @subsection Reporting Commands @multitable @columnfractions .2 .8 -@item @strong{Report} @tab @strong{Description} +@headitem Report @tab Description @item @code{balance} @tab Show account balances @item @code{register} @tab Show all transactions with running total @item @code{csv} @tab Show transactions in csv format, for exporting to other programs @@ -4897,7 +4897,7 @@ commands. @subsection Basic Options @multitable @columnfractions .1 .25 .65 -@item @strong{Short} @tab @strong{Long} @tab @strong{Description} +@headitem Short @tab Long @tab Description @item @code{-h} @tab @code{--help} @tab Print summary of all options @item @code{-v} @tab @code{--version} @tab Print version of ledger executable @item @code{-f FILE} @tab @code{--file FILE} @tab Read @file{FILE} as a ledger file @@ -4910,7 +4910,7 @@ commands. @subsection Report Filtering @multitable @columnfractions .1 .25 .65 -@item @strong{Short} @tab @strong{Long} @tab @strong{Description} +@headitem Short @tab Long @tab Description @item @code{-c} @tab @code{--current} @tab Display transaction on or before the current date @item @code{-b DATE} @tab @code{--begin DATE} @tab Begin reports on or after @code{DATE} @item @code{-e DATE} @tab @code{--end DATE} @tab Limit end date of transactions for report @@ -4935,7 +4935,7 @@ commands. @subsection Error Checking and Calculation Options @multitable @columnfractions .1 .25 .65 -@item @strong{Short} @tab @strong{Long} @tab @strong{Description} +@headitem Short @tab Long @tab Description @item @code{} @tab @code{--strict} @tab Accounts, tags or commodities not previously declared will cause warnings @item @code{} @tab @code{--pedantic} @tab Accounts, tags or commodities not previously declared will cause errors @item @code{} @tab @code{--check-payees} @tab Enable strict and pedantic checking for payees as well as accounts, commodities and tags @@ -4946,7 +4946,7 @@ commands. @subsection Output Customization @multitable @columnfractions .15 .4 .45 -@item @strong{Short} @tab @strong{Long} @tab @strong{Description} +@headitem Short @tab Long @tab Description @item @code{-n} @tab @code{--collapse} @tab Collapse transactions with multiple postings @item @code{-s} @tab @code{--subtotal} @tab Report register as a single subtotal @item @code{-P} @tab @code{--by-payee} @tab Report subtotals by payee @@ -4982,7 +4982,7 @@ commands. @subsection Grouping Options @multitable @columnfractions .1 .25 .65 -@item @strong{Short} @tab @strong{Long} @tab @strong{Description} +@headitem Short @tab Long @tab Description @item @code{-P} @tab @code{--by-payee} @tab Group postings by common payee names @item @code{-D} @tab @code{--daily} @tab Group postings by day @item @code{-W} @tab @code{--weekly} @tab Group postings by week @@ -4997,7 +4997,7 @@ commands. @subsection Commodity Reporting @multitable @columnfractions .1 .25 .65 -@item @strong{Short} @tab @strong{Long} @tab @strong{Description} +@headitem Short @tab Long @tab Description @item @code{} @tab @code{--price-db FILE} @tab Use @file{FILE} for retrieving stored commodity prices @item @code{-L MINS} @tab @code{--price-exp MINS} @tab Set expected freshness of prices in minutes @item @code{-Q} @tab @code{--download} @tab Download quotes using @code{getquote} @@ -6974,7 +6974,7 @@ Useful specifying a date in plain terms. For example, you could say @subsection Miscellaneous @multitable @columnfractions .3 .2 .5 -@item @strong{Function} @tab @strong{Abbrev.} @tab @strong{Description} +@headitem Function @tab Abbrev. @tab Description @item @code{amount_expr } @tab @code{} @tab @item @code{abs } @tab @code{} @tab --> U @item @code{ceiling } @tab @code{} @tab Return the next integer toward +infinity -- cgit v1.2.3 From 75fa5fdeb09f3273d63890b948b6d915f8268fce Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 27 Apr 2013 17:09:53 +0200 Subject: moved from @strong to @emph on some items --- doc/ledger3.texi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 23343770..d14df485 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -1614,7 +1614,7 @@ both exist, you ask? To support things like this: @end smallexample This transaction says that you bought 11 gallons priced at $2.299 per -gallon at a @strong{cost to you} of $2.30 per gallon. Ledger +gallon at a @emph{cost to you} of $2.30 per gallon. Ledger auto-generates a balance posting in this case to Equity:Capital Losses to reflect the 1.1 cent difference, which is then balanced by Assets:Checking because its amount is null. @@ -2140,7 +2140,7 @@ is equivalent to this: Note that ending a @code{fixed} is done differently than other directives, as @code{fixed} is closed with an @code{endfixed} (i.e., -there is @strong{no space} between @code{end} and @code{fixed}). +there is @emph{no space} between @code{end} and @code{fixed}). For the moment, users may wish to study @uref{http://bugs.ledger-cli.org/show_bug.cgi?id=789, Bug Report 789} @@ -5436,15 +5436,15 @@ Report each posting’s deviation from the average. It is only meaningful in the register and prices reports. @item --display-amount -Apply a transform to the -@strong{displayed} amount. This occurs after calculations occur. +Apply a transform to the @emph{displayed} amount. This occurs after +calculations occur. @item --display Display lines that satisfy the expression given. @item --display-total -Apply a transform to the -@strong{displayed} total. This occurs after calculations occur. +Apply a transform to the @emph{displayed} total. This occurs after +calculations occur. @item --dow group transactions by the day of the week. -- cgit v1.2.3 From 98bb69be4b30f67690a7c8a7ae5e7c0f8c580615 Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 27 Apr 2013 17:37:00 +0200 Subject: minor changes for consistency --- doc/ledger3.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index d14df485..7d51c44e 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -1645,7 +1645,7 @@ A valuation function receives three arguments: @table @code @item source A string identifying the commodity whose price is being asked for -(example: "EUR") +(example: ``EUR'') @item date The reference date the price should be relative. @@ -4642,7 +4642,7 @@ The format of an amount contains two members, the commodity and the quantity. The commodity can have a set of flags that indicate how to display it. The meaning of the flags (all of which are optional) are: -@table @strong +@table @code @item P The commodity is prefixed to the value. @item S -- cgit v1.2.3 From d1c4d1b60e718f8436b7d45ab2d345244fa4d2bf Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 27 Apr 2013 17:50:11 +0200 Subject: Removed this op index, will only use standard @findex fn index, and particularly @ftable --- doc/ledger3.texi | 4 ---- 1 file changed, 4 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 7d51c44e..a4ac0529 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -2,10 +2,6 @@ @setfilename ledger3.info @settitle Ledger: Command-Line Accounting -@c Define a new index for options. -@defcodeindex op -@c Put options in function index. -@syncodeindex op fn @c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with @c a prefix arg). This updates the node pointers, which texinfmt.el -- cgit v1.2.3 From 173ad3d05313455b937e876fef802801b080a10b Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 27 Apr 2013 17:55:25 +0200 Subject: Moved @subsubheading to @subsubsection for consistency --- doc/ledger3.texi | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index a4ac0529..c112ba86 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -4297,7 +4297,8 @@ least) in which these can be included: The first two are described in more detail in this short tutorial. -@subsubheading Embedded Ledger example with single source block +@node Embedded Ledger example with single source block, , Org mode with Babel, Org mode with Babel +@subsubsection Embedded Ledger example with single source block The easiest, albeit possibly less useful, way in which to use Ledger within an org file is to use a single source block to record all Ledger @@ -4363,7 +4364,8 @@ financial state. Eventually, babel will support passing arguments to currently. Instead, we can use the concepts of literary programming, as implemented by the noweb features of babel, to help us. -@subsubheading Multiple Ledger source blocks with @command{noweb} +@node Multiple Ledger source blocks with @command{noweb}, , Embedded Ledger example with single source block, Org mode with Babel +@subsubsection Multiple Ledger source blocks with @command{noweb} The @command{noweb} feature of babel allows us to expand references to other code blocks within a code block. For Ledger, this can be used to @@ -4373,7 +4375,8 @@ of transactions together to generate reports. Using the same transactions used above, we could consider splitting these into expenses and income, as follows: -@subsubheading Income Entries +@node Income Entries, , Multiple Ledger source blocks with @command{noweb}, Org mode with Babel +@subsubsection Income Entries The first set of entries relates to income, either monthly pay or interest, all typically going into one of my bank accounts. Here, I have @@ -4402,7 +4405,8 @@ have the :noweb yes babel header argument specified. #+end_src @end smallexample -@subsubheading Expenses +@node Expenses, , Income Entries, Org mode with Babel +@subsubsection Expenses The following entries relate to personal expenses, such as rent and food. Again, these have all been placed in a single src block but could @@ -4420,7 +4424,8 @@ have been done individually. #+end_src @end smallexample -@subsubheading Financial Summaries +@node Financial Summaries, , Expenses, Org mode with Babel +@subsubsection Financial Summaries Given the ledger entries defined above in the income and expenses code blocks, we can now refer to these using the noweb expansion @@ -4429,7 +4434,8 @@ to generate specific reports for those transactions. Below are two examples, one to generate a balance report and one to generate a register report of all transactions. -@subsubheading An overall balance summary +@node An overall balance summary, , Financial Summaries, Org mode with Babel +@subsubsection An overall balance summary The overall balance of your account and expenditure with a breakdown according to category is specified by passing the :cmdline bal @@ -4474,7 +4480,8 @@ in the report. : £-1300.00 starting balances @end smallexample -@subsubheading Generating a monthly register +@node Generating a monthly register, , An overall balance summary, Org mode with Babel +@subsubsection Generating a monthly register You can also generate a monthly register (the reg command) by executing the following src block. This presents a summary of @@ -4520,7 +4527,8 @@ the running total of the assets in our ledger. : 2010/08/01 - 2010/08/01 assets:bank:chequing £1000.00 £2653.53 @end smallexample -@subsubheading Summary +@node Summary, , Generating a monthly register, Org mode with Babel +@subsubsection Summary This short tutorial shows how Ledger entries can be embedded in a org file and manipulated using Babel. However, only simple Ledger features -- cgit v1.2.3 From 50b968d73a1b8ced41da7a2d66686072935f111b Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 27 Apr 2013 19:29:11 +0200 Subject: Changes @multitable to @ftable so that they are automatically indexed. Added @findex for command so that they are indexed. --- doc/ledger3.texi | 518 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 332 insertions(+), 186 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index c112ba86..52fac242 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -325,7 +325,7 @@ variations between shells to give concrete examples for each. @node Balance Report, Register Report, Run Some Reports, Run Some Reports @subsection Balance Report @cindex balance report -@findex balance (bal) +@findex balance To find the balances of all of your accounts, run this command: @@ -381,7 +381,7 @@ $ ledger -f drewr3.dat balance Assets Liabilities @node Register Report, Cleared Report, Balance Report, Run Some Reports @subsection Register Report @cindex register report -@findex register (reg) +@findex register To show all transactions and a running total: @@ -3464,7 +3464,6 @@ something like Income: Client name @end smallexample -@noindent Then, when you receive the payment, you change it to @smallexample @@ -3525,11 +3524,11 @@ really knows that it debited $225 this month. @node Periodic Transactions, Concrete Example of Automated Transactions, Effective Dates, Automated Transactions @subsection Periodic Transactions -A periodic transaction starts with a ~ followed by a period expression. -Periodic transactions are used for budgeting and forecasting only, they -have no effect without the @code{--budget} option specified. - -See @ref{Budgeting and Forecasting} for examples and details. +A periodic transaction starts with a ~ followed by a period +expression. Periodic transactions are used for budgeting and +forecasting only, they have no effect without the @code{--budget} +option specified. @xref{Budgeting and Forecasting} for examples and +details. @node Concrete Example of Automated Transactions, , Periodic Transactions, Automated Transactions @subsection Concrete Example of Automated Transactions @@ -3921,9 +3920,8 @@ asking for the current balances of the account in the ``Allocation'' tree, using a special formatter. @cindex depth_spacer -@findex depth_spacer -@findex display_total -@findex parent.total +@cindex display_total +@cindex parent.total The magic is in the formatter. The second line simply tells Ledger to print the partial account name indented by its depth in the tree. The third line is where we calculate and display the percentages. The @@ -4006,7 +4004,8 @@ part of the balance. @end menu @node The balance Command, The equity Command, Primary Financial Reports, Primary Financial Reports -@subsection The @code{balance} Command +@subsection The @code{balance} command +@findex balance The @command{balance} command reports the current balance of all accounts. It accepts a list of optional regexps, which confine the @@ -4015,14 +4014,16 @@ multiple types of commodities, each commodity's total is reported separately. @node The equity Command, The register Command, The balance Command, Primary Financial Reports -@subsection The @code{equity} Command +@subsection The @code{equity} command +@findex equity The @command{equity} command prints out accounts balances as if they were transactions. This makes it easy to establish the starting balances for an account, such as when @ref{Archiving Previous Years}. @node The register Command, The print Command, The equity Command, Primary Financial Reports -@subsection The @code{register} Command +@subsection The @code{register} command +@findex register The @command{register} command displays all the postings occurring in a single account, line by line. The account regexp must be @@ -4043,7 +4044,8 @@ add either @code{-j} or @code{-J} to your register command, in order to plot either the amount or total column, respectively. @node The print Command, , The register Command, Primary Financial Reports -@subsection The @code{print} Command +@subsection The @code{print} command +@findex print The @command{print} command prints out ledger transactions in a textual format that can be parsed by Ledger. They will be properly formatted, @@ -4077,6 +4079,7 @@ file whose formatting has gotten out of hand. @node The csv command, The convert command, Comma Separated Values files, Comma Separated Values files @subsubsection The @code{csv} command +@findex csv The @command{csv} command will output print out the desired ledger transactions in a csv format suitable for import into other programs. @@ -4088,6 +4091,7 @@ limiting and searching functions. @cindex csv conversion @cindex reading csv @cindex comma separated variable file reading +@findex convert The @code{convert} command parses a comma separated value (csv) file and outputs Ledger transactions. Many banks offer csv file downloads. @@ -4186,6 +4190,7 @@ used. @node The lisp command, Emacs Org mode, Comma Separated Values files, Reports in other Formats @subsection The @code{lisp} command +@findex lisp The @command{lisp} command outputs results in a form that can be read directly by Emacs Lisp. The format of the @code{sexp} is: @@ -4536,7 +4541,8 @@ have been illustrated; please refer to the Ledger documentation for examples of more complex operations with a ledger. @node The pricemap Command, The xml Command, Org mode with Babel, Reports in other Formats -@subsection The @code{pricemap} Command +@subsection The @code{pricemap} command +@findex pricemap If you have the @code{graphviz} graph visualization package installed, ledger can generate a graph of the relationship between your various @@ -4547,7 +4553,8 @@ commodities valued in terms of each other. For example, multiple currencies and multiples investments valued in those currencies. @node The xml Command, prices and pricedb, The pricemap Command, Reports in other Formats -@subsection The @code{xml} Command +@subsection The @code{xml} command +@findex xml By default, Ledger uses a human-readable data format, and displays its reports in a manner meant to be read on screen. For the purpose of @@ -4697,7 +4704,9 @@ output such data if the @command{xml} command is used, and can read the same data. @node prices and pricedb, , The xml Command, Reports in other Formats -@subsection @code{prices} and @code{pricedb} +@subsection @code{prices} and @code{pricedb} commands +@findex prices +@findex pricedb The @command{prices} command displays the price history for matching commodities. The @code{-A} flag is useful with this report, to @@ -4722,6 +4731,7 @@ pricedb database files. @node accounts, payees, Reports about your Journals, Reports about your Journals @subsection @code{accounts} +@findex accounts The @command{accounts} reports all of the accounts in the journal. Following the command with a regular expression will limit the output @@ -4731,6 +4741,7 @@ account. @node payees, commodities, accounts, Reports about your Journals @subsection @code{payees} +@findex payees The @command{payees} reports all of the unique payees in the journal. To filter the payees displayed you must use the prefix: @@ -4745,6 +4756,7 @@ macbook-2:$ @node commodities, tags, payees, Reports about your Journals @subsection @command{commodities} +@findex commodities Report all commodities present in the journals under consideration. The output is sorted by name. Using the @code{--count} option will @@ -4752,6 +4764,7 @@ tell you how many entries use each commodity. @node tags, entry and xact, commodities, Reports about your Journals @subsection @command{tags} +@findex tags The @command{tags} reports all of the tags in the journal. The output is sorted by name. Using the @code{--count} option will tell you how @@ -4760,6 +4773,9 @@ report the values used by each tag. @node entry and xact, , tags, Reports about your Journals @subsection @command{draft}, @command{entry} and @command{xact} +@findex draft +@findex entry +@findex xact The @code{draft}, @code{entry} and @command{xact} commands simplify the creation of new transactions. It works on the principle that 80% @@ -4883,134 +4899,260 @@ commands. @node Reporting Commands Quick Reference, Basic Options Quick Reference, Command Line Quick Reference, Command Line Quick Reference @subsection Reporting Commands -@multitable @columnfractions .2 .8 -@headitem Report @tab Description -@item @code{balance} @tab Show account balances -@item @code{register} @tab Show all transactions with running total -@item @code{csv} @tab Show transactions in csv format, for exporting to other programs -@item @code{print} @tab Print transaction in a ledger readable format -@item @code{xml} @tab Produce XML output of the register command -@item @code{emacs} @tab Produce Emacs lisp output -@item @code{equity} @tab Print account balances as transactions -@item @code{prices} @tab Print price history for matching commodities -@item @code{pricedb} @tab Print price history for matching commodities in ledger readable format -@item @code{xact} @tab Generate transactions based on previous postings -@end multitable +@ftable @code +@item balance +Show account balances +@item register +Show all transactions with running total +@item csv +Show transactions in csv format, for exporting to other programs +@item print +Print transaction in a ledger readable format +@item xml +Produce XML output of the register command +@item emacs +Produce Emacs lisp output +@item equity +Print account balances as transactions +@item prices +Print price history for matching commodities +@item pricedb +Print price history for matching commodities in ledger readable format +@item xact +Generate transactions based on previous postings +@end ftable @node Basic Options Quick Reference, Report Filtering Quick Reference, Reporting Commands Quick Reference, Command Line Quick Reference @subsection Basic Options -@multitable @columnfractions .1 .25 .65 -@headitem Short @tab Long @tab Description -@item @code{-h} @tab @code{--help} @tab Print summary of all options -@item @code{-v} @tab @code{--version} @tab Print version of ledger executable -@item @code{-f FILE} @tab @code{--file FILE} @tab Read @file{FILE} as a ledger file -@item @code{-o FILE} @tab @code{--output FILE} @tab Redirect output to @file{FILE} -@item @code{-i FILE} @tab @code{--init-file FILE} @tab Specify options file -@item @code{-a NAME} @tab @code{--account NAME} @tab Specify default account name for QIF file postings -@end multitable +@ftable @code +@item --help +@itemx -h +Print summary of all options + +@item --version +@itemx -v +Print version of ledger executable + +@item --file FILE +@itemx -f FILE +Read @file{FILE} as a ledger file + +@item --output FILE +@itemx -o FILE +Redirect output to @file{FILE} + +@item --init-file FILE +@itemx -i FILE +Specify options file + +@item --account NAME +@itemx -a NAME +Specify default account name for QIF file postings +@end ftable @node Report Filtering Quick Reference, Error Checking and Calculation Options, Basic Options Quick Reference, Command Line Quick Reference @subsection Report Filtering -@multitable @columnfractions .1 .25 .65 -@headitem Short @tab Long @tab Description -@item @code{-c} @tab @code{--current} @tab Display transaction on or before the current date -@item @code{-b DATE} @tab @code{--begin DATE} @tab Begin reports on or after @code{DATE} -@item @code{-e DATE} @tab @code{--end DATE} @tab Limit end date of transactions for report -@item @code{-p STR} @tab @code{--period} @tab Set report period to STR -@item @code{ } @tab @code{--period-sort} @tab Sort postings within each period -@item @code{-C} @tab @code{--cleared} @tab Display only cleared postings -@item @code{} @tab @code{--dc} @tab Display register or balance in debit/credit format -@item @code{-U} @tab @code{--uncleared} @tab Display only uncleared postings -@item @code{-R} @tab @code{--real} @tab Display only real postings -@item @code{-L} @tab @code{--actual} @tab Display only actual postings, not automated -@item @code{-r} @tab @code{--related} @tab Display related postings -@item @code{} @tab @code{--budget} @tab Display how close your postings meet your budget -@item @code{} @tab @code{--add-budget} @tab Show un-budgeted postings -@item @code{} @tab @code{--unbudgeted} @tab Show only un-budgeted postings -@item @code{} @tab @code{--forecast} @tab Project balances into the future -@item @code{-l EXPR} @tab @code{--limit EXPR} @tab Limit postings in calculations -@item @code{-t EXPR} @tab @code{--amount} @tab Change value expression reported in register report -@item @code{-T EXPR} @tab @code{--total} @tab Change the value expression used for ``totals'' column in register and balance reports -@end multitable +@ftable @code +@item --current +@itemx -c +Display transaction on or before the current date +@item --begin DATE +@itemx -b DATE +Begin reports on or after @code{DATE} +@item --end DATE +@itemx -e DATE +Limit end date of transactions for report +@item --period +@itemx -p STR +Set report period to STR +@item --period-sort +Sort postings within each period +@item --cleared +@itemx -C +Display only cleared postings +@item --dc +Display register or balance in debit/credit format +@item --uncleared +@itemx -U +Display only uncleared postings +@item --real +@itemx -R +Display only real postings +@item --actual +@itemx -L +Display only actual postings, not automated +@item --related +@itemx -r +Display related postings +@item --budget +Display how close your postings meet your budget +@item --add-budget +Show un-budgeted postings +@item --unbudgeted +Show only un-budgeted postings +@item --forecast +Project balances into the future +@item --limit EXPR +@itemx -l EXPR +Limit postings in calculations +@item --amount +@itemx -t EXPR +Change value expression reported in register report +@item --total +@itemx -T EXPR +Change the value expression used for ``totals'' column in register and +balance reports +@end ftable @node Error Checking and Calculation Options, Output Customization Quick Reference, Report Filtering Quick Reference, Command Line Quick Reference @subsection Error Checking and Calculation Options -@multitable @columnfractions .1 .25 .65 -@headitem Short @tab Long @tab Description -@item @code{} @tab @code{--strict} @tab Accounts, tags or commodities not previously declared will cause warnings -@item @code{} @tab @code{--pedantic} @tab Accounts, tags or commodities not previously declared will cause errors -@item @code{} @tab @code{--check-payees} @tab Enable strict and pedantic checking for payees as well as accounts, commodities and tags -@item @code{} @tab @code{--immediate} @tab Instruct ledger to evaluate calculations immediately rather than lazily -@end multitable +@ftable @code +@item --strict +Accounts, tags or commodities not previously declared will cause warnings +@item --pedantic +Accounts, tags or commodities not previously declared will cause errors +@item --check-payees +Enable strict and pedantic checking for payees as well as accounts, commodities and tags +@item --immediate +Instruct ledger to evaluate calculations immediately rather than lazily +@end ftable @node Output Customization Quick Reference, Grouping Options, Error Checking and Calculation Options, Command Line Quick Reference @subsection Output Customization -@multitable @columnfractions .15 .4 .45 -@headitem Short @tab Long @tab Description -@item @code{-n} @tab @code{--collapse} @tab Collapse transactions with multiple postings -@item @code{-s} @tab @code{--subtotal} @tab Report register as a single subtotal -@item @code{-P} @tab @code{--by-payee} @tab Report subtotals by payee -@item @code{-E} @tab @code{--empty} @tab Include empty accounts in report -@item @code{-W} @tab @code{--weekly} @tab Report posting totals by week -@item @code{-Y} @tab @code{--yearly} @tab Report posting totals by year -@item @code{} @tab @code{--dow} @tab Report Posting totals by day of week -@item @code{-S EXPR} @tab @code{--sort EXPR} @tab Sort a report using @code{EXPR} -@item @code{-w} @tab @code{--wide} @tab Assume 132 columns instead of 80 -@item @code{} @tab @code{--head N} @tab Report the first N postings -@item @code{} @tab @code{--tail N} @tab Report the last N postings -@item @code{} @tab @code{--pager PATH} @tab Direct output to @code{PATH} pager program -@item @code{-A} @tab @code{--average} @tab Report average posting value -@item @code{-D} @tab @code{--deviation} @tab Report each posting deviation from the average -@item @code{-%} @tab @code{--percent} @tab Show subtotals in the balance report as percentages -@c @item @code{} @tab @code{--totals} @tab Include running total in the @code{xml} report -@item @code{} @tab @code{--pivot TAG} @tab Produce a pivot table of the tag type specified -@item @code{-j} @tab @code{--amount-data} @tab Show only date and value column to format the output for plots -@item @tab @code{--plot-amount-format STR} @tab Specify the format for the plot output -@item @code{-J} @tab @code{--total-data} @tab Show only dates and totals to format the output for plots -@item @tab @code{--plot-total-format STR} @tab Specify the format for the plot output -@item @code{-d EXPR} @tab @code{--display EXPR} @tab Display only posting that meet the criterias in the EXPR -@item @code{-y STR} @tab @code{--date-format STR} @tab Change the basic date format used in reports -@item @code{-F STR} @tab @code{--format STR} @tab Set reporting format -@item @code{} @tab @code{--balance-format STR} @tab -@item @code{} @tab @code{--register-format STR} @tab -@item @code{} @tab @code{--prices-format STR} @tab -@item @code{-w register} @tab @code{--wide-register-format STR} @tab -@item @code{} @tab @code{--anon} @tab Print the ledger register with anonymized accounts and payees, useful for filing bug reports -@end multitable +@ftable @code +@item --collapse +@itemx -n +Collapse transactions with multiple postings +@item --subtotal +@itemx -s +Report register as a single subtotal +@item --by-payee +@itemx -P +Report subtotals by payee +@item --empty +@itemx -E +Include empty accounts in report +@item --weekly +@itemx -W +Report posting totals by week +@item --yearly +@itemx -Y +Report posting totals by year +@item --dow +Report Posting totals by day of week +@item --sort EXPR +@itemx -S EXPR +Sort a report using @code{EXPR} +@item --wide +@itemx -w +Assume 132 columns instead of 80 +@item --head N +Report the first N postings +@item --tail N +Report the last N postings +@item --pager PATH +Direct output to @code{PATH} pager program +@item --average +@itemx -A +Report average posting value +@item --deviation +@itemx -D +Report each posting deviation from the average +@item --percent +@itemx -% +Show subtotals in the balance report as percentages +@c @item --totals +@c Include running total in the @code{xml} report +@item --pivot TAG +Produce a pivot table of the tag type specified +@item --amount-data +@itemx -j +Show only date and value column to format the output for plots +@item --plot-amount-format STR +Specify the format for the plot output +@item --total-data +@itemx -J +Show only dates and totals to format the output for plots +@item --plot-total-format STR +Specify the format for the plot output +@item --display EXPR +@itemx -d EXPR +Display only posting that meet the criterias in the EXPR +@item --date-format STR +@itemx -y STR +Change the basic date format used in reports +@item --format STR +@itemx --balance-format STR +@itemx --register-format STR +@itemx --prices-format STR +@itemx -F STR +Set reporting format +@item --wide-register-format STR +@itemx -w +Wide +@item --anon +Print the ledger register with anonymized accounts and payees, useful for filing bug reports +@end ftable @node Grouping Options, Commodity Reporting Quick Reference, Output Customization Quick Reference, Command Line Quick Reference @subsection Grouping Options -@multitable @columnfractions .1 .25 .65 -@headitem Short @tab Long @tab Description -@item @code{-P} @tab @code{--by-payee} @tab Group postings by common payee names -@item @code{-D} @tab @code{--daily} @tab Group postings by day -@item @code{-W} @tab @code{--weekly} @tab Group postings by week -@item @code{-M} @tab @code{--monthly} @tab Group postings by month -@item @code{} @tab @code{--quarterly} @tab Group postings by quarter -@item @code{-Y} @tab @code{--yearly} @tab Group postings by year -@item @code{} @tab @code{--dow} @tab Group by day of weeks -@item @code{-s} @tab @code{--subtotal} @tab Group posting together, similar to balance report -@end multitable +@ftable @code +@item --by-payee +@itemx -P +Group postings by common payee names +@item --daily +@itemx -D +Group postings by day +@item --weekly +@itemx -W +Group postings by week +@item --monthly +@itemx -M +Group postings by month +@item --quarterly +Group postings by quarter +@item --yearly +@itemx -Y +Group postings by year +@item --dow +Group by day of weeks +@item --subtotal +@itemx -s +Group posting together, similar to balance report +@end ftable @node Commodity Reporting Quick Reference, , Grouping Options, Command Line Quick Reference @subsection Commodity Reporting -@multitable @columnfractions .1 .25 .65 -@headitem Short @tab Long @tab Description -@item @code{} @tab @code{--price-db FILE} @tab Use @file{FILE} for retrieving stored commodity prices -@item @code{-L MINS} @tab @code{--price-exp MINS} @tab Set expected freshness of prices in minutes -@item @code{-Q} @tab @code{--download} @tab Download quotes using @code{getquote} -@item @code{} @tab @code{--getquote} @tab Sets path to a user defined script to download commodity prices. -@item @code{-O} @tab @code{--quantity} @tab Report commodity totals without conversion -@item @code{-B} @tab @code{--basis} @tab Report cost basis -@item @code{-V} @tab @code{--market} @tab Report last known market value -@item @code{-G} @tab @code{--gain} @tab Report net gain loss for commodities that have a price history -@end multitable +@ftable @code +@item --price-db FILE +Use @file{FILE} for retrieving stored commodity prices +@item --price-exp MINS +@itemx -L MINS +Set expected freshness of prices in minutes +@item --download +@itemx -Q +Download quotes using @code{getquote} +@item --getquote +Sets path to a user defined script to download commodity prices. +@item --quantity +@itemx -O +Report commodity totals without conversion +@item --basis +@itemx -B +Report cost basis +@item --market +@itemx -V +Report last known market value +@item --gain +@itemx -G +Report net gain loss for commodities that have a price history +@end ftable @node Detailed Options Description, Period Expressions, Command Line Quick Reference, Command-line Syntax @section Detailed Option Description @@ -5103,7 +5245,7 @@ GUIs, which would make use of the different scopes by keeping an instance of Ledger running in the background and running multiple sessions with multiple reports per session. -@table @code +@ftable @code @item --decimal-comma Direct Ledger to parse journals using the European standard comma as decimal separator, vice a period. @@ -5177,7 +5319,7 @@ Ledger interprets all cleared transactions as correct, and if it finds a new account or commodity (same as a misspelled commodity or account) it will issue a warning giving you the file and line number of the problem. -@end table +@end ftable @node Report Options, Basic options, Session Options, Detailed Options Description @subsection Report Options @@ -5189,7 +5331,7 @@ GUIs, which would make use of the different scopes by keeping an instance of Ledger running in the background and running multiple sessions with multiple reports per session. -@table @code +@ftable @code @item --abbrev-len Set the minimum length an account can be abbreviated to if it doesn't fit inside the @@ -5782,7 +5924,7 @@ Let the register report use 132 columns. Identical to @code{--columns @item --yearly Synonym for @code{--period "yearly"} -@end table +@end ftable @node Basic options, Report Filtering, Report Options, Detailed Options Description @subsection Basic options @@ -5791,32 +5933,32 @@ These are the most basic command options. Most likely, the user will want to set them using environment variables (see @ref{Environment Variables}), instead of using actual command-line options: -@table @code +@ftable @code @item --help -@item -h +@itemx -h Print a summary of all the options, and what they are used for. This can be a handy way to remember which options do what. This help screen is also printed if ledger is run without a command. @item --version -@item -v +@itemx -v Print the current version of ledger and exits. This is useful for sending bug reports, to let the author know which version of ledger you are using. @item --file FILE -@item -f FILE +@itemx -f FILE Read FILE as a ledger file. This command may be used multiple times. Typically, the environment variable @env{LEDGER_FILE} is set, rather than using this command-line option. @item --output FILE -@item -o FILE +@itemx -o FILE Redirect output from any command to @var{FILE}. By default, all output goes to standard output. @item --init-file FILE -@item -i FILE +@itemx -i FILE Causes @code{FILE} to be read by ledger before any other ledger file. This file may not contain any postings, but it may contain option settings. To specify options in the init file, use the same syntax as @@ -5833,10 +5975,10 @@ Option settings on the command-line or in the environment always take precedence over settings in the init file. @item --account NAME -@item -a NAME +@itemx -a NAME Specify the default account which QIF file postings are assumed to relate to. -@end table +@end ftable @node Report Filtering, Output Customization, Basic options, Detailed Options Description @subsection Report filtering @@ -5844,13 +5986,13 @@ relate to. These options change which postings affect the outcome of a report, in ways other than just using regular expressions: -@table @code +@ftable @code @item --current -@item -c +@itemx -c Display only transactions occurring on or before the current date. @item --begin DATE -@item -b DATE +@itemx -b DATE Constrain the report to transactions on or after @var{DATE}. Only transactions after that date will be calculated, which means that the running total in the balance report will always start at zero with the @@ -5858,12 +6000,12 @@ first matching transaction. (Note: This is different from using @code{--display} to constrain what is displayed). @item --end DATE -@item -e DATE +@itemx -e DATE Constrain the report so that transactions on or after @var{DATE} are not considered. The ending date is inclusive. @item --period STR -@item -p STR +@itemx -p STR Set the reporting period to @var{STR}. This will subtotal all matching transactions within each period separately, making it easy to see weekly, monthly, quarterly, etc., posting totals. A period string can @@ -5882,28 +6024,28 @@ ledger -M --period-sort -At reg ^Expenses @end smallexample @item --cleared -@item -C +@itemx -C Display only postings whose transaction has been marked ``cleared'' (by placing an asterisk to the right of the date). @item --uncleared -@item -U +@itemx -U Display only postings whose transaction has not been marked ``cleared'' (i.e., if there is no asterisk to the right of the date). @item --real -@item -R +@itemx -R Display only real postings, not virtual. (A virtual posting is indicated by surrounding the account name with parentheses or brackets; see @ref{Virtual postings} for more information). @item --actual -@item -L +@itemx -L Display only actual postings, and not those created due to automated postings. @item --related -@item -r +@itemx -r Display postings that are related to whichever postings would otherwise have matched the filtering criteria. In the register report, this shows where money went to, or the account it came from. @@ -5940,21 +6082,21 @@ option that projects your budget into the future, showing how it will affect future balances. @xref{Budgeting and Forecasting}. @item --limit EXPR -@item -l EXPR +@itemx -l EXPR Limit which postings take part in the calculations of a report. @item --amount EXPR -@item -t EXPR +@itemx -t EXPR Change the value expression used to calculate the ``value'' column in the @command{register} report, the amount used to calculate account totals in the @command{balance} report, and the values printed in the @command{equity} report. @xref{Value Expressions}. @item --total EXPR -@item -T EXPR +@itemx -T EXPR Set the value expression used for the ``totals'' column in the @command{register} and @command{balance} reports. -@end table +@end ftable @c @node Search Terms, Output Customization, Report Filtering, Detailed Options Description @c @subsection Search Terms @@ -6006,37 +6148,37 @@ Set the value expression used for the ``totals'' column in the These options affect only the output, but not which postings are used to create it: -@table @code +@ftable @code @item --collapse -@item -n +@itemx -n Cause transactions in a @command{register} report with multiple postings to be collapsed into a single, subtotaled transaction. @item --subtotal -@item -s +@itemx -s Cause all transactions in a @command{register} report to be collapsed into a single, subtotaled transaction. @item --by-payee -@item -P +@itemx -P Report subtotals by payee. @item --empty -@item -E +@itemx -E Include even empty accounts in the @command{balance} report. @item --weekly -@item -W +@itemx -W Report posting totals by the week. The week begins on whichever day of the week begins the month containing that posting. To set a specific begin date, use a period string, such as @code{weekly from DATE}. @item --monthly -@item -M +@itemx -M Report posting totals by month; @item --yearly -@item -Y +@itemx -Y Report posting totals by year. For more complex period, using the @item --period @@ -6047,7 +6189,7 @@ Report postings totals for each day of the week. This is an easy way to see if weekend spending is more than on weekdays. @item --sort EXPR -@item -S EXPR +@itemx -S EXPR Sort a report by comparing the values determined using the value expression @var{EXPR}. For example, using @code{-S -UT} in the balance report will sort account balances from greatest to least, using @@ -6059,7 +6201,7 @@ Produce a pivot table around the tag provided. This requires meta data using valued tags. @item --wide -@item -w +@itemx -w Cause the default @command{register} report to assume 132 columns instead of 80. @@ -6078,16 +6220,16 @@ when the output is especially long. This behavior can be made the default by setting the @env{LEDGER_PAGER} environment variable. @item --average -@item -A +@itemx -A Report the average posting value. @item --deviation -@item -D +@itemx -D Report each posting's deviation from the average. It is only meaningful in the @command{register} and @command{prices} reports. @item --percent -@item -% +@itemx -% Show account subtotals in the @command{balance} report as percentages of the parent account. @@ -6095,7 +6237,7 @@ of the parent account. @c @command{xml} report. @item --amount-data -@item -j +@itemx -j Change the @command{register} report so that it outputs nothing but the date and the value column, and the latter without commodities. This is only meaningful if the report uses a single commodity. This data can @@ -6103,12 +6245,12 @@ then be fed to other programs, which could plot the date, analyze it, etc. @item --total-data -@item -J +@itemx -J Change the @command{register} report so that it outputs nothing but the date and totals column, without commodities. @item --display EXPR -@item -d EXPR +@itemx -d EXPR Limit which postings or accounts or actually displayed in a report. They might still be calculated, and be part of the running total of a register report, for example, but they will not be displayed. This is @@ -6132,7 +6274,7 @@ amount for the reporting range (@code{-p}), or simply a display restricted to the reporting range (using @code{-d}). @item --date-format STR -@item -y STR +@itemx -y STR Change the basic date format used by reports. The default uses a date like @code{2004/08/01}, which represents the default date format of @code{%Y/%m/%d}. To change the way dates are printed in general, the @@ -6141,7 +6283,7 @@ initialization file @file{~/.ledgerrc} (or the file referred to by @env{LEDGER_INIT}). @item --format STR -@item -F STR +@itemx -F STR Set the reporting format for whatever report ledger is about to make. @xref{Format Strings}. There are also specific format commands for each report type: @@ -6264,14 +6406,14 @@ Set the format for the @command{prices} report. The default is: @item --wide-register-format STR (-w @command{register}) -@end table +@end ftable @node Commodity Reporting, Environment Variables, Output Customization, Detailed Options Description @subsection Commodity Reporting These options affect how commodity values are displayed: -@table @code +@ftable @code @item --price-db FILE Set the file that is used for recording downloaded commodity prices. It is always read on startup, to determine historical prices. Other @@ -6294,7 +6436,7 @@ The format of the file can be changed by telling ledger to use the @code{--pricedb-format} you define. @item --price-exp MINS -@item -L MINS +@itemx -L MINS Set the expected freshness of price quotes, in minutes. That is, if the last known quote for any commodity is older than this value, and if @code{--download} is being used, then the Internet will be consulted @@ -6302,7 +6444,7 @@ again for a newer price. Otherwise, the old price is still considered to be fresh enough. @item --download -@item -Q +@itemx -Q Cause quotes to be automagically downloaded, as needed, by running a script named @command{getquote} and expecting that script to return a value understood by ledger. A sample implementation of a @@ -6310,7 +6452,7 @@ value understood by ledger. A sample implementation of a distribution. Downloaded quote price are then appended to the price database, usually specified using the environment variable @env{LEDGER_PRICE_DB}. -@end table +@end ftable There are several different ways that ledger can report the totals it displays. The most flexible way to adjust them is by using value @@ -6318,20 +6460,24 @@ expressions, and the @code{-t} and @code{-T} options. However, there are also several ``default'' reports, which will satisfy most users basic reporting needs: -@table @code -@item -O, --quantity +@ftable @code +@item --quantity +@itemx -O Report commodity totals (this is the default) -@item -B, --basis +@item --basis +@itemx -B Report the cost basis for all postings. -@item -V, --market +@item --market +@itemx -V Use the last known value for commodities to calculate final values. -@item -G, --gain +@item --gain +@itemx -G Report the net gain/loss for all commodities in the report that have a price history. -@end table +@end ftable Often you will be more interested in the value of your entire holdings, in your preferred currency. It might be nice to know you hold 10,000 @@ -6937,17 +7083,17 @@ An amount in braces can be any kind of amount supported by ledger, with or without a commodity. Use this for decimal values. @item /REGEXP/ -@item W/REGEXP/ +@itemx W/REGEXP/ A regular expression that matches against an account's full name. If a posting, this will match against the account affected by the posting. @item //REGEXP/ -@item p/REGEXP/ +@itemx p/REGEXP/ A regular expression that matches against a transaction's payee name. @item ///REGEXP/ -@item w/REGEXP/ +@itemx w/REGEXP/ A regular expression that matches against an account's base name. If a posting, this will match against the account affected by the posting. @@ -8193,7 +8339,7 @@ found. These options are primarily for Ledger developers, but may be of some use to a user trying something new. -@table @code +@ftable @code @item --args-only Ignore init files and environment variables for the ledger run. @@ -8258,7 +8404,7 @@ Print detailed information on the execution of Ledger. @item --version Print version information and exit. -@end table +@end ftable @node Pre-commands, , Debug Options, Developer Commands @subsection Pre-Commands @@ -8266,7 +8412,7 @@ Print version information and exit. Pre-commands are useful when you aren't sure how a command or option will work. -@table @code +@ftable @code @item args Evaluate the given arguments against the following model transaction: @@ -8365,7 +8511,7 @@ true @item template Shows the insertion template that a @code{draft} or @code{xact} sub-command generates. This is a debugging command. -@end table +@end ftable @node Ledger Development Environment, , Developer Commands, Ledger for Developers @section Ledger Development Environment @@ -8542,12 +8688,12 @@ ledger register Checking --sort d -d 'd>[2011/04/01]' until 2011/05/25 @end smallexample @node Concept Index, Command Index, Miscellaneous Notes, Top -@unnumbered Concept Index +@unnumbered Concepts Index @printindex cp @node Command Index, , Concept Index, Top -@unnumbered Command Index +@unnumbered Commands & Options Index @printindex fn -- cgit v1.2.3 From 423acc73ee4f959f52184476add78b3e61cd07ee Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 27 Apr 2013 21:30:13 +0200 Subject: Fix of "Overfull \hbox" when generating the PDF file with texi2pdf --- doc/ledger3.texi | 226 +++++++++++++++++++++++++++---------------------------- 1 file changed, 113 insertions(+), 113 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 52fac242..0d01e2f6 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -5197,7 +5197,7 @@ their values and the source of those values, for example: @smallexample 14:15:02 > ledger --options bal --cleared -f ~/ledger/test/input/drewr3.dat -=============================================================================== +=========================================================================== [Global scope options] [Session scope options] @@ -5216,7 +5216,7 @@ their values and the source of those values, for example: --account-width = 21 ?normalize --amount-width = 12 ?normalize --total-width = 12 ?normalize -=============================================================================== +=========================================================================== $ 775.00 Assets:Checking $ -1,000.00 Equity:Opening Balances $ 225.00 Expenses:Food:Groceries @@ -5278,7 +5278,7 @@ Format Codes}). Prepend all account names with the argument. @smallexample -21:51:39 ~/ledger (next)> ledger -f test/input/drewr3.dat bal --master-account HUMBUG +$ ledger -f test/input/drewr3.dat bal --master-account HUMBUG 0 HUMBUG $ -3,804.00 Assets $ 1,396.00 Checking @@ -5387,11 +5387,11 @@ Specify the format to use for the @code{balance} report (@pxref{Format Strings}). The default is: @smallexample - "%(justify(scrub(display_total), 20, -1, true, color))" - " %(!options.flat ? depth_spacer : \"\")" - "%-(ansify_if(partial_account(options.flat), blue if color))\n%/" - "%$1\n%/" - "--------------------\n" +"%(justify(scrub(display_total), 20, -1, true, color))" +" %(!options.flat ? depth_spacer : \"\")" +"%-(ansify_if(partial_account(options.flat), blue if color))\n%/" +"%$1\n%/" +"--------------------\n" @end smallexample @item --base @@ -5421,11 +5421,11 @@ Specify the format to use for the @code{budget} report (@pxref{Format Strings}). The default is: @smallexample - "%(justify(scrub(display_total), 20, -1, true, color))" - " %(!options.flat ? depth_spacer : \"\")" - "%-(ansify_if(partial_account(options.flat), blue if color))\n%/" - "%$1\n%/" - "--------------------\n" +"%(justify(scrub(display_total), 20, -1, true, color))" +" %(!options.flat ? depth_spacer : \"\")" +"%-(ansify_if(partial_account(options.flat), blue if color))\n%/" +"%$1\n%/" +"--------------------\n" @end smallexample @item --budget @@ -5441,15 +5441,15 @@ Specify the format to use for the @code{cleared} report (@pxref{Format Strings}). The default is: @smallexample - "%(justify(scrub(get_at(total_expr, 0)), 16, 16 + prepend_width, " - " true, color)) %(justify(scrub(get_at(total_expr, 1)), 18, " - " 36 + prepend_width, true, color))" - " %(latest_cleared ? format_date(latest_cleared) : \" \")" - " %(!options.flat ? depth_spacer : \"\")" - "%-(ansify_if(partial_account(options.flat), blue if color))\n%/" - "%$1 %$2 %$3\n%/" - "%(prepend_width ? \" \" * prepend_width : \"\")" - "---------------- ---------------- ---------\n" +"%(justify(scrub(get_at(total_expr, 0)), 16, 16 + prepend_width, " +" true, color)) %(justify(scrub(get_at(total_expr, 1)), 18, " +" 36 + prepend_width, true, color))" +" %(latest_cleared ? format_date(latest_cleared) : \" \")" +" %(!options.flat ? depth_spacer : \"\")" +"%-(ansify_if(partial_account(options.flat), blue if color))\n%/" +"%$1 %$2 %$3\n%/" +"%(prepend_width ? \" \" * prepend_width : \"\")" +"---------------- ---------------- ---------\n" @end smallexample @item --cleared @@ -5481,14 +5481,14 @@ Specify the format to use for the @code{csv} report (@pxref{Format Strings}). The default is: @smallexample - "%(quoted(date))," - "%(quoted(code))," - "%(quoted(payee))," - "%(quoted(display_account))," - "%(quoted(commodity))," - "%(quoted(quantity(scrub(display_amount))))," - "%(quoted(cleared ? \"*\" : (pending ? \"!\" : \"\")))," - "%(quoted(join(note | xact.note)))\n" +"%(quoted(date))," +"%(quoted(code))," +"%(quoted(payee))," +"%(quoted(display_account))," +"%(quoted(commodity))," +"%(quoted(quantity(scrub(display_amount))))," +"%(quoted(cleared ? \"*\" : (pending ? \"!\" : \"\")))," +"%(quoted(join(note | xact.note)))\n" @end smallexample @item --current @@ -5518,30 +5518,30 @@ Display register or balance in debit/credit format If you use you will now get extra columns. The register goes from this: @smallexample - 12-Mar-10 Employer Assets:Cash $100 $100 - Income:Employer $-100 0 - 12-Mar-10 KFC Expenses:Food $20 $20 - Assets:Cash $-20 0 - 12-Mar-10 KFC - Rebate Assets:Cash $5 $5 - Expenses:Food $-5 0 - 12-Mar-10 KFC - Food & Reb.. Expenses:Food $20 $20 - Expenses:Food $-5 $15 - Assets:Cash $-15 0 +12-Mar-10 Employer Assets:Cash $100 $100 + Income:Employer $-100 0 +12-Mar-10 KFC Expenses:Food $20 $20 + Assets:Cash $-20 0 +12-Mar-10 KFC - Rebate Assets:Cash $5 $5 + Expenses:Food $-5 0 +12-Mar-10 KFC - Food & Reb.. Expenses:Food $20 $20 + Expenses:Food $-5 $15 + Assets:Cash $-15 0 @end smallexample @noindent To this: @smallexample - 12-Mar-10 Employer Assets:Cash $100 0 $100 - In:Employer 0 $100 0 - 12-Mar-10 KFC Expens:Food $20 0 $20 - Assets:Cash 0 $20 0 - 12-Mar-10 KFC - Rebate Assets:Cash $5 0 $5 - Expens:Food 0 $5 0 - 12-Mar-10 KFC - Food &.. Expens:Food $20 0 $20 - Expens:Food 0 $5 $15 - Assets:Cash 0 $15 0 +12-Mar-10 Employer Assets:Cash $100 0 $100 + In:Employer 0 $100 0 +12-Mar-10 KFC Expens:Food $20 0 $20 + Assets:Cash 0 $20 0 +12-Mar-10 KFC - Rebate Assets:Cash $5 0 $5 + Expens:Food 0 $5 0 +12-Mar-10 KFC - Food &.. Expens:Food $20 0 $20 + Expens:Food 0 $5 $15 + Assets:Cash 0 $15 0 @end smallexample @noindent @@ -5552,22 +5552,22 @@ values. For the balance report without @code{--dc}: @smallexample - $70 Assets:Cash - $30 Expenses:Food - $-100 Income:Employer - -------------------- - 0 + $70 Assets:Cash + $30 Expenses:Food + $-100 Income:Employer +-------------------- + 0 @end smallexample @noindent And with @code{--dc} it becomes this: @smallexample - $105 $35 $70 Assets:Cash - $40 $10 $30 Expenses:Food - 0 $100 $-100 Income:Employer - -------------------------------------------- - $145 $145 0 + $105 $35 $70 Assets:Cash + $40 $10 $30 Expenses:Food + 0 $100 $-100 Income:Employer +-------------------------------------------- + $145 $145 0 @end smallexample @item --depth @@ -5686,8 +5686,8 @@ wrong value you can use metadata to put in the expected amount: @smallexample 2012-03-12 Paycheck - Income $-990; Expected:: $-1000.00 - Checking + Income $-990; Expected:: $-1000.00 + Checking @end smallexample Then using the command @code{ledger reg --inject=Expected Income} would @@ -5791,7 +5791,7 @@ identifying which car the purchase was for @code{; Car: Prius}, then the command: @smallexample -ledger bal Fuel --pivot "Car" --period "this year" +$ ledger bal Fuel --pivot "Car" --period "this year" $ 3491.26 Car $ 1084.22 M3:Expenses:Auto:Fuel $ 149.65 MG V11:Expenses:Auto:Fuel @@ -6070,8 +6070,8 @@ The following would be output, showing the postings related to the posting that matched: @smallexample -2004/03/20 Safeway Expenses:Cash $-20.00 $-20.00 - Assets:Checking $85.00 $65.00 +2004/03/20 Safeway Expenses:Cash $-20.00 $-20.00 + Assets:Checking $85.00 $65.00 @end smallexample @item --budget @@ -6293,32 +6293,32 @@ Define the output format for the @code{balance} report. The default (defined in @code{report.h} is: @smallexample - "%(ansify_if( - justify(scrub(display_total), 20, - 20 + int(prepend_width), true, color), - bold if should_bold)) - %(!options.flat ? depth_spacer : \"\") - %-(ansify_if( - ansify_if(partial_account(options.flat), blue if color), - bold if should_bold))\n%/ - %$1\n%/ - %(prepend_width ? \" \" * int(prepend_width) : \"\") - --------------------\n" +"%(ansify_if( + justify(scrub(display_total), 20, + 20 + int(prepend_width), true, color), + bold if should_bold)) + %(!options.flat ? depth_spacer : \"\") + %-(ansify_if( + ansify_if(partial_account(options.flat), blue if color), + bold if should_bold))\n%/ + %$1\n%/ + %(prepend_width ? \" \" * int(prepend_width) : \"\") + --------------------\n" @end smallexample @item --cleared-format Define the format for the cleared report. The default is: @smallexample - "%(justify(scrub(get_at(display_total, 0)), 16, 16 + int(prepend_width), - true, color)) %(justify(scrub(get_at(display_total, 1)), 18, - 36 + int(prepend_width), true, color)) - %(latest_cleared ? format_date(latest_cleared) : \" \") - %(!options.flat ? depth_spacer : \"\") - %-(ansify_if(partial_account(options.flat), blue if color))\n%/ - %$1 %$2 %$3\n%/ - %(prepend_width ? \" \" * int(prepend_width) : \"\") - ---------------- ---------------- ---------\n" +"%(justify(scrub(get_at(display_total, 0)), 16, 16 + int(prepend_width), + true, color)) %(justify(scrub(get_at(display_total, 1)), 18, + 36 + int(prepend_width), true, color)) + %(latest_cleared ? format_date(latest_cleared) : \" \") + %(!options.flat ? depth_spacer : \"\") + %-(ansify_if(partial_account(options.flat), blue if color))\n%/ + %$1 %$2 %$3\n%/ + %(prepend_width ? \" \" * int(prepend_width) : \"\") + ---------------- ---------------- ---------\n" @end smallexample @item --register-format STR @@ -6326,37 +6326,37 @@ Define the output format for the @code{register} report. The default (defined in @code{report.h} is: @smallexample - "%(ansify_if( - ansify_if(justify(format_date(date), int(date_width)), - green if color and date > today), - bold if should_bold)) - %(ansify_if( - ansify_if(justify(truncated(payee, int(payee_width)), int(payee_width)), - bold if color and !cleared and actual), - bold if should_bold)) - %(ansify_if( - ansify_if(justify(truncated(display_account, int(account_width), - int(abbrev_len)), int(account_width)), - blue if color), - bold if should_bold)) - %(ansify_if( - justify(scrub(display_amount), int(amount_width), - 3 + int(meta_width) + int(date_width) + int(payee_width) - + int(account_width) + int(amount_width) + int(prepend_width), - true, color), +"%(ansify_if( + ansify_if(justify(format_date(date), int(date_width)), + green if color and date > today), bold if should_bold)) - %(ansify_if( - justify(scrub(display_total), int(total_width), - 4 + int(meta_width) + int(date_width) + int(payee_width) - + int(account_width) + int(amount_width) + int(total_width) - + int(prepend_width), true, color), - bold if should_bold))\n%/ - %(justify(\" \", int(date_width))) - %(ansify_if( - justify(truncated(has_tag(\"Payee\") ? payee : \" \", - int(payee_width)), int(payee_width)), - bold if should_bold)) - %$3 %$4 %$5\n" + %(ansify_if( + ansify_if(justify(truncated(payee, int(payee_width)), int(payee_width)), + bold if color and !cleared and actual), + bold if should_bold)) + %(ansify_if( + ansify_if(justify(truncated(display_account, int(account_width), + int(abbrev_len)), int(account_width)), + blue if color), + bold if should_bold)) + %(ansify_if( + justify(scrub(display_amount), int(amount_width), + 3 + int(meta_width) + int(date_width) + int(payee_width) + + int(account_width) + int(amount_width) + int(prepend_width), + true, color), + bold if should_bold)) + %(ansify_if( + justify(scrub(display_total), int(total_width), + 4 + int(meta_width) + int(date_width) + int(payee_width) + + int(account_width) + int(amount_width) + int(total_width) + + int(prepend_width), true, color), + bold if should_bold))\n%/ + %(justify(\" \", int(date_width))) + %(ansify_if( + justify(truncated(has_tag(\"Payee\") ? payee : \" \", + int(payee_width)), int(payee_width)), + bold if should_bold)) + %$3 %$4 %$5\n" @end smallexample @item --csv-format -- cgit v1.2.3 From 20865d1bde2292c41f1525fc212f4172ff9a1223 Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 27 Apr 2013 21:59:41 +0200 Subject: Fix consistency of alignment of @smallexample --- doc/ledger3.texi | 997 +++++++++++++++++++++++++++---------------------------- 1 file changed, 498 insertions(+), 499 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 0d01e2f6..15fb988d 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -202,11 +202,11 @@ at Whole Foods Markets you might assign the transactions like this @smallexample 2011/03/15 Trader Joe's - Expenses:Groceries $100.00 - Assets:Checking + Expenses:Groceries $100.00 + Assets:Checking 2011/03/15 Whole Food Market - Expenses:Groceries $75.00 - Assets:Checking + Expenses:Groceries $75.00 + Assets:Checking @end smallexample In both cases the money goes to the ``Groceries'' account, even though @@ -230,8 +230,8 @@ above, formatted as the Ledger program wishes to see them: @smallexample 2004/09/29 Pacific Bell - Expenses:Pacific Bell $23.00 - Assets:Checking + Expenses:Pacific Bell $23.00 + Assets:Checking @end smallexample The account balances and registers in this file, if saved as @@ -260,7 +260,7 @@ To build and install once you have these libraries on your system, enter these commands: @smallexample -./configure && make install +$ ./configure && make install @end smallexample @node Getting Help, , Building the Program, Introduction to Ledger @@ -330,7 +330,7 @@ variations between shells to give concrete examples for each. To find the balances of all of your accounts, run this command: @smallexample -ledger -f drewr3.dat balance +$ ledger -f drewr3.dat balance @end smallexample Ledger will generate: @@ -386,7 +386,7 @@ $ ledger -f drewr3.dat balance Assets Liabilities To show all transactions and a running total: @smallexample -ledger -f drewr3.dat register +$ ledger -f drewr3.dat register @end smallexample @noindent @@ -1219,14 +1219,14 @@ postings related to a specific fund. So, to see the current monetary balances of all funds, the command would be: @smallexample -ledger --code-as-payee -P reg ^Assets +$ ledger --code-as-payee -P reg ^Assets @end smallexample Or to see a particular funds expenses, the @code{School} fund in this case: @smallexample -ledger --code-as-payee -P reg ^Expenses @@School +$ ledger --code-as-payee -P reg ^Expenses @@School @end smallexample Both approaches yield different kinds of flexibility, depending on how @@ -1340,16 +1340,16 @@ your opening balance entry could look like this: @smallexample 2011/01/01 * Opening Balance - Assets:Joint Checking $800.14 - Assets:Other Checking $63.44 - Assets:Savings $2805.54 - Assets:Investments:401K:Deferred 100.0000 VIFSX @@ $80.5227 - Assets:Investments:401K:Matching 50.0000 VIFSX @@ $83.7015 - Assets:Investments:IRA 250.0000 VTHRX @@ $20.5324 - Liabilities:Mortgage $-175634.88 - Liabilities:Car Loan $-3494.26 - Liabilities:Visa -$1762.44 - Equity:Opening Balances + Assets:Joint Checking $800.14 + Assets:Other Checking $63.44 + Assets:Savings $2805.54 + Assets:Investments:401K:Deferred 100.0000 VIFSX @@ $80.5227 + Assets:Investments:401K:Matching 50.0000 VIFSX @@ $83.7015 + Assets:Investments:IRA 250.0000 VTHRX @@ $20.5324 + Liabilities:Mortgage $-175634.88 + Liabilities:Car Loan $-3494.26 + Liabilities:Visa -$1762.44 + Equity:Opening Balances @end smallexample There is nothing special about the name ``Opening Balances'' as the @@ -1400,7 +1400,6 @@ Block comments can be made by use @code{@!comment} ... @code{@!end comment} @smallexample - ; This is a single line comment, # and this, % and this, @@ -1421,10 +1420,10 @@ There are several forms of comments within a transaction, for example: ; output from 'print' or 'output' 2011/12/11 Something Sweet - ; German Chocolate Cake - ; :Broke Diet: - Expenses:Food $10.00 ; Friends: The gang - Assets:Credit Union:Checking + ; German Chocolate Cake + ; :Broke Diet: + Expenses:Food $10.00 ; Friends: The gang + Assets:Credit Union:Checking @end smallexample @noindent @@ -1513,12 +1512,12 @@ commodity name must be enclosed in double quotes: @smallexample 1999/06/09 ! Achat - Actif:SG PEE STK 49.957 "Arcancia Equilibre 454" - Actif:SG PEE STK $-234.90 + Actif:SG PEE STK 49.957 "Arcancia Equilibre 454" + Actif:SG PEE STK $-234.90 2000/12/08 ! Achat - Actif:SG PEE STK 215.796 "Arcancia Equilibre 455" - Actif:SG PEE STK $-10742.54 + Actif:SG PEE STK 215.796 "Arcancia Equilibre 455" + Actif:SG PEE STK $-10742.54 @end smallexample @node Buying and Selling Stock, Fixing Lot Prices, Naming Commodities, Currency and Commodities @@ -1532,21 +1531,21 @@ unit you made the purchase in ($ for AAPL). Yes, the typical convention is as follows: @smallexample - 2004/05/01 Stock purchase - Assets:Broker 50 AAPL @@ $30.00 - Expenses:Broker:Commissions $19.95 - Assets:Broker $-1,500.00 +2004/05/01 Stock purchase + Assets:Broker 50 AAPL @@ $30.00 + Expenses:Broker:Commissions $19.95 + Assets:Broker $-1,500.00 @end smallexample This assumes you have a brokerage account that is capable of managed both liquid and commodity assets. Now, on the day of the sale: @smallexample - 2005/08/01 Stock sale - Assets:Broker -50 APPL @{$30.00@} @@ $50.00 - Expenses:Broker:Commissions $19.95 - Income:Capital Gains $-1,000.00 - Assets:Broker $2,500.00 +2005/08/01 Stock sale + Assets:Broker -50 APPL @{$30.00@} @@ $50.00 + Expenses:Broker:Commissions $19.95 + Income:Capital Gains $-1,000.00 + Assets:Broker $2,500.00 @end smallexample @noindent @@ -1577,9 +1576,9 @@ reported in terms of today's price. This is supported as follows: @smallexample - 2009/01/01 Shell - Expenses:Gasoline 11 GAL @{=$2.299@} - Assets:Checking +2009/01/01 Shell + Expenses:Gasoline 11 GAL @{=$2.299@} + Assets:Checking @end smallexample This transaction actually introduces a new commodity, ``GAL @{=$2.29@}'', @@ -1591,22 +1590,22 @@ in one of two ways, both equivalent (note the lack of the equal sign from the transaction above): @smallexample - 2009/01/01 Shell - Expenses:Gasoline 11 GAL @{$2.299@} - Assets:Checking +2009/01/01 Shell + Expenses:Gasoline 11 GAL @{$2.299@} + Assets:Checking - 2009/01/01 Shell - Expenses:Gasoline 11 GAL @@ $2.299 - Assets:Checking +2009/01/01 Shell + Expenses:Gasoline 11 GAL @@ $2.299 + Assets:Checking @end smallexample There is no difference in meaning between these two forms. Why do both exist, you ask? To support things like this: @smallexample - 2009/01/01 Shell - Expenses:Gasoline 11 GAL @{=$2.299@} @@ $2.30 - Assets:Checking +2009/01/01 Shell + Expenses:Gasoline 11 GAL @{=$2.299@} @@ $2.30 + Assets:Checking @end smallexample This transaction says that you bought 11 gallons priced at $2.299 per @@ -1783,7 +1782,7 @@ Using the @code{--strict} option will cause Ledger to complain if any accounts are not previously defined: @smallexample -15:27:39 ~/ledger (next) > ledger bal --strict +$ ledger bal --strict Warning: "FinanceData/Master.dat", line 6: Unknown account 'Liabilities:Tithe Owed' Warning: "FinanceData/Master.dat", line 8: Unknown account 'Liabilities:Tithe Owed' Warning: "FinanceData/Master.dat", line 15: Unknown account 'Allocation:Equities:Domestic' @@ -1793,7 +1792,7 @@ If you have a large Ledger register already created use the @code{accounts} command to get started: @smallexample -ledger accounts >> Accounts.dat +$ ledger accounts >> Accounts.dat @end smallexample @noindent @@ -1840,7 +1839,7 @@ payee, or a description of the posting. The format of each following posting is: @smallexample - ACCOUNT AMOUNT [; NOTE] +ACCOUNT AMOUNT [; NOTE] @end smallexample The @code{ACCOUNT} may be surrounded by parentheses if it is a virtual @@ -1905,14 +1904,14 @@ they immediately follow the account directive and if they begin with whitespace: @smallexample - account Expenses:Food - note This account is all about the chicken! - alias food - payee ^(KFC|Popeyes)$ - check commodity == "$" - assert commodity == "$" - eval print("Hello!") - default +account Expenses:Food + note This account is all about the chicken! + alias food + payee ^(KFC|Popeyes)$ + check commodity == "$" + assert commodity == "$" + eval print("Hello!") + default @end smallexample The @code{note} sub-directive associates a textual note with the @@ -1929,9 +1928,9 @@ encountered and an account within its transaction ends in the name "Unknown". Example: @smallexample - 2012-02-27 KFC - Expenses:Unknown $10.00 ; Read now as "Expenses:Food" - Assets:Cash +2012-02-27 KFC + Expenses:Unknown $10.00 ; Read now as "Expenses:Food" + Assets:Cash @end smallexample The @code{check} and @code{assert} directives warn or error @@ -1978,8 +1977,8 @@ alias Dining=Expenses:Entertainment:Dining alias Checking=Assets:Credit Union:Joint Checking Account 2011/11/28 YummyPalace - Dining $10.00 - Checking + Dining $10.00 + Checking @end smallexample @@ -2010,13 +2009,13 @@ balancing the transaction. The following example set the @smallexample bucket Assets:Checking 2011/01/25 Tom's Used Cars - Expenses:Auto $ 5,500.00 + Expenses:Auto $ 5,500.00 2011/01/27 Book Store - Expenses:Books $20.00 + Expenses:Books $20.00 2011/12/01 Sale - Assets:Checking:Business $ 30.00 + Assets:Checking:Business $ 30.00 @end smallexample @@ -2060,7 +2059,7 @@ sub-directives, if they immediately follow the commodity directive and if they begin with whitespace: @smallexample - commodity $ +commodity $ note American Dollars format $1,000.00 nomarket @@ -2088,8 +2087,8 @@ Allows you to define value expression for future use. For example: define var_name=$100 2011/12/01 Test - Expenses (var_name*4) - Assets + Expenses (var_name*4) + Assets @end smallexample The posting will have a cost of $400. @@ -2125,13 +2124,13 @@ endfixed is equivalent to this: @smallexample - 2012-04-10 Lunch in Canada - Assets:Wallet -15.50 CAD @{=$0.90@} - Expenses:Food 15.50 CAD @{=$0.90@} +2012-04-10 Lunch in Canada + Assets:Wallet -15.50 CAD @{=$0.90@} + Expenses:Food 15.50 CAD @{=$0.90@} - 2012-04-11 Second day Dinner in Canada - Assets:Wallet -25.75 CAD @{=$0.90@} - Expenses:Food 25.75 CAD @{=$0.90@} +2012-04-11 Second day Dinner in Canada + Assets:Wallet -25.75 CAD @{=$0.90@} + Expenses:Food 25.75 CAD @{=$0.90@} @end smallexample Note that ending a @code{fixed} is done differently than other @@ -2153,16 +2152,16 @@ immediately follows the payee directive and if it begins with whitespace: @smallexample - payee KFC - alias KENTUCKY FRIED CHICKEN +payee KFC + alias KENTUCKY FRIED CHICKEN @end smallexample The @code{alias} directive provides a regexp which, if it matches a parsed payee, the declared payee name is substituted: @smallexample - 2012-02-27 KENTUCKY FRIED CHICKEN ; will be read as being 'KFC' - ... +2012-02-27 KENTUCKY FRIED CHICKEN ; will be read as being 'KFC' +... @end smallexample Ledger will display the mapped payees in @code{print} and @@ -2176,20 +2175,22 @@ tag to all. Tags can have values and may be nested. @smallexample apply tag hastag apply tag nestedtag: true + 2011/01/25 Tom's Used Cars - Expenses:Auto $ 5,500.00 - ; :nobudget: - Assets:Checking + Expenses:Auto $ 5,500.00 + ; :nobudget: + Assets:Checking 2011/01/27 Book Store - Expenses:Books $20.00 - Liabilities:MasterCard + Expenses:Books $20.00 + Liabilities:MasterCard end apply tag nestedtag 2011/12/01 Sale - Assets:Checking:Business $ 30.00 - Income:Sales + Assets:Checking:Business $ 30.00 + Income:Sales + end apply tag hastag @end smallexample @@ -2198,22 +2199,22 @@ is the equivalent of @smallexample 2011/01/25 Tom's Used Cars - :hastag: - nestedtag: true - Expenses:Auto $ 5,500.00 - ; :nobudget: - Assets:Checking + :hastag: + nestedtag: true + Expenses:Auto $ 5,500.00 + ; :nobudget: + Assets:Checking 2011/01/27 Book Store - :hastag: - nestedtag: true - Expenses:Books $20.00 - Liabilities:MasterCard + :hastag: + nestedtag: true + Expenses:Books $20.00 + Liabilities:MasterCard 2011/12/01 Sale - :hastag: - Assets:Checking:Business $ 30.00 - Income:Sales + :hastag: + Assets:Checking:Business $ 30.00 + Income:Sales @end smallexample Note that anything following ``@code{end tag}'' is ignored. placing @@ -2225,8 +2226,8 @@ Pre-declares tag names. This only has effect if @code{--strict} or @code{--pedantic} is used (see below). @smallexample - tag Receipt - tag CSV +tag Receipt +tag CSV @end smallexample The 'tag' directive supports two optional sub-directives, if they @@ -2234,9 +2235,9 @@ immediately follow the tag directive and if they begin with whitespace: @smallexample - tag Receipt - check value =~ /pattern/ - assert value != "foobar" +tag Receipt + check value =~ /pattern/ + assert value != "foobar" @end smallexample The @code{check} and @code{assert} directives warn or error @@ -2349,15 +2350,15 @@ leaving just 2003 and 2004 in the current file. So, use called @file{ledger-old.dat}: @smallexample -ledger -f ledger.dat -b 2000 -e 2001 print > ledger-old.dat +$ ledger -f ledger.dat -b 2000 -e 2001 print > ledger-old.dat @end smallexample To delete older data from the current ledger file, use @command{print} again, this time specifying year 2002 as the starting date: @smallexample -ledger -f ledger.dat -b 2002 print > x -mv x ledger.dat +$ ledger -f ledger.dat -b 2002 print > x +$ mv x ledger.dat @end smallexample However, now the current file contains @emph{only} postings from 2002 @@ -2367,10 +2368,10 @@ compensate for this, we must append an equity report for the old ledger at the beginning of the new one: @smallexample -ledger -f ledger-old.dat equity > equity.dat -cat equity.dat ledger.dat > x -mv x ledger.dat -rm equity.dat +$ ledger -f ledger-old.dat equity > equity.dat +$ cat equity.dat ledger.dat > x +$ mv x ledger.dat +$ rm equity.dat @end smallexample Now the balances reported from @file{ledger.dat} are identical to what @@ -2422,9 +2423,9 @@ doing it. The most basic form of transaction is: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - Assets:Cash $-20.00 +2012-03-10 KFC + Expenses:Food $20.00 + Assets:Cash $-20.00 @end smallexample This transaction has a date, a payee or description, a target account @@ -2434,10 +2435,10 @@ posting specifies what action is taken related to that account. A transaction can have any number of postings: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - Assets:Cash $-10.00 - Liabilities:Credit $-10.00 +2012-03-10 KFC + Expenses:Food $20.00 + Assets:Cash $-10.00 + Liabilities:Credit $-10.00 @end smallexample @node Eliding amounts, Auxiliary dates, Basic format, Transactions @@ -2448,10 +2449,10 @@ That is, if exactly one posting has no amount specified, Ledger will infer the inverse of the other postings' amounts: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - Assets:Cash $-10.00 - Liabilities:Credit ; same as specifying $-10 +2012-03-10 KFC + Expenses:Food $20.00 + Assets:Cash $-10.00 + Liabilities:Credit ; same as specifying $-10 @end smallexample @noindent @@ -2460,26 +2461,26 @@ empty posting N times and fill in the negated values of the various commodities: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - Expenses:Tips $2.00 - Assets:Cash EUR -10.00 - Assets:Cash GBP -10.00 - Liabilities:Credit +2012-03-10 KFC + Expenses:Food $20.00 + Expenses:Tips $2.00 + Assets:Cash EUR -10.00 + Assets:Cash GBP -10.00 + Liabilities:Credit @end smallexample @noindent This transaction is identical to writing: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - Expenses:Tips $2.00 - Assets:Cash EUR -10.00 - Assets:Cash GBP -10.00 - Liabilities:Credit $-22.00 - Liabilities:Credit EUR 10.00 - Liabilities:Credit GBP 10.00 +2012-03-10 KFC + Expenses:Food $20.00 + Expenses:Tips $2.00 + Assets:Cash EUR -10.00 + Assets:Cash GBP -10.00 + Liabilities:Credit $-22.00 + Liabilities:Credit EUR 10.00 + Liabilities:Credit GBP 10.00 @end smallexample @node Auxiliary dates, Codes, Eliding amounts, Transactions @@ -2489,9 +2490,9 @@ You can associate a second date with a transaction by following the primary date with an equals sign: @smallexample - 2012-03-10=2012-03-08 KFC - Expenses:Food $20.00 - Assets:Cash $-20.00 +2012-03-10=2012-03-08 KFC + Expenses:Food $20.00 + Assets:Cash $-20.00 @end smallexample What this auxiliary date means is entirely up to you. The only use @@ -2508,9 +2509,9 @@ codes like DEP, XFER, etc., as well as check numbers. This is to give you a place to put those codes: @smallexample - 2012-03-10 (#100) KFC - Expenses:Food $20.00 - Assets:Checking +2012-03-10 (#100) KFC + Expenses:Food $20.00 + Assets:Checking @end smallexample @node Transaction state, Transaction notes, Codes, Transactions @@ -2521,18 +2522,18 @@ The default is uncleared. To mark a transaction cleared, put a * before the payee, and after date or code: @smallexample - 2012-03-10 * KFC - Expenses:Food $20.00 - Assets:Cash +2012-03-10 * KFC + Expenses:Food $20.00 + Assets:Cash @end smallexample @noindent To mark it pending, use a !: @smallexample - 2012-03-10 ! KFC - Expenses:Food $20.00 - Assets:Cash +2012-03-10 ! KFC + Expenses:Food $20.00 + Assets:Cash @end smallexample What these mean is entirely up to you. The @code{--cleared} option @@ -2548,18 +2549,18 @@ When you clear a transaction, that's really just shorthand for clearing all of its postings. That is: @smallexample - 2012-03-10 * KFC - Expenses:Food $20.00 - Assets:Cash +2012-03-10 * KFC + Expenses:Food $20.00 + Assets:Cash @end smallexample @noindent Is the same as writing: @smallexample - 2012-03-10 KFC - * Expenses:Food $20.00 - * Assets:Cash +2012-03-10 KFC + * Expenses:Food $20.00 + * Assets:Cash @end smallexample @noindent @@ -2567,9 +2568,9 @@ You can mark individual postings as cleared or pending, in case one ``side'' of the transaction has cleared, but the other hasn't yet: @smallexample - 2012-03-10 KFC - Liabilities:Credit $100.00 - * Assets:Checking +2012-03-10 KFC + Liabilities:Credit $100.00 + * Assets:Checking @end smallexample @node Transaction notes, Metadata, Transaction state, Transactions @@ -2580,9 +2581,9 @@ and a tab, which Ledger calls this a ``hard separator''), you may introduce a note about the transaction using the ; character: @smallexample - 2012-03-10 * KFC ; yum, chicken... - Expenses:Food $20.00 - Assets:Cash +2012-03-10 * KFC ; yum, chicken... + Expenses:Food $20.00 + Assets:Cash @end smallexample @noindent @@ -2590,15 +2591,15 @@ Notes can also appear on the next line, so long as that line begins with whitespace: @smallexample - 2012-03-10 * KFC ; yum, chicken... - ; and more notes... - Expenses:Food $20.00 - Assets:Cash +2012-03-10 * KFC ; yum, chicken... + ; and more notes... + Expenses:Food $20.00 + Assets:Cash - 2012-03-10 * KFC - ; just these notes... - Expenses:Food $20.00 - Assets:Cash +2012-03-10 * KFC + ; just these notes... + Expenses:Food $20.00 + Assets:Cash @end smallexample A transaction note is shared by all its postings. This becomes @@ -2607,10 +2608,10 @@ a note belongs only to one posting, place it after a hard separator after the amount, or on its own line preceded by whitespace: @smallexample - 2012-03-10 * KFC - Expenses:Food $20.00 ; posting #1 note - Assets:Cash - ; posting #2 note, extra indentation is optional +2012-03-10 * KFC + Expenses:Food $20.00 ; posting #1 note + Assets:Cash + ; posting #2 note, extra indentation is optional @end smallexample @node Metadata, Virtual postings, Transaction notes, Transactions @@ -2636,19 +2637,19 @@ To tag an item, put any word not containing whitespace between two colons: @smallexample - 2012-03-10 * KFC - Expenses:Food $20.00 - Assets:Cash - ; :TAG: +2012-03-10 * KFC + Expenses:Food $20.00 + Assets:Cash + ; :TAG: @end smallexample You can gang up multiple tags by sharing colons: @smallexample - 2012-03-10 * KFC - Expenses:Food $20.00 - Assets:Cash - ; :TAG1:TAG2:TAG3: +2012-03-10 * KFC + Expenses:Food $20.00 + Assets:Cash + ; :TAG1:TAG2:TAG3: @end smallexample @node Metadata values, Typed metadata, Metadata tags, Metadata @@ -2659,10 +2660,10 @@ the value can be any string of characters. Whitespace is needed after the colon, and cannot appear in the Key: @smallexample - 2012-03-10 * KFC - Expenses:Food $20.00 - Assets:Cash - ; MyTag: This is just a bogus value for MyTag +2012-03-10 * KFC + Expenses:Food $20.00 + Assets:Cash + ; MyTag: This is just a bogus value for MyTag @end smallexample @node Typed metadata, , Metadata values, Metadata @@ -2673,10 +2674,10 @@ expression and stored internally as a value rather than as a string. For example, although I can specify a date textually like so: @smallexample - 2012-03-10 * KFC - Expenses:Food $20.00 - Assets:Cash - ; AuxDate: 2012/02/30 +2012-03-10 * KFC + Expenses:Food $20.00 + Assets:Cash + ; AuxDate: 2012/02/30 @end smallexample @noindent @@ -2686,10 +2687,10 @@ into a date automatically every time it is needed as a date). If on the other hand I write this: @smallexample - 2012-03-10 * KFC - Expenses:Food $20.00 - Assets:Cash - ; AuxDate:: [2012/02/30] +2012-03-10 * KFC + Expenses:Food $20.00 + Assets:Cash + ; AuxDate:: [2012/02/30] @end smallexample @noindent @@ -2713,10 +2714,10 @@ To specify a virtual account, surround the account name with parentheses: @smallexample - 2012-03-10 * KFC - Expenses:Food $20.00 - Assets:Cash - (Budget:Food) $-20.00 +2012-03-10 * KFC + Expenses:Food $20.00 + Assets:Cash + (Budget:Food) $-20.00 @end smallexample If you want, you can state that virtual postings @emph{should} balance @@ -2724,11 +2725,11 @@ against one or more other virtual postings by using brackets (which look ``harder'') rather than parentheses: @smallexample - 2012-03-10 * KFC - Expenses:Food $20.00 - Assets:Cash - [Budget:Food] $-20.00 - [Equity:Budgets] $20.00 +2012-03-10 * KFC + Expenses:Food $20.00 + Assets:Cash + [Budget:Food] $-20.00 + [Equity:Budgets] $20.00 @end smallexample @node Expression amounts, Balance verification, Virtual postings, Transactions @@ -2739,9 +2740,9 @@ but it can also be any value expression. To indicate this, surround the amount expression with parentheses: @smallexample - 2012-03-10 * KFC - Expenses:Food ($10.00 + $20.00) ; Ledger adds it up for you - Assets:Cash +2012-03-10 * KFC + Expenses:Food ($10.00 + $20.00) ; Ledger adds it up for you + Assets:Cash @end smallexample @node Balance verification, Posting cost, Expression amounts, Transactions @@ -2768,9 +2769,9 @@ assignments. A balance assertion has this general form: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - Assets:Cash $-20.00 = $500.00 +2012-03-10 KFC + Expenses:Food $20.00 + Assets:Cash $-20.00 = $500.00 @end smallexample This simply asserts that after subtracting $20.00 from Assets:Cash, @@ -2782,9 +2783,9 @@ that the resulting total matches $500.00. If not, it is an error. A balance assignment has this form: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - Assets:Cash = $500.00 +2012-03-10 KFC + Expenses:Food $20.00 + Assets:Cash = $500.00 @end smallexample This sets the amount of the second posting to whatever it would need @@ -2799,9 +2800,9 @@ balance no longer matches your bank balance. You can create an adjustment transaction using balance assignments: @smallexample - 2012-03-10 Adjustment - Assets:Cash = $500.00 - Equity:Adjustments +2012-03-10 Adjustment + Assets:Cash = $500.00 + Equity:Adjustments @end smallexample Since the second posting is also null, it's value will become the @@ -2817,8 +2818,8 @@ indirectly provided by the balance assignment's value. As a consequence of all the above, consider the following transaction: @smallexample - 2012-03-10 My Broker - [Assets:Brokerage] = 10 AAPL +2012-03-10 My Broker + [Assets:Brokerage] = 10 AAPL @end smallexample What this says is: set the amount of the posting to whatever value is @@ -2844,9 +2845,9 @@ for you, and can use it during reporting in various ways. Here's an example of a stock purchase: @smallexample - 2012-03-10 My Broker - Assets:Brokerage 10 AAPL - Assets:Brokerage:Cash $-500.00 +2012-03-10 My Broker + Assets:Brokerage 10 AAPL + Assets:Brokerage:Cash $-500.00 @end smallexample This is different from transferring 10 AAPL shares from one account to @@ -2860,18 +2861,18 @@ You can make any posting's cost explicit using the @@ symbol after the amount or amount expression: @smallexample - 2012-03-10 My Broker - Assets:Brokerage 10 AAPL @@ $50.00 - Assets:Brokerage:Cash $-500.00 +2012-03-10 My Broker + Assets:Brokerage 10 AAPL @@ $50.00 + Assets:Brokerage:Cash $-500.00 @end smallexample When you do this, since Ledger can now figure out the balancing amount from the first posting's cost, you can elide the otheramount: @smallexample - 2012-03-10 My Broker - Assets:Brokerage 10 AAPL @@ $50.00 - Assets:Brokerage:Cash +2012-03-10 My Broker + Assets:Brokerage 10 AAPL @@ $50.00 + Assets:Brokerage:Cash @end smallexample @menu @@ -2903,17 +2904,17 @@ Just as you can have amount expressions, you can have posting expressions: @smallexample - 2012-03-10 My Broker - Assets:Brokerage 10 AAPL @@ ($500.00 / 10) - Assets:Brokerage:Cash +2012-03-10 My Broker + Assets:Brokerage 10 AAPL @@ ($500.00 / 10) + Assets:Brokerage:Cash @end smallexample You can even have both: @smallexample - 2012-03-10 My Broker - Assets:Brokerage (5 AAPL * 2) @@ ($500.00 / 10) - Assets:Brokerage:Cash +2012-03-10 My Broker + Assets:Brokerage (5 AAPL * 2) @@ ($500.00 / 10) + Assets:Brokerage:Cash @end smallexample @node Total posting costs, Virtual posting costs, Posting cost expressions, Transactions @@ -2924,17 +2925,17 @@ The cost figure following the @@ character specifies the like to specify the total cost instead, use @@@@: @smallexample - 2012-03-10 My Broker - Assets:Brokerage 10 AAPL @@@@ $500.00 - Assets:Brokerage:Cash +2012-03-10 My Broker + Assets:Brokerage 10 AAPL @@@@ $500.00 + Assets:Brokerage:Cash @end smallexample Ledger reads this as if you had written: @smallexample - 2012-03-10 My Broker - Assets:Brokerage 10 AAPL @@ ($500.00 / 10) - Assets:Brokerage:Cash +2012-03-10 My Broker + Assets:Brokerage 10 AAPL @@ ($500.00 / 10) + Assets:Brokerage:Cash @end smallexample @node Virtual posting costs, Commodity prices, Total posting costs, Transactions @@ -2947,9 +2948,9 @@ happening in the case of an exceptional transaction, surround the @@ or @@@@ with parentheses: @smallexample - 2012-03-10 My Brother - Assets:Brokerage 1000 AAPL (@@) $1 - Income:Gifts Received +2012-03-10 My Brother + Assets:Brokerage 1000 AAPL (@@) $1 + Income:Gifts Received @end smallexample @node Commodity prices, Prices vs. costs, Virtual posting costs, Transactions @@ -2964,9 +2965,9 @@ fact remains invisible to the user, unless you turn on For example, consider the stock sale given above: @smallexample - 2012-03-10 My Broker - Assets:Brokerage 10 AAPL @@ $50.00 - Assets:Brokerage:Cash +2012-03-10 My Broker + Assets:Brokerage 10 AAPL @@ $50.00 + Assets:Brokerage:Cash @end smallexample The commodity transferred into Assets:Brokerage is not actually 10 @@ -2979,19 +2980,19 @@ This becomes significant if you later sell that commodity again. For example, you might write this: @smallexample - 2012-04-10 My Broker - Assets:Brokerage:Cash - Assets:Brokerage -10 AAPL @@ $75.00 +2012-04-10 My Broker + Assets:Brokerage:Cash + Assets:Brokerage -10 AAPL @@ $75.00 @end smallexample And that would be perfectly fine, but how do you track the capital gains on the sale? It could be done with a virtual posting: @smallexample - 2012-04-10 My Broker - Assets:Brokerage:Cash - Assets:Brokerage -10 AAPL @@ $75.00 - (Income:Capital Gains) $-250.00 +2012-04-10 My Broker + Assets:Brokerage:Cash + Assets:Brokerage -10 AAPL @@ $75.00 + (Income:Capital Gains) $-250.00 @end smallexample But this gets messy since capital gains income is very real, and not @@ -3002,9 +3003,9 @@ will figure out that the price of the shares you're selling, and the cost you're selling them at, don't balance: @smallexample - 2012-04-10 My Broker - Assets:Brokerage:Cash $750.00 - Assets:Brokerage -10 AAPL @{$50.00@} @@ $75.00 +2012-04-10 My Broker + Assets:Brokerage:Cash $750.00 + Assets:Brokerage -10 AAPL @{$50.00@} @@ $75.00 @end smallexample This transaction will fail because the $250.00 price difference @@ -3024,10 +3025,10 @@ per-share price in doubled braces. This goes well with total costs, but is not required to be used with them: @smallexample - 2012-04-10 My Broker - Assets:Brokerage:Cash $750.00 - Assets:Brokerage -10 AAPL @{@{$500.00@}@} @@@@ $750.00 - Income:Capital Gains $-250.00 +2012-04-10 My Broker + Assets:Brokerage:Cash $750.00 + Assets:Brokerage -10 AAPL @{@{$500.00@}@} @@@@ $750.00 + Income:Capital Gains $-250.00 @end smallexample It should be noted that this is a convenience only for cases where you @@ -3041,38 +3042,38 @@ price form is a shorthand only. Plus, it comes with dangers. This works fine: @smallexample - 2012-04-10 My Broker - Assets:Brokerage 10 AAPL @@ $50.00 - Assets:Brokerage:Cash $750.00 +2012-04-10 My Broker + Assets:Brokerage 10 AAPL @@ $50.00 + Assets:Brokerage:Cash $750.00 - 2012-04-10 My Broker - Assets:Brokerage:Cash $375.00 - Assets:Brokerage -5 AAPL @{$50.00@} @@ $375.00 - Income:Capital Gains $-125.00 +2012-04-10 My Broker + Assets:Brokerage:Cash $375.00 + Assets:Brokerage -5 AAPL @{$50.00@} @@ $375.00 + Income:Capital Gains $-125.00 - 2012-04-10 My Broker - Assets:Brokerage:Cash $375.00 - Assets:Brokerage -5 AAPL @{$50.00@} @@ $375.00 - Income:Capital Gains $-125.00 +2012-04-10 My Broker + Assets:Brokerage:Cash $375.00 + Assets:Brokerage -5 AAPL @{$50.00@} @@ $375.00 + Income:Capital Gains $-125.00 @end smallexample @noindent But this does not do what you might expect: @smallexample - 2012-04-10 My Broker - Assets:Brokerage 10 AAPL @@ $50.00 - Assets:Brokerage:Cash $750.00 +2012-04-10 My Broker + Assets:Brokerage 10 AAPL @@ $50.00 + Assets:Brokerage:Cash $750.00 - 2012-04-10 My Broker - Assets:Brokerage:Cash $375.00 - Assets:Brokerage -5 AAPL @{@{$500.00@}@} @@ $375.00 - Income:Capital Gains $-125.00 +2012-04-10 My Broker + Assets:Brokerage:Cash $375.00 + Assets:Brokerage -5 AAPL @{@{$500.00@}@} @@ $375.00 + Income:Capital Gains $-125.00 - 2012-04-10 My Broker - Assets:Brokerage:Cash $375.00 - Assets:Brokerage -5 AAPL @{@{$500.00@}@} @@ $375.00 - Income:Capital Gains $-125.00 +2012-04-10 My Broker + Assets:Brokerage:Cash $375.00 + Assets:Brokerage -5 AAPL @{@{$500.00@}@} @@ $375.00 + Income:Capital Gains $-125.00 @end smallexample And in cases where the amounts do not divide into whole figure and @@ -3086,13 +3087,13 @@ Because lot pricing provides enough information to infer the cost, the following two transactions are equivalent: @smallexample - 2012-04-10 My Broker - Assets:Brokerage 10 AAPL @@ $50.00 - Assets:Brokerage:Cash $750.00 +2012-04-10 My Broker + Assets:Brokerage 10 AAPL @@ $50.00 + Assets:Brokerage:Cash $750.00 - 2012-04-10 My Broker - Assets:Brokerage 10 AAPL @{$50.00@} - Assets:Brokerage:Cash $750.00 +2012-04-10 My Broker + Assets:Brokerage 10 AAPL @{$50.00@} + Assets:Brokerage:Cash $750.00 @end smallexample However, note that what you see in some reports may differ, for @@ -3109,9 +3110,9 @@ stock is. You can short-circuit this lookup by ``fixing'' the price at the time of a transaction. This is done using @{=AMOUNT@}: @smallexample - 2012-04-10 My Broker - Assets:Brokerage 10 AAPL @{=$50.00@} - Assets:Brokerage:Cash $750.00 +2012-04-10 My Broker + Assets:Brokerage 10 AAPL @{=$50.00@} + Assets:Brokerage:Cash $750.00 @end smallexample These 10 AAPL will now always be reported as being worth $50, no @@ -3125,9 +3126,9 @@ a matter of preference, there is an equivalent syntax for specified fixated prices by way of the cost: @smallexample - 2012-04-10 My Broker - Assets:Brokerage 10 AAPL @@ =$50.00 - Assets:Brokerage:Cash $750.00 +2012-04-10 My Broker + Assets:Brokerage 10 AAPL @@ =$50.00 + Assets:Brokerage:Cash $750.00 @end smallexample This is the same as the previous transaction, with the same caveats @@ -3143,10 +3144,10 @@ square brackets (the same way that dates are parsed in value expressions): @smallexample - 2012-04-10 My Broker - Assets:Brokerage:Cash $375.00 - Assets:Brokerage -5 AAPL @{$50.00@} [2012-04-10] @@ $375.00 - Income:Capital Gains $-125.00 +2012-04-10 My Broker + Assets:Brokerage:Cash $375.00 + Assets:Brokerage -5 AAPL @{$50.00@} [2012-04-10] @@ $375.00 + Income:Capital Gains $-125.00 @end smallexample @node Lot notes, Lot value expressions, Lot dates, Transactions @@ -3158,10 +3159,10 @@ that the note cannot begin with an @@ character, as that would indicate a virtual cost: @smallexample - 2012-04-10 My Broker - Assets:Brokerage:Cash $375.00 - Assets:Brokerage -5 AAPL @{$50.00@} [2012-04-10] (Oh my!) @@ $375.00 - Income:Capital Gains $-125.00 +2012-04-10 My Broker + Assets:Brokerage:Cash $375.00 + Assets:Brokerage -5 AAPL @{$50.00@} [2012-04-10] (Oh my!) @@ $375.00 + Income:Capital Gains $-125.00 @end smallexample You can any combination of lot prices, dates or notes, in any order. @@ -3190,26 +3191,26 @@ name, or a lambda expression. Here's a function that yields the price as $10 in whatever commodity is being requested: @smallexample - define ten_dollars(s, date, t) = market($10, date, t) +define ten_dollars(s, date, t) = market($10, date, t) @end smallexample I can now use that in a lot value expression as follows: @smallexample - 2012-04-10 My Broker - Assets:Brokerage:Cash $375.00 - Assets:Brokerage -5 AAPL @{$50.00@} ((ten_dollars)) @@@@ $375.00 - Income:Capital Gains $-125.00 +2012-04-10 My Broker + Assets:Brokerage:Cash $375.00 + Assets:Brokerage -5 AAPL @{$50.00@} ((ten_dollars)) @@@@ $375.00 + Income:Capital Gains $-125.00 @end smallexample Alternatively, I could do the same thing without pre-defining a function by using a lambda expression taking three arguments: @smallexample - 2012-04-10 My Broker - A:B:Cash $375.00 - A:B -5 AAPL @{$50.00@} ((s, d, t -> market($10, date, t))) @@@@ $375.00 - Income:Capital Gains $-125.00 +2012-04-10 My Broker + A:B:Cash $375.00 + A:B -5 AAPL @{$50.00@} ((s, d, t -> market($10, date, t))) @@@@ $375.00 + Income:Capital Gains $-125.00 @end smallexample The arguments passed to these functions have the following meaning: @@ -3252,30 +3253,30 @@ same query syntax as the Ledger command line. Consider this posting: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - Assets:Cash +2012-03-10 KFC + Expenses:Food $20.00 + Assets:Cash @end smallexample If I write this automated transaction before it in the file: @smallexample - = expr true - Foo $50.00 - Bar $-50.00 += expr true + Foo $50.00 + Bar $-50.00 @end smallexample Then the first transaction will be modified during parsing as if I'd written this: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - Foo $50.00 - Bar $-50.00 - Assets:Cash $-20.00 - Foo $50.00 - Bar $-50.00 +2012-03-10 KFC + Expenses:Food $20.00 + Foo $50.00 + Bar $-50.00 + Assets:Cash $-20.00 + Foo $50.00 + Bar $-50.00 @end smallexample Despite this fancy logic, automated transactions themselves follow @@ -3306,25 +3307,25 @@ As a special case, if an automated transaction's posting's amount posting's cost. For example: @smallexample - = expr true - Foo 50.00 - Bar -50.00 += expr true + Foo 50.00 + Bar -50.00 - 2012-03-10 KFC - Expenses:Food $20.00 - Assets:Cash +2012-03-10 KFC + Expenses:Food $20.00 + Assets:Cash @end smallexample Then the latter transaction turns into this during parsing: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - Foo $1000.00 - Bar $-1000.00 - Assets:Cash $-20.00 - Foo $1000.00 - Bar $-1000.00 +2012-03-10 KFC + Expenses:Food $20.00 + Foo $1000.00 + Bar $-1000.00 + Assets:Cash $-20.00 + Foo $1000.00 + Bar $-1000.00 @end smallexample @node Accessing the matching posting's amount, Referring to the matching posting's account, Amount multipliers, Automated Transactions @@ -3336,22 +3337,22 @@ posting. For example, you can refer to that posting's amount using the ``amount'' value expression variable: @smallexample - = expr true - (Foo) (amount * 2) ; same as just "2" in this case += expr true + (Foo) (amount * 2) ; same as just "2" in this case - 2012-03-10 KFC - Expenses:Food $20.00 - Assets:Cash +2012-03-10 KFC + Expenses:Food $20.00 + Assets:Cash @end smallexample This becomes: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - (Foo) $40.00 - Assets:Cash $-20.00 - (Foo) $-40.00 +2012-03-10 KFC + Expenses:Food $20.00 + (Foo) $40.00 + Assets:Cash $-20.00 + (Foo) $-40.00 @end smallexample @node Referring to the matching posting's account, Applying metadata to every matched posting, Accessing the matching posting's amount, Automated Transactions @@ -3362,21 +3363,21 @@ the automated transaction itself. This is done by using the string $account, anywhere within the account part of the automated posting: @smallexample - = food - (Budget:$account) 10 += food + (Budget:$account) 10 - 2012-03-10 KFC - Expenses:Food $20.00 - Assets:Cash +2012-03-10 KFC + Expenses:Food $20.00 + Assets:Cash @end smallexample Becomes: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - (Budget:Expenses:Food) $200.00 - Assets:Cash $-20.00 +2012-03-10 KFC + Expenses:Food $20.00 + (Budget:Expenses:Food) $200.00 + Assets:Cash $-20.00 @end smallexample @node Applying metadata to every matched posting, Applying metadata to the generated posting, Referring to the matching posting's account, Automated Transactions @@ -3387,23 +3388,23 @@ copied (along with any metadata) to every posting that matches the predicate: @smallexample - = food - ; Foo: Bar - (Budget:$account) 10 += food + ; Foo: Bar + (Budget:$account) 10 - 2012-03-10 KFC - Expenses:Food $20.00 - Assets:Cash +2012-03-10 KFC + Expenses:Food $20.00 + Assets:Cash @end smallexample Becomes: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - ; Foo: Bar - (Budget:Expenses:Food) $200.00 - Assets:Cash $-20.00 +2012-03-10 KFC + Expenses:Food $20.00 + ; Foo: Bar + (Budget:Expenses:Food) $200.00 + Assets:Cash $-20.00 @end smallexample @node Applying metadata to the generated posting, State flags, Applying metadata to every matched posting, Automated Transactions @@ -3413,23 +3414,23 @@ If the automated transaction's posting has a note, that note is carried to the generated posting within the matched transaction: @smallexample - = food - (Budget:$account) 10 - ; Foo: Bar += food + (Budget:$account) 10 + ; Foo: Bar - 2012-03-10 KFC - Expenses:Food $20.00 - Assets:Cash +2012-03-10 KFC + Expenses:Food $20.00 + Assets:Cash @end smallexample Becomes: @smallexample - 2012-03-10 KFC - Expenses:Food $20.00 - (Budget:Expenses:Food) $200.00 - ; Foo: Bar - Assets:Cash $-20.00 +2012-03-10 KFC + Expenses:Food $20.00 + (Budget:Expenses:Food) $200.00 + ; Foo: Bar + Assets:Cash $-20.00 @end smallexample This is slightly different from the rules for regular transaction @@ -3460,16 +3461,16 @@ something like @smallexample 2008/01/01=2008/01/14 Client invoice ; estimated date you'll be paid - Assets:Accounts Receivable $100.00 - Income: Client name + Assets:Accounts Receivable $100.00 + Income: Client name @end smallexample Then, when you receive the payment, you change it to @smallexample 2008/01/01=2008/01/15 Client invoice ; actual date money received - Assets:Accounts Receivable $100.00 - Income: Client name + Assets:Accounts Receivable $100.00 + Income: Client name @end smallexample @noindent @@ -3477,21 +3478,21 @@ and add something like @smallexample 2008/01/15 Client payment - Assets:Checking $100.00 - Assets:Accounts Receivable + Assets:Checking $100.00 + Assets:Accounts Receivable @end smallexample Now @smallexample -ledger --subtotal --begin 2008/01/01 --end 2008/01/14 bal Income +$ ledger --subtotal --begin 2008/01/01 --end 2008/01/14 bal Income @end smallexample @noindent gives you your accrued income in the first two weeks of the year, and @smallexample -ledger --effective --subtotal --begin 2008/01/01 --end 2008/01/14 bal Income +$ ledger --effective --subtotal --begin 2008/01/01 --end 2008/01/14 bal Income @end smallexample @noindent @@ -3570,7 +3571,7 @@ That's it. To see how much Huqúq is currently owed based on your ledger transactions, use: @smallexample -ledger balance Liabilities:Huquq +$ ledger balance Liabilities:Huquq @end smallexample This works fine, but omits one aspect of the law: that Huquq is only @@ -3581,7 +3582,7 @@ value of 2.22 ounces of gold. This can be accomplished using the command: @smallexample -ledger -Q -t "/Liab.*Huquq/?(a/P@{2.22 AU@}<=@{-1.0@}&a):a" -s bal liab +$ ledger -Q -t "/Liab.*Huquq/?(a/P@{2.22 AU@}<=@{-1.0@}&a):a" -s bal liab @end smallexample With this command, the current price for gold is downloaded, and the @@ -3590,7 +3591,7 @@ of gold. If you wish the liability to be reflected in the parent subtotal either way, use this instead: @smallexample -ledger -Q -T "/Liab.*Huquq/?(O/P@{2.22 AU@}<=@{-1.0@}&O):O" -s bal liab +$ ledger -Q -T "/Liab.*Huquq/?(O/P@{2.22 AU@}<=@{-1.0@}&O):O" -s bal liab @end smallexample In some cases, you may wish to refer to the account of whichever @@ -3599,8 +3600,8 @@ this, use the special account name @samp{$account}: @smallexample = /^Some:Long:Account:Name/ - [$account] -0.10 - [Savings] 0.10 + [$account] -0.10 + [Savings] 0.10 @end smallexample This example causes 10% of the matching account's total to be deferred @@ -3643,7 +3644,7 @@ The balance report is the most commonly used report. The simplest invocation is: @smallexample -ledger balance -f drewr3.dat +$ ledger balance -f drewr3.dat @end smallexample @noindent @@ -3677,7 +3678,7 @@ specific accounts is as easy as entering the names of the accounts after the command. @smallexample -20:37:53 ~/ledger/test/input > ledger balance -f drewr3.dat Auto MasterCard +$ ledger balance -f drewr3.dat Auto MasterCard $ 5,500.00 Expenses:Auto $ -20.00 Liabilities:MasterCard -------------------- @@ -3693,7 +3694,7 @@ If you want the entire contents of a branch of your account tree, use the highest common name in the branch: @smallexample -20:39:21 ~/ledger/test/input > ledger balance -f drewr3.dat Income +$ ledger balance -f drewr3.dat Income $ -2,030.00 Income $ -2,000.00 Salary $ -30.00 Sales @@ -3706,8 +3707,8 @@ You can use general regular expressions in nearly anyplace Ledger needs a string: @smallexample -20:40:28 ~/ledger/test/input > ledger balance -f drewr3.dat ^Bo -21:13:29 ~/ledger/test/input > ledger balance -f drewr3.dat Bo +$ ledger balance -f drewr3.dat ^Bo +$ ledger balance -f drewr3.dat Bo $ 20.00 Expenses:Books @end smallexample @@ -3721,8 +3722,8 @@ If you want to know exactly how much you have spent in a particular account on a particular payee, the following are equivalent: @smallexample -> ledger balance Auto:Fuel and Chevron -> ledger balance --limit "(account=~/Fuel/) & (payee=~/Chev/)" +$ ledger balance Auto:Fuel and Chevron +$ ledger balance --limit "(account=~/Fuel/) & (payee=~/Chev/)" @end smallexample @noindent @@ -3736,7 +3737,7 @@ If you want to exclude specific accounts from the report, you can exclude multiple accounts with parentheses: @smallexample -ledger -s bal Expenses and not \(Expenses:Drinks or Expenses:Candy or Expenses:Gifts\) +$ ledger -s bal Expenses and not \(Expenses:Drinks or Expenses:Candy or Expenses:Gifts\) @end smallexample @node Controlling formatting, , Controlling the Accounts and Payees, Balance Reports @@ -3869,15 +3870,15 @@ would look like: ; automatic calculations for asset allocation tracking ; = expr ( commodity == 'VIFSX' ) - (Allocation:Equities:Domestic) 1.000 + (Allocation:Equities:Domestic) 1.000 = expr ( commodity == 'VTHRX' ) - (Allocation:Equities:Global) 0.240 - (Allocation:Equities:Domestic) 0.563 - (Allocation:Bonds/Cash) 0.197 + (Allocation:Equities:Global) 0.240 + (Allocation:Equities:Domestic) 0.563 + (Allocation:Bonds/Cash) 0.197 = expr ( commodity == 'VBMFX') - (Allocation:Bonds/Cash) 1.000 + (Allocation:Bonds/Cash) 1.000 @end smallexample How do these work? First the `=' sign at the beginning of the line @@ -3898,9 +3899,9 @@ formatting! @smallexample ledger bal Allocation --current --format "\ - %-17((depth_spacer)+(partial_account))\ - %10(percent(market(display_total), market(parent.total)))\ - %16(market(display_total))\n%/" + %-17((depth_spacer)+(partial_account))\ + %10(percent(market(display_total), market(parent.total)))\ + %16(market(display_total))\n%/" @end smallexample @noindent @@ -4137,7 +4138,7 @@ line in the data above with: Then execute ledger like this: @smallexample -ledger convert download.csv --input-date-format "%m/%d/%Y" +$ ledger convert download.csv --input-date-format "%m/%d/%Y" @end smallexample Where the @code{--input-date-format} option tells ledger how to @@ -4747,11 +4748,11 @@ The @command{payees} reports all of the unique payees in the journal. To filter the payees displayed you must use the prefix: @smallexample -macbook-2:$ ledger payees 'Tar.+t' -El Dorade Restaurant -My Big Fat Greek Restaurant -Target -macbook-2:$ +$ ledger payees @Nic +Nicolas +Nicolas BOILABUS +Oudtshoorn Municipality +Vaca Veronica @end smallexample @node commodities, tags, payees, Reports about your Journals @@ -4796,7 +4797,7 @@ Italiano} again. The exact amounts are different, but the overall form is the same. With the @command{xact} command you can type: @smallexample -ledger entry 2004/4/9 viva food 11 tips 2.50 +$ ledger entry 2004/4/9 viva food 11 tips 2.50 @end smallexample This produces the following output: @@ -4818,12 +4819,12 @@ Here are a few more examples of the @command{xact} command, assuming the above journal transaction: @smallexample -ledger entry 4/9 viva 11.50 -ledger entry 4/9 viva 11.50 checking # (from `checking') -ledger entry 4/9 viva food 11.50 tips 8 -ledger xact 4/9 viva food 11.50 tips 8 cash -ledger xact 4/9 viva food $11.50 tips $8 cash -ledger xact 4/9 viva dining "DM 11.50" +$ ledger entry 4/9 viva 11.50 +$ ledger entry 4/9 viva 11.50 checking # (from `checking') +$ ledger entry 4/9 viva food 11.50 tips 8 +$ ledger xact 4/9 viva food 11.50 tips 8 cash +$ ledger xact 4/9 viva food $11.50 tips $8 cash +$ ledger xact 4/9 viva dining "DM 11.50" @end smallexample @command{xact} is identical to @command{entry} and is provide for @@ -4852,7 +4853,7 @@ a large number of options for refining the output from those commands. The basic syntax of any ledger command is: @smallexample -ledger [OPTIONS...] COMMAND [ARGS...] +$ ledger [OPTIONS...] COMMAND [ARGS...] @end smallexample After the command word there may appear any number of arguments. For @@ -4868,14 +4869,14 @@ example, the following balance command reports account totals for rent, food and movies, but only those whose payee matches Freddie: @smallexample -ledger bal rent food movies payee freddie +$ ledger bal rent food movies payee freddie @end smallexample @noindent or @smallexample -ledger bal rent food movies @@freddie +$ ledger bal rent food movies @@freddie @end smallexample There are many, many command options available with the @@ -5196,7 +5197,7 @@ Display the options in effect for this Ledger invocation, along with their values and the source of those values, for example: @smallexample -14:15:02 > ledger --options bal --cleared -f ~/ledger/test/input/drewr3.dat +$ ledger --options bal --cleared -f ~/ledger/test/input/drewr3.dat =========================================================================== [Global scope options] @@ -5267,7 +5268,7 @@ information. Specify the input date format for journal entries. For example, @smallexample -ledger convert Export.csv --input-date-format "%m/%d/%Y" +$ ledger convert Export.csv --input-date-format "%m/%d/%Y" @end smallexample Would convert the @file{Export.csv} file to ledger format, assuming @@ -5409,7 +5410,7 @@ Print the entire line in bold if the given value expression is true (@pxref{Value Expressions}). @smallexample -ledger reg Expenses --begin Dec --bold-if "amount > 100" +$ ledger reg Expenses --begin Dec --bold-if "amount > 100" @end smallexample @noindent @@ -5596,7 +5597,7 @@ calculations occur. group transactions by the day of the week. @smallexample -ledger reg Expenses --dow --collapse +$ ledger reg Expenses --dow --collapse @end smallexample @noindent @@ -5664,7 +5665,7 @@ a grouped report. Only has effect with a @code{--group-by} register report. @smallexample -ledger reg Expenses --group-by "payee" --group-title-format "------------------------ %-20(value) ---------------------\n" +$ ledger reg Expenses --group-by "payee" --group-title-format "------------------------ %-20(value) ---------------------\n" ------------------------ 7-Eleven --------------------- 2011/08/13 7-Eleven Expenses:Auto:Misc $ 5.80 $ 5.80 @@ -6020,7 +6021,7 @@ monthly expenses, in order to view the highest expense categories at the top of each month: @smallexample -ledger -M --period-sort -At reg ^Expenses +$ ledger -M --period-sort -At reg ^Expenses @end smallexample @item --cleared @@ -6063,7 +6064,7 @@ this transaction: And the register command was: @smallexample -ledger -r register food +$ ledger -r register food @end smallexample The following would be output, showing the postings related to the @@ -6258,7 +6259,7 @@ useful for seeing last month's checking postings, against a running balance which includes all posting values: @smallexample -ledger -d "d>=[last month]" reg checking +$ ledger -d "d>=[last month]" reg checking @end smallexample The output from this command is very different from the following, @@ -6266,7 +6267,7 @@ whose running total includes only postings from the last month onward: @smallexample -ledger -p "last month" reg checking +$ ledger -p "last month" reg checking @end smallexample Which is more useful depends on what you're looking to know: the total @@ -6498,7 +6499,7 @@ default, as if you'd specified a global, automated transaction as follows: @smallexample - = expr true += expr true ; VALUE:: market(amount, date, exchange) @end smallexample @@ -6523,7 +6524,7 @@ Or how about never re-valuating commodities used in Expenses, since they cannot have a different future value: @smallexample - = /^Expenses:/ += /^Expenses:/ ; VALUE:: market(amount, post.date, exchange) @end smallexample @@ -6535,7 +6536,7 @@ Or how about valuating miles based on a reimbursement rate during a specific time period: @smallexample - = expr commodity == "miles" and date >= [2007] and date < [2008] += expr commodity == "miles" and date >= [2007] and date < [2008] ; VALUE:: market($1.05, date, exchange) @end smallexample @@ -6549,12 +6550,12 @@ posting or transaction, by overriding these general defaults using specific meta-data: @smallexample - 2010-12-26 Example - Expenses:Food $20 - ; Just to be silly, always valuate *these* $20 as 30 DM, no matter what - ; the user asks for with -V or -X - ; VALUE:: 30 DM - Assets:Cash +2010-12-26 Example + Expenses:Food $20 + ; Just to be silly, always valuate *these* $20 as 30 DM, no matter what + ; the user asks for with -V or -X + ; VALUE:: 30 DM + Assets:Cash @end smallexample This example demonstrates that your VALUE expression should be as @@ -6569,7 +6570,7 @@ EUR}, except for certain accounts or postings which should always be valuated in another currency. For example: @smallexample - = /^Assets:Brokerage:CAD$/ += /^Assets:Brokerage:CAD$/ ; Always report the value of commodities in this account in ; terms of present day dollars, despite what was asked for ; on the command-line VALUE:: market(amount, date, '$') @@ -6624,7 +6625,6 @@ option settings in the file @file{~/.ledgerrc}, for example: @smallexample --pager /bin/cat - @end smallexample @node Period Expressions, , Detailed Options Description, Command-line Syntax @@ -6816,8 +6816,8 @@ ledger --forecast "d<[2010]" bal ^assets ^liabilities Ledger directly supports ``timelog'' entries, which have this form: @smallexample - i 2013/03/28 22:13:00 ACCOUNT[ PAYEE] - o 2013/03/29 03:39:00 +i 2013/03/28 22:13:00 ACCOUNT[ PAYEE] +o 2013/03/29 03:39:00 @end smallexample This records a check-in to the given ACCOUNT, and a check-out. You @@ -6879,7 +6879,7 @@ command shows only transactions from the beginning of the current month, while still calculating the running balance based on all transactions: @smallexample -ledger -d "d>[this month]" register checking +$ ledger -d "d>[this month]" register checking @end smallexample This advantage to this command's complexity is that it prints the @@ -6888,7 +6888,7 @@ following, simpler command is similar, but totals only the displayed postings: @smallexample -ledger -b "this month" register checking +$ ledger -b "this month" register checking @end smallexample @menu @@ -7350,11 +7350,11 @@ default balance format looks like this (the various functions are described later): @smallexample - "%(justify(scrub(display_total), 20, -1, true, color))" - " %(!options.flat ? depth_spacer : \"\")" - "%-(ansify_if(partial_account(options.flat), blue if color))\n%/" - "%$1\n%/" - "--------------------\n" +"%(justify(scrub(display_total), 20, -1, true, color))" +" %(!options.flat ? depth_spacer : \"\")" +"%-(ansify_if(partial_account(options.flat), blue if color))\n%/" +"%$1\n%/" +"--------------------\n" @end smallexample @node Formatting codes, , --balance-format, Format Strings @@ -7671,12 +7671,11 @@ and PeriodicTransaction's, etc. Here is how you would traverse all the postings in your data file: @smallexample +import ledger - import ledger - - for xact in ledger.read_journal("sample.dat").xacts: - for post in xact.posts: - print "Transferring %s to/from %s" % (post.amount, post.account) +for xact in ledger.read_journal("sample.dat").xacts: + for post in xact.posts: + print "Transferring %s to/from %s" % (post.amount, post.account) @end smallexample @node Raw vs. Cooked, Queries, Basic data traversal, Extending with Python @@ -7687,29 +7686,29 @@ are what you get from a traversal like the above, and represent exactly what was seen in the data file. Consider this journal: @smallexample - = true - (Assets:Cash) $100 += true + (Assets:Cash) $100 - 2012-03-01 KFC - Expenses:Food $100 - Assets:Credit +2012-03-01 KFC + Expenses:Food $100 + Assets:Credit @end smallexample In this case, the @emph{raw} regular transaction in this file is: @smallexample - 2012-03-01 KFC - Expenses:Food $100 - Assets:Credit +2012-03-01 KFC + Expenses:Food $100 + Assets:Credit @end smallexample While the @emph{cooked} form is: @smallexample - 2012-03-01 KFC - Expenses:Food $100 - Assets:Credit $-100 - (Assets:Cash) $100 +2012-03-01 KFC + Expenses:Food $100 + Assets:Credit $-100 + (Assets:Cash) $100 @end smallexample So the easy way to think about raw vs. cooked is that raw is the @@ -7720,8 +7719,8 @@ generally looking at raw data. In order to look at cooked data, you must generate a report of some kind by querying the journal: @smallexample - for post in ledger.read_journal("sample.dat").query("food"): - print "Transferring %s to/from %s" % (post.amount, post.account) +for post in ledger.read_journal("sample.dat").query("food"): + print "Transferring %s to/from %s" % (post.amount, post.account) @end smallexample The reason why queries iterate over postings instead of transactions @@ -7730,13 +7729,13 @@ apply to. You can always get at a matching posting's transaction by looking at its ``xact'' member: @smallexample - last_xact = None - for post in ledger.read_journal("sample.dat").query(""): - if post.xact != last_xact: - for post in post.xact.posts: - print "Transferring %s to/from %s" % (post.amount, - post.account) - last_xact = post.xact +last_xact = None +for post in ledger.read_journal("sample.dat").query(""): + if post.xact != last_xact: + for post in post.xact.posts: + print "Transferring %s to/from %s" % (post.amount, + post.account) + last_xact = post.xact @end smallexample This query ends up reporting every cooked posting in the Journal, but @@ -7761,19 +7760,19 @@ state. You can embed Python into your data files using the 'python' directive: @smallexample - python - import os - def check_path(path_value): - print "%s => %s" % (str(path_value), os.path.isfile(str(path_value))) - return os.path.isfile(str(path_value)) +python + import os + def check_path(path_value): + print "%s => %s" % (str(path_value), os.path.isfile(str(path_value))) + return os.path.isfile(str(path_value)) - tag PATH - assert check_path(value) +tag PATH + assert check_path(value) - 2012-02-29 KFC - ; PATH: somebogusfile.dat - Expenses:Food $20 - Assets:Cash +2012-02-29 KFC + ; PATH: somebogusfile.dat + Expenses:Food $20 + Assets:Cash @end smallexample Any Python functions you define this way become immediately available @@ -7789,10 +7788,10 @@ commodity. If you need to create sums of multiple commodities, use a Balance. For example: @smallexample - total = Balance() - for post in ledger.read_journal("sample.dat").query(""): - total += post.amount - print total +total = Balance() +for post in ledger.read_journal("sample.dat").query(""): + total += post.amount +print total @end smallexample @node Ledger for Developers, Major Changes from version 2.6, Extending with Python, Top @@ -8450,7 +8449,7 @@ and apply it against a model transaction. Evaluate the given period and report how Ledger interprets it: @smallexample -20:22:21 ~/ledger (next)> ledger period "this year" +$ ledger period "this year" --- Period expression tokens --- TOK_THIS: this TOK_YEAR: year @@ -8473,7 +8472,7 @@ Evaluate the given query and report how Ledger interprets it against the model transaction: @smallexample -20:25:42 ~/ledger (next)> ledger query "/Book/" +$ ledger query "/Book/" --- Input arguments --- ("/Book/") @@ -8666,11 +8665,11 @@ to the main body of the documentation. @subsection Invoking Ledger @smallexample -ledger --group-by "tag('trip')" bal -legder reg --sort "tag('foo')" %foo -ledger cleared VWCU NFCU Tithe Misentry -ledger register Joint --uncleared -ledger register Checking --sort d -d 'd>[2011/04/01]' until 2011/05/25 +$ ledger --group-by "tag('trip')" bal +$ legder reg --sort "tag('foo')" %foo +$ ledger cleared VWCU NFCU Tithe Misentry +$ ledger register Joint --uncleared +$ ledger register Checking --sort d -d 'd>[2011/04/01]' until 2011/05/25 @end smallexample @node Ledger Files, , Invoking Ledger, Cookbook -- cgit v1.2.3 From ace962963196e9290a305a6f200faa120d7eff47 Mon Sep 17 00:00:00 2001 From: thdox Date: Sat, 27 Apr 2013 22:10:04 +0200 Subject: For consistency, moved @example to @smallexample --- doc/ledger3.texi | 120 +++++++++++++++++++++++++++---------------------------- 1 file changed, 60 insertions(+), 60 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 15fb988d..0aca50f9 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -634,9 +634,9 @@ offsets the value of your assets. The combined total of your Assets and Liabilities is your net worth. So to see your current net worth, use this command: -@example -ledger balance ^assets ^liabilities -@end example +@smallexample +$ ledger balance ^assets ^liabilities +@end smallexample In a similar vein, your Income accounts show up negative, because they transfer money @emph{from} an account in order to increase your @@ -646,18 +646,18 @@ flow. A positive cash flow means you are spending more than you make, since income is always a negative figure. To see your current cash flow, use this command: -@example -ledger balance ^income ^expenses -@end example +@smallexample +$ ledger balance ^income ^expenses +@end smallexample Another common question to ask of your expenses is: How much do I spend each month on X? Ledger provides a simple way of displaying monthly totals for any account. Here is an example that summarizes your monthly automobile expenses: -@example -ledger -M register expenses:auto -@end example +@smallexample +$ ledger -M register expenses:auto +@end smallexample This assumes, of course, that you use account names like @code{Expenses:Auto:Gas} and @code{Expenses:Auto:Repair}. @@ -829,13 +829,13 @@ currencies, while non-joined symbols appearing after the amount refer to commodities. Here are some valid currency and commodity specifiers: -@example +@smallexample $20.00 ; currency: twenty US dollars 40 AAPL ; commodity: 40 shares of Apple stock 60 DM ; currency: 60 Deutsch Mark £50 ; currency: 50 British pounds 50 EUR ; currency: 50 Euros (or use appropriate symbol) -@end example +@end smallexample Ledger will examine the first use of any commodity to determine how that commodity should be printed on reports. It pays attention to @@ -878,9 +878,9 @@ Specify the price history to use with the @code{--price-db} option, with the @code{-V} option to report in terms of current market value: -@example -ledger --price-db prices.db -V balance brokerage -@end example +@smallexample +$ ledger --price-db prices.db -V balance brokerage +@end smallexample The balance for your brokerage account will be reported in US dollars, since the prices database uses that currency. @@ -894,9 +894,9 @@ you had $5000 in your checking account, and for whatever reason you wanted to know many ounces of gold that would buy, in terms of the current price of gold: -@example -ledger -T "@{1 AU@}*(O/P@{1 AU@})" balance checking -@end example +@smallexample +$ ledger -T "@{1 AU@}*(O/P@{1 AU@})" balance checking +@end smallexample Although the total expression appears complex, it is simply saying that the reported total should be in multiples of AU units, where the @@ -1168,16 +1168,16 @@ funds. In this case, you will likely want to mask out your @code{Assets} account, because otherwise the balance won't make much sense: -@example -ledger bal -^Assets -@end example +@smallexample +$ ledger bal -^Assets +@end smallexample If the @code{--real} option is used, the report will be in terms of the real accounts: -@example -ledger --real bal -@end example +@smallexample +$ ledger --real bal +@end smallexample If more asset accounts are needed as the source of a posting, just list them as you would normally, for example: @@ -3753,9 +3753,9 @@ you want, or interface Ledger with other programs. A query such as the following shows all expenses since last October, sorted by total: -@example -ledger -b "last oct" -s -S T bal ^expenses -@end example +@smallexample +$ ledger -b "last oct" -s -S T bal ^expenses +@end smallexample From left to right the options mean: Show transactions since last October; show all sub-accounts; sort by the absolute value of the @@ -3772,17 +3772,17 @@ total; and report the balance for all accounts that begin with The following query makes it easy to see monthly expenses, with each month's expenses sorted by the amount: -@example -ledger -M --period-sort "(amount)" reg ^expenses -@end example +@smallexample +$ ledger -M --period-sort "(amount)" reg ^expenses +@end smallexample Now, you might wonder where the money came from to pay for these things. To see that report, add @code{-r}, which shows the ``related account'' postings: -@example -ledger -M --period-sort "(amount)" -r reg ^expenses -@end example +@smallexample +$ ledger -M --period-sort "(amount)" -r reg ^expenses +@end smallexample But maybe this prints too much information. You might just want to see how much you're spending with your MasterCard. That kind of query @@ -3790,9 +3790,9 @@ requires the use of a display predicate, since the postings calculated must match @code{^expenses}, while the postings displayed must match @code{mastercard}. The command would be: -@example -ledger -M -r --display "account =~ /mastercard/" reg ^expenses -@end example +@smallexample +$ ledger -M -r --display "account =~ /mastercard/" reg ^expenses +@end smallexample This query says: Report monthly subtotals; report the ``related account'' postings; display only related postings whose @@ -3801,9 +3801,9 @@ postings matching @code{^expenses}. This works just as well for report the overall total, too: -@example -ledger -s -r --display "account =~ /mastercard/" reg ^expenses -@end example +@smallexample +$ ledger -s -r --display "account =~ /mastercard/" reg ^expenses +@end smallexample The @code{-s} option subtotals all postings, just as @code{-M} subtotaled by the month. The running total in both cases is off, @@ -3950,9 +3950,9 @@ whether Gnuplot should plot the amount, or the running total. For example, this command plots total monthly expenses made on your MasterCard. -@example -report -j -M -r --display "account =~ /mastercard/" reg ^expenses -@end example +@smallexample +$ report -j -M -r --display "account =~ /mastercard/" reg ^expenses +@end smallexample The @command{report} script is a very simple Bourne shell script, that passes a set of scripted commands to Gnuplot. Feel free to modify the @@ -4748,7 +4748,7 @@ The @command{payees} reports all of the unique payees in the journal. To filter the payees displayed you must use the prefix: @smallexample -$ ledger payees @Nic +$ ledger payees @@Nic Nicolas Nicolas BOILABUS Oudtshoorn Municipality @@ -6756,9 +6756,9 @@ These two period transactions give the usual monthly expenses, as well as one typical yearly expense. For help on finding out what your average monthly expense is for any category, use a command like: -@example -ledger -p "this year" --monthly --average --subtotal balance ^expenses -@end example +@smallexample +$ ledger -p "this year" --monthly --average --subtotal balance ^expenses +@end smallexample The reported totals are the current year's average for each account. @@ -6766,24 +6766,24 @@ Once these period transactions are defined, creating a budget report is as easy as adding @code{--budget} to the command-line. For example, a typical monthly expense report would be: -@example -ledger --monthly register ^expenses -@end example +@smallexample +$ ledger --monthly register ^expenses +@end smallexample To see the same report balanced against your budget, use: -@example -ledger --budget --monthly register ^expenses -@end example +@smallexample +$ ledger --budget --monthly register ^expenses +@end smallexample A budget report includes only those accounts that appear in the budget. To see all expenses balanced against the budget, use @code{--add-budget}. You can even see only the un-budgeted expenses using @code{--unbudgeted}: -@example -ledger --unbudgeted --monthly register ^expenses -@end example +@smallexample +$ ledger --unbudgeted --monthly register ^expenses +@end smallexample You can also use these flags with the @command{balance} command. @@ -6795,9 +6795,9 @@ future, such as determining when an account will reach zero. Ledger makes this easy to do, using the same period transactions as are used for budgeting. An example forecast report can be generated with: -@example -ledger --forecast "T>@{\$-500.00@}" register ^assets ^liabilities -@end example +@smallexample +$ ledger --forecast "T>@{\$-500.00@}" register ^assets ^liabilities +@end smallexample This report continues outputting postings until the running total is greater than $-500.00. A final posting is always output, to @@ -6806,9 +6806,9 @@ show you what the total afterwards would be. Forecasting can also be used with the balance report, but by date only, and not against the running total: -@example -ledger --forecast "d<[2010]" bal ^assets ^liabilities -@end example +@smallexample +$ ledger --forecast "d<[2010]" bal ^assets ^liabilities +@end smallexample @node Time Keeping, Value Expressions, Budgeting and Forecasting, Top @chapter Time Keeping -- cgit v1.2.3 From ec6337403aaaaf6308839a0017a11ca8ad18702c Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 28 Apr 2013 09:51:28 +0200 Subject: Add @findex inside document to index --options cited in document --- doc/ledger3.texi | 102 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 79 insertions(+), 23 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 0aca50f9..ec6c8682 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -874,9 +874,11 @@ P 2004/06/21 02:18:02 AAPL $32.91 P 2004/06/21 02:18:02 AU $400.00 @end smallexample +@findex --price-db FILE +@findex --market Specify the price history to use with the @code{--price-db} option, -with the @code{-V} option to report in terms of current market -value: +with the @code{-V (--market)} option to report in terms of current +market value: @smallexample $ ledger --price-db prices.db -V balance brokerage @@ -1172,6 +1174,7 @@ sense: $ ledger bal -^Assets @end smallexample +@findex --real If the @code{--real} option is used, the report will be in terms of the real accounts: @@ -1210,6 +1213,8 @@ Note how the accounts now relate only to the real accounts, and any balance or registers reports will reflect this. That the transactions relate to a particular fund is kept only in the code. +@findex --code-as-payee +@findex --by-payee How does this become a fund report? By using the @code{--code-as-payee} option, you can generate a register report where the payee for each posting shows the code. Alone, this is @@ -1616,19 +1621,22 @@ Assets:Checking because its amount is null. @node Complete control over commodity pricing, , Fixing Lot Prices, Currency and Commodities @subsection Complete control over commodity pricing +@findex --market +@findex --exchange Ledger allows you to have very detailed control over how your commodities are valued. You can fine tune the results given using the @code{--market} or @code{--exchange} options. There are now several points of interception, you can specify the valuation method: + @enumerate - @item on a commodity itself - @item on a posting, via metadata (affect is largely the same as #1) - @item on an xact, which then applies to all postings in that xact - @item on any posting via an automated transaction - @item on a per-account basis - @item on a per-commodity basis - @item by changing the journal default of @code{market} +@item on a commodity itself +@item on a posting, via metadata (affect is largely the same as #1) +@item on an xact, which then applies to all postings in that xact +@item on any posting via an automated transaction +@item on a per-account basis +@item on a per-commodity basis +@item by changing the journal default of @code{market} @end enumerate Fixated pricing (such as @code{@{=$20@})} still plays a role in this @@ -1647,8 +1655,8 @@ The reference date the price should be relative. @item target A string identifying the ``target'' commodity, or the commodity the - returned price should be in. This argument is null if - @code{--market} was used instead of @code{--exchange}. +returned price should be in. This argument is null if @code{--market} +was used instead of @code{--exchange}. @end table The valuation function should return an amount. If you've written @@ -1762,6 +1770,7 @@ ledger reg -V food @node Keeping it Consistent, Journal Format, Currency and Commodities, Keeping a Journal @section Keeping it Consistent +@findex --strict Sometimes Ledger's flexibility can lead to difficulties. Using a freeform text editor to enter transactions makes it easy to keep the @@ -1890,6 +1899,8 @@ Ledger. @node Command Directives, , Transaction and Comments, Journal Format @subsection Command Directives +@findex --strict +@findex --pedantic @table @code @item beginning of line @@ -2485,6 +2496,7 @@ This transaction is identical to writing: @node Auxiliary dates, Codes, Eliding amounts, Transactions @section Auxiliary dates +@findex --aux-date You can associate a second date with a transaction by following the primary date with an equals sign: @@ -2516,6 +2528,9 @@ you a place to put those codes: @node Transaction state, Transaction notes, Codes, Transactions @section Transaction state +@findex --cleared +@findex --uncleared +@findex --pending A transaction can have a ``state'': cleared, pending, or uncleared. The default is uncleared. To mark a transaction cleared, put a * @@ -2700,6 +2715,7 @@ date. @node Virtual postings, Expression amounts, Metadata, Transactions @section Virtual postings +@findex --real Ordinarily, the amounts of all postings in a transaction must balance to zero. This is non-negotiable. It's what double-entry accounting @@ -2955,6 +2971,7 @@ or @@@@ with parentheses: @node Commodity prices, Prices vs. costs, Virtual posting costs, Transactions @section Commodity prices +@findex --lot-prices When a transaction occurs that exchange one commodity for another, Ledger records that commodity price not only within its internal price @@ -3136,6 +3153,7 @@ found in @ref{Prices vs. costs}. @node Lot dates, Lot notes, Fixated prices, Transactions @section Lot dates +@findex --lot-dates In addition to lot prices, you can specify lot dates and reveal them with @code{--lot-dates}. Other than that, however, they have no @@ -3152,6 +3170,8 @@ expressions): @node Lot notes, Lot value expressions, Lot dates, Transactions @section Lot notes +@findex --lot-notes +@findex --lots You can also associate arbitrary notes for your own record keeping in parentheses, and reveal them with @code{--lot-notes}. One caveat is @@ -3449,6 +3469,7 @@ posting. @node Effective Dates, Periodic Transactions, State flags, Automated Transactions @subsection Effective Dates @cindex effective dates +@findex --effective In the real world transactions do not take place instantaneously. Purchases can take several days to post to a bank account. And you may @@ -3524,6 +3545,7 @@ really knows that it debited $225 this month. @node Periodic Transactions, Concrete Example of Automated Transactions, Effective Dates, Automated Transactions @subsection Periodic Transactions +@findex --budget A periodic transaction starts with a ~ followed by a period expression. Periodic transactions are used for budgeting and @@ -3683,7 +3705,6 @@ $ ledger balance -f drewr3.dat Auto MasterCard $ -20.00 Liabilities:MasterCard -------------------- $ 5,480.00 -20:39:21 ~/ledger/test/input > @end smallexample @noindent @@ -3700,7 +3721,6 @@ $ ledger balance -f drewr3.dat Income $ -30.00 Sales -------------------- $ -2,030.00 -20:40:28 ~/ledger/test/input > @end smallexample You can use general regular expressions in nearly anyplace Ledger @@ -3768,6 +3788,10 @@ total; and report the balance for all accounts that begin with @node Reporting monthly expenses, , Typical queries, Typical queries @subsection Reporting monthly expenses +@findex --monthly +@findex -M +@findex --display +@findex --period-sort The following query makes it easy to see monthly expenses, with each month's expenses sorted by the amount: @@ -3938,6 +3962,8 @@ tell Ledger what to do for the last line, in this case, nothing. @cindex Gnuplot script @cindex plotting @cindex Gnuplot +@findex --amount-data +@findex --total-data If you have @command{Gnuplot} installed, you can graph any of the above register reports. The script to do this is included in the @@ -4093,6 +4119,7 @@ limiting and searching functions. @cindex reading csv @cindex comma separated variable file reading @findex convert +@findex --input-date-format The @code{convert} command parses a comma separated value (csv) file and outputs Ledger transactions. Many banks offer csv file downloads. @@ -4121,12 +4148,12 @@ Transaction Number,Date,Description,Memo,Amount Debit,Amount Credit,Balance,Chec 1113648,12/12/2011,"Withdrawal","Tuscan IT #00037657",-29.73,,00001908.37,, @end smallexample -Unfortunately, as it stands Ledger cannot read it, but you can. Ledger +Unfortunately, as it stands Ledger cannot read it, but you can. Ledger expects the first line to contain a description of the fields on each -line of the file. The fields ledger can recognize are called -``@code{date}'' ``@code{posted}'', ``@code{code}'', ``@code{payee} or -@code{desc}'', ``@code{amount}'', ``@code{cost}'', ``@code{total}'', and -``@code{note}''. +line of the file. The fields ledger can recognize are called +@option{date}, @option{posted}, @option{code}, @option{payee} or +@option{desc}, @option{amount}, @option{cost}, @option{total}, and +@option{note}. Delete the account description lines at the top, and replace the first line in the data above with: @@ -4161,6 +4188,10 @@ transid,date,payee,note,amount,,,code, Ledger will include @code{; transid: 767718} in the first transaction is from the file above. +@findex --invert +@findex --account NAME +@findex --rich-data + The @code{convert} command accepts three options, the most important ones are @code{--invert} which inverts the amount field, and @code{--account NAME} which you can use to specify the account to @@ -4721,6 +4752,7 @@ pricedb database files. @node Reports about your Journals, , Reports in other Formats, Reporting Commands @section Reports about your Journals +@findex --count @menu * accounts:: @@ -4744,8 +4776,9 @@ account. @subsection @code{payees} @findex payees -The @command{payees} reports all of the unique payees in the -journal. To filter the payees displayed you must use the prefix: +The @command{payees} reports all of the unique payees in the journal. +Using the @code{--count} option will tell you how many entries use +each payee. To filter the payees displayed you must use the prefix: @smallexample $ ledger payees @@Nic @@ -4766,6 +4799,7 @@ tell you how many entries use each commodity. @node tags, entry and xact, commodities, Reports about your Journals @subsection @command{tags} @findex tags +@findex --values The @command{tags} reports all of the tags in the journal. The output is sorted by name. Using the @code{--count} option will tell you how @@ -5179,7 +5213,7 @@ GUIs, which would make use of the different scopes by keeping an instance of Ledger running in the background and running multiple sessions with multiple reports per session. -@table @code +@ftable @code @item --args-only Ignore all environment and init-file settings and use only command-line arguments to control Ledger. Useful for debugs @@ -5234,7 +5268,7 @@ a function called @code{normalize_options}. @item --script Execute a ledger script. -@end table +@end ftable @node Session Options, Report Options, Global Options, Detailed Options Description @subsection Session Options @@ -5302,7 +5336,7 @@ $ ledger -f test/input/drewr3.dat bal --master-account HUMBUG $ 200.00 Mortgage:Principal @end smallexample -@item --price-db +@item --price-db FILE Specify the location of the price entry data file. @item --price-exp INTEGER_MINUTES @@ -6488,6 +6522,8 @@ commodity can mean different things to different people, depending on the accounts involved, the commodities, the nature of the transactions, etc. +@findex --now + When you specify @code{-V}, or @code{-X COMM}, you are requesting that some or all of the commodities be valuated as of today (or whatever @code{--now} is set to). But what does such a valuation mean? This @@ -6578,6 +6614,7 @@ valuated in another currency. For example: @cindex FIFO/LIFO @cindex LIFO/FIFO +@findex --lots Ledger presently has no way of handling such things as FIFO and LIFO. If you specify an unadorned commodity name, like AAPL, it will balance @@ -6585,6 +6622,7 @@ against itself. If @code{--lots} are not being displayed, then it will appear to balance against any lot of AAPL. @cindex adorned commodity +@findex --lot-prices If you specify an adorned commodity, like AAPL @{$10.00@}, it will also balance against itself, and against any AAPL if @code{--lots} is not specified. But if you do specify @code{--lot-prices}, for @@ -6724,6 +6762,9 @@ weekly last august @node Budgeting, Forecasting, Budgeting and Forecasting, Budgeting and Forecasting @section Budgeting +@findex --budget +@findex --add-budget +@findex --unbudgeted Keeping a budget allows you to pay closer attention to your income and expenses, by reporting how far your actual financial activity is from @@ -6789,6 +6830,7 @@ You can also use these flags with the @command{balance} command. @node Forecasting, , Budgeting, Budgeting and Forecasting @section Forecasting +@findex --forecast Sometimes it's useful to know what your finances will look like in the future, such as determining when an account will reach zero. Ledger @@ -7185,6 +7227,17 @@ Useful specifying a date in plain terms. For example, you could say @node Basics, Format String Structure, Format Strings, Format Strings @section Format String Basics +@findex --format +@findex -F +@findex --balance-report +@findex --cleared-report +@findex --register-report +@findex --csv-report +@findex --plot-amount-report +@findex --plot-total-report +@findex --pricedb-report +@findex --prices-report +@findex --wide-register-report Format strings may be used to change the output format of reports. They are specified by passing a formatting string to the @@ -7344,6 +7397,8 @@ same format string is used for all postings. @node --balance-format, Formatting codes, Format Expressions, Format Strings @section --balance-format +@findex --balance-format +@findex --format As an example of how flexible the @code{--format} strings can be, the default balance format looks like this (the various functions are @@ -7427,6 +7482,7 @@ terminal character colors and font highlights in a normal TTY session. @node Dates, Date and Time Format Codes, Quantities and Calculations, Formatting codes @subsection Date Functions +@findex --now The following functions allow you to manipulate and format dates. -- cgit v1.2.3 From 5c82a7ece2da159610dcf24bb1699fe95af098c6 Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 28 Apr 2013 10:13:28 +0200 Subject: M-x texinfo-all-menus-update --- doc/ledger3.texi | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index ec6c8682..21268c8c 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -4334,7 +4334,18 @@ least) in which these can be included: The first two are described in more detail in this short tutorial. -@node Embedded Ledger example with single source block, , Org mode with Babel, Org mode with Babel +@menu +* Embedded Ledger example with single source block:: +* Multiple Ledger source blocks with @command{noweb}:: +* Income Entries:: +* Expenses:: +* Financial Summaries:: +* An overall balance summary:: +* Generating a monthly register:: +* Summary:: +@end menu + +@node Embedded Ledger example with single source block, Multiple Ledger source blocks with @command{noweb}, Org mode with Babel, Org mode with Babel @subsubsection Embedded Ledger example with single source block The easiest, albeit possibly less useful, way in which to use Ledger @@ -4401,7 +4412,7 @@ financial state. Eventually, babel will support passing arguments to currently. Instead, we can use the concepts of literary programming, as implemented by the noweb features of babel, to help us. -@node Multiple Ledger source blocks with @command{noweb}, , Embedded Ledger example with single source block, Org mode with Babel +@node Multiple Ledger source blocks with @command{noweb}, Income Entries, Embedded Ledger example with single source block, Org mode with Babel @subsubsection Multiple Ledger source blocks with @command{noweb} The @command{noweb} feature of babel allows us to expand references to @@ -4412,7 +4423,7 @@ of transactions together to generate reports. Using the same transactions used above, we could consider splitting these into expenses and income, as follows: -@node Income Entries, , Multiple Ledger source blocks with @command{noweb}, Org mode with Babel +@node Income Entries, Expenses, Multiple Ledger source blocks with @command{noweb}, Org mode with Babel @subsubsection Income Entries The first set of entries relates to income, either monthly pay or @@ -4442,7 +4453,7 @@ have the :noweb yes babel header argument specified. #+end_src @end smallexample -@node Expenses, , Income Entries, Org mode with Babel +@node Expenses, Financial Summaries, Income Entries, Org mode with Babel @subsubsection Expenses The following entries relate to personal expenses, such as rent and @@ -4461,7 +4472,7 @@ have been done individually. #+end_src @end smallexample -@node Financial Summaries, , Expenses, Org mode with Babel +@node Financial Summaries, An overall balance summary, Expenses, Org mode with Babel @subsubsection Financial Summaries Given the ledger entries defined above in the income and expenses code @@ -4471,7 +4482,7 @@ to generate specific reports for those transactions. Below are two examples, one to generate a balance report and one to generate a register report of all transactions. -@node An overall balance summary, , Financial Summaries, Org mode with Babel +@node An overall balance summary, Generating a monthly register, Financial Summaries, Org mode with Babel @subsubsection An overall balance summary The overall balance of your account and expenditure with a breakdown @@ -4517,7 +4528,7 @@ in the report. : £-1300.00 starting balances @end smallexample -@node Generating a monthly register, , An overall balance summary, Org mode with Babel +@node Generating a monthly register, Summary, An overall balance summary, Org mode with Babel @subsubsection Generating a monthly register You can also generate a monthly register (the reg command) by -- cgit v1.2.3 From b5de3925c72dde071eb6562deaaed6a91f30d803 Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 28 Apr 2013 12:17:59 +0200 Subject: Moved syntax from "--option STR" to "--option @var{STR}". As such, this uses the Texinfo standard, and prints nicely in TeX output. Also, I did a consistency check (i.e., I renamed STRING to STR as example). Also, I deleted the option --wide-register-format and --wide-register-report, as I could not find them in the code. --- doc/ledger3.texi | 576 +++++++++++++++++++++++++++---------------------------- 1 file changed, 284 insertions(+), 292 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 21268c8c..40c2b7ae 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -874,7 +874,7 @@ P 2004/06/21 02:18:02 AAPL $32.91 P 2004/06/21 02:18:02 AU $400.00 @end smallexample -@findex --price-db FILE +@findex --price-db @var{FILE} @findex --market Specify the price history to use with the @code{--price-db} option, with the @code{-V (--market)} option to report in terms of current @@ -3790,7 +3790,7 @@ total; and report the balance for all accounts that begin with @subsection Reporting monthly expenses @findex --monthly @findex -M -@findex --display +@findex --display @var{EXPR} @findex --period-sort The following query makes it easy to see monthly expenses, with each @@ -3966,13 +3966,13 @@ tell Ledger what to do for the last line, in this case, nothing. @findex --total-data If you have @command{Gnuplot} installed, you can graph any of the -above register reports. The script to do this is included in the -ledger distribution, and is named @file{contrib/report}. Install +above register reports. The script to do this is included in the +ledger distribution, and is named @file{contrib/report}. Install @file{report} anywhere along your @env{PATH}, and then use @command{report} instead of @command{ledger} when doing a register -report. The only thing to keep in mind is that you must specify +report. The only thing to keep in mind is that you must specify @code{-j (--amount-data)} or @code{-J (--total-data)} to indicate -whether Gnuplot should plot the amount, or the running total. For +whether Gnuplot should plot the amount, or the running total. For example, this command plots total monthly expenses made on your MasterCard. @@ -4119,7 +4119,7 @@ limiting and searching functions. @cindex reading csv @cindex comma separated variable file reading @findex convert -@findex --input-date-format +@findex --input-date-format @var{DATE_FORMAT} The @code{convert} command parses a comma separated value (csv) file and outputs Ledger transactions. Many banks offer csv file downloads. @@ -4189,17 +4189,17 @@ Ledger will include @code{; transid: 767718} in the first transaction is from the file above. @findex --invert -@findex --account NAME +@findex --account @var{NAME} @findex --rich-data The @code{convert} command accepts three options, the most important ones are @code{--invert} which inverts the amount field, and -@code{--account NAME} which you can use to specify the account to +@code{--account @var{NAME}} which you can use to specify the account to balance against and @code{--rich-data}. When using the rich-data switch additional metadata is stored as tags. There is, for example, a UUID field. If an entry with the same UUID tag is already included -in the normal ledger file (specified via @code{-f} or -@code{$LEDGER_FILE}) this entry will not be printed again. +in the normal ledger file (specified via @code{-f} or via environment +variable @env{LEDGER_FILE}) this entry will not be printed again. You can also use @code{convert} with @code{payee} and @code{account} directives. First, you can use the @code{payee} and @code{alias} @@ -4980,21 +4980,21 @@ Print summary of all options @itemx -v Print version of ledger executable -@item --file FILE -@itemx -f FILE +@item --file @var{FILE} +@itemx -f @var{FILE} Read @file{FILE} as a ledger file -@item --output FILE -@itemx -o FILE +@item --output @var{FILE} +@itemx -o @var{FILE} Redirect output to @file{FILE} -@item --init-file FILE -@itemx -i FILE +@item --init-file @var{FILE} +@itemx -i @var{FILE} Specify options file -@item --account NAME -@itemx -a NAME -Specify default account name for QIF file postings +@item --account @var{NAME} +@itemx -a @var{NAME} +Specify default account @var{NAME} for QIF file postings @end ftable @node Report Filtering Quick Reference, Error Checking and Calculation Options, Basic Options Quick Reference, Command Line Quick Reference @@ -5004,15 +5004,15 @@ Specify default account name for QIF file postings @item --current @itemx -c Display transaction on or before the current date -@item --begin DATE -@itemx -b DATE -Begin reports on or after @code{DATE} -@item --end DATE -@itemx -e DATE +@item --begin @var{DATE} +@itemx -b @var{DATE} +Begin reports on or after @var{DATE} +@item --end @var{DATE} +@itemx -e @var{DATE} Limit end date of transactions for report -@item --period -@itemx -p STR -Set report period to STR +@item --period @var{STR} +@itemx -p @var{STR} +Set report period to @var{STR} @item --period-sort Sort postings within each period @item --cleared @@ -5040,16 +5040,16 @@ Show un-budgeted postings Show only un-budgeted postings @item --forecast Project balances into the future -@item --limit EXPR -@itemx -l EXPR +@item --limit @var{EXPR} +@itemx -l @var{EXPR} Limit postings in calculations -@item --amount -@itemx -t EXPR -Change value expression reported in register report -@item --total -@itemx -T EXPR -Change the value expression used for ``totals'' column in register and -balance reports +@item --amount @var{EXPR} +@itemx -t @var{EXPR} +Change value expression reported in @command{register} report +@item --total @var{VEXPR} +@itemx -T @var{VEXPR} +Change the value expression used for ``totals'' column in +@command{register} and @command{balance} reports @end ftable @node Error Checking and Calculation Options, Output Customization Quick Reference, Report Filtering Quick Reference, Command Line Quick Reference @@ -5090,18 +5090,18 @@ Report posting totals by week Report posting totals by year @item --dow Report Posting totals by day of week -@item --sort EXPR -@itemx -S EXPR -Sort a report using @code{EXPR} +@item --sort @var{VEXPR} +@itemx -S @var{VEXPR} +Sort a report using @var{VEXPR} @item --wide @itemx -w Assume 132 columns instead of 80 -@item --head N -Report the first N postings -@item --tail N -Report the last N postings -@item --pager PATH -Direct output to @code{PATH} pager program +@item --head @var{INT} +Report the first @var{INT} postings +@item --tail @var{INT} +Report the last @var{INT} postings +@item --pager @var{FILE} +Direct output to @var{FILE} pager program @item --average @itemx -A Report average posting value @@ -5113,31 +5113,31 @@ Report each posting deviation from the average Show subtotals in the balance report as percentages @c @item --totals @c Include running total in the @code{xml} report -@item --pivot TAG -Produce a pivot table of the tag type specified +@item --pivot @var{TAG} +Produce a pivot table of the @var{TAG} type specified @item --amount-data @itemx -j Show only date and value column to format the output for plots -@item --plot-amount-format STR +@item --plot-amount-format @var{STR} Specify the format for the plot output @item --total-data @itemx -J Show only dates and totals to format the output for plots -@item --plot-total-format STR +@item --plot-total-format @var{STR} Specify the format for the plot output -@item --display EXPR -@itemx -d EXPR -Display only posting that meet the criterias in the EXPR -@item --date-format STR -@itemx -y STR +@item --display @var{EXPR} +@itemx -d @var{EXPR} +Display only posting that meet the criterias in the @var{EXPR} +@item --date-format @var{STR} +@itemx -y @var{STR} Change the basic date format used in reports -@item --format STR -@itemx --balance-format STR -@itemx --register-format STR -@itemx --prices-format STR -@itemx -F STR +@item --format @var{STR} +@itemx --balance-format @var{STR} +@itemx --register-format @var{STR} +@itemx --prices-format @var{STR} +@itemx -F @var{STR} Set reporting format -@item --wide-register-format STR +@item --wide @itemx -w Wide @item --anon @@ -5176,28 +5176,28 @@ Group posting together, similar to balance report @subsection Commodity Reporting @ftable @code -@item --price-db FILE -Use @file{FILE} for retrieving stored commodity prices -@item --price-exp MINS -@itemx -L MINS -Set expected freshness of prices in minutes +@item --price-db @var{FILE} +Use @file{FILE} for retrieving stored commodity prices. +@item --price-exp @var{INT} +@itemx -L @var{INT} +Set expected freshness of prices in @var{INT} minutes. @item --download @itemx -Q -Download quotes using @code{getquote} -@item --getquote +Download quotes using named @file{getquote}. +@item --getquote @var{FILE} Sets path to a user defined script to download commodity prices. @item --quantity @itemx -O -Report commodity totals without conversion +Report commodity totals without conversion. @item --basis @itemx -B -Report cost basis +Report cost basis. @item --market @itemx -V -Report last known market value +Report last known market value. @item --gain @itemx -G -Report net gain loss for commodities that have a price history +Report net gain loss for commodities that have a price history. @end ftable @node Detailed Options Description, Period Expressions, Command Line Quick Reference, Command-line Syntax @@ -5234,7 +5234,7 @@ database. @item --help Display the info page for ledger. -@item --init-file +@item --init-file @var{FILE} Specify the location of the init file. The default is @file{~/.ledgerrc} @item --options @@ -5277,7 +5277,7 @@ with a @code{$}, the source was an environment variable. If the source is @code{?normalize} the value was set internally by ledger, in a function called @code{normalize_options}. -@item --script +@item --script @var{FILE} Execute a ledger script. @end ftable @@ -5298,18 +5298,18 @@ decimal separator, vice a period. @item --download Direct Ledger to download prices using the script defined in -@code{--getquote}. +@code{--getquote @var{FILE}}. -@item --file -Specify the input file path for this invocation. +@item --file @var{FILE} +Specify the input @file{FILE} for this invocation. -@item --getquote +@item --getquote @var{FILE} @cindex getquote @cindex download prices Tell ledger where to find the user defined script to download prices information. -@item --input-date-format +@item --input-date-format @var{DATE_FORMAT} Specify the input date format for journal entries. For example, @smallexample @@ -5320,7 +5320,7 @@ Would convert the @file{Export.csv} file to ledger format, assuming the dates in the CSV file are like 12/23/2009 (@pxref{Date and Time Format Codes}). -@item --master-account +@item --master-account @var{STR} Prepend all account names with the argument. @smallexample @@ -5347,15 +5347,15 @@ $ ledger -f test/input/drewr3.dat bal --master-account HUMBUG $ 200.00 Mortgage:Principal @end smallexample -@item --price-db FILE +@item --price-db @var{FILE} Specify the location of the price entry data file. -@item --price-exp INTEGER_MINUTES -Set the expected freshness of price quotes, in minutes. That is, if -the last known quote for any commodity is older than this value, and -if @code{--download} is being used, then the Internet will be -consulted again for a newer price. Otherwise, the old price is still -considered to be fresh enough. +@item --price-exp @var{INT} +Set the expected freshness of price quotes, in @var{INT} minutes. That +is, if the last known quote for any commodity is older than this +value, and if @code{--download} is being used, then the Internet will +be consulted again for a newer price. Otherwise, the old price is +still considered to be fresh enough. @item --strict Ledger normally silently accepts any account or commodity in @@ -5378,59 +5378,57 @@ instance of Ledger running in the background and running multiple sessions with multiple reports per session. @ftable @code -@item --abbrev-len -Set the minimum -length an account can be abbreviated to if it doesn't fit inside the -@code{account-width}. If @code{abbrev-len} is zero, then the account -name will be truncated on the right. If @code{abbrev-len} is greater +@item --abbrev-len @var{INT} +Set the minimum length an account can be abbreviated to if it doesn't +fit inside the @code{account-width}. If @var{INT} is zero, then the +account name will be truncated on the right. If @var{INT} is greater than @code{account-width} then the account will be truncated on the left, with no shortening of the account names in order to fit into the desired width. -@item --account -Prepend @code{} to all accounts reported. That is, the option +@item --account @var{STR} +Prepend @var{STR} to all accounts reported. That is, the option @code{--account Personal} would tack @code{Personal:} to the beginning of every account reported in a balance report or register report. -@item --account-width -Set the width of the account column in -the @code{register} report to @code{N} characters. +@item --account-width @var{INT} +Set the width of the account column in the @command{register} report +to @code{INT} characters. @item --actual-dates -Show actual dates of transactions -(@pxref{Effective Dates}). Also @code{-L}. +Show actual dates of transactions (@pxref{Effective Dates}). Also +@code{-L}. @item --actual -Report only real transactions, with no automated or -virtual transactions used. +Report only real transactions, with no automated or virtual +transactions used. @item --add-budget Show only un-budgeted postings. @item --amount-data -On a register report print only the dates and -amount of postings. Useful for graphing and spreadsheet applications. +On a register report print only the dates and amount of postings. +Useful for graphing and spreadsheet applications. -@item --amount -Apply the given value expression to the posting -amount (@pxref{Value Expressions}). Using @code{--amount} you can apply -an arbitrary transformation to the postings. +@item --amount @var{EXPR} +Apply the given value expression to the posting amount (@pxref{Value +Expressions}). Using @code{--amount} you can apply an arbitrary +transformation to the postings. -@item --amount-width -Set the width in characters of the amount -column in the register report. +@item --amount-width @var{INT} +Set the width in characters of the amount column in the +@command{register} report. @item --anon -Anonymize registry output, mostly for sending in bug -reports. +Anonymize registry output, mostly for sending in bug reports. @item --average -Print average values over the number of transactions -instead of running totals. +Print average values over the number of transactions instead of +running totals. -@item --balance-format -Specify the format to use for the -@code{balance} report (@pxref{Format Strings}). The default is: +@item --balance-format @var{STR} +Specify the format to use for the @code{balance} report (@pxref{Format +Strings}). The default is: @smallexample "%(justify(scrub(display_total), 20, -1, true, color))" @@ -5446,13 +5444,13 @@ ASK JOHN @item --basis Report the cost basis on all posting -@item --begin -Specify the start date of all calculations. -Transactions before that date will be ignored. +@item --begin @var{DATE} +Specify the start @var{DATE} of all calculations. Transactions before +that date will be ignored. -@item --bold-if -Print the entire line in bold if the given -value expression is true (@pxref{Value Expressions}). +@item --bold-if @var{EXPR} +Print the entire line in bold if the given value expression is true +(@pxref{Value Expressions}). @smallexample $ ledger reg Expenses --begin Dec --bold-if "amount > 100" @@ -5462,7 +5460,7 @@ $ ledger reg Expenses --begin Dec --bold-if "amount > 100" list all transactions since the beginning of December and bold any posting greater than $100 -@item --budget-format +@item --budget-format @var{FORMAT_STRING} Specify the format to use for the @code{budget} report (@pxref{Format Strings}). The default is: @@ -5479,12 +5477,12 @@ Only display budgeted items. In a register report this displays transaction in the budget, in a balance report this displays accounts in the budget (@pxref{Budgeting and Forecasting}). -@item --by-payee +@item --by-payee Group the register report by payee. -@item --cleared-format -Specify the format to use -for the @code{cleared} report (@pxref{Format Strings}). The default is: +@item --cleared-format @var{FORMAT_STRING} +Specify the format to use for the @code{cleared} report (@pxref{Format +Strings}). The default is: @smallexample "%(justify(scrub(get_at(total_expr, 0)), 16, 16 + prepend_width, " @@ -5514,9 +5512,8 @@ a zero balance. @item --color Use color is the tty supports it. -@item --columns -Specify the width of the register report in -characters. +@item --columns @var{INT} +Specify the width of the @command{register} report in characters. @item --count Direct ledger to report the number of items when @@ -5543,17 +5540,16 @@ Shorthand for @code{--limit "date <= today"} @item --daily Shorthand for @code{--period "daily"} -@item --date-format -Specify format ledger should use -to print dates (@pxref{Date and Time Format Codes}). +@item --date-format @var{DATE_FORMAT} +Specify format ledger should use to print dates (@pxref{Date and Time +Format Codes}). -@item --date -Transform the date of the transaction using -@code{EXPR} +@item --date @var{EXPR} +Transform the date of the transaction using @var{EXPR}. -@item --date-width -Specify the width, in characters, of the -date column in the register report. +@item --date-width @var{INT} +Specify the width, in characters, of the date column in the +@command{register} report. @item --datetime-format ASK JOHN @@ -5616,7 +5612,7 @@ And with @code{--dc} it becomes this: $145 $145 0 @end smallexample -@item --depth +@item --depth @var{INT} Limit the depth of the account tree. In a balance report, for example, a @code{--depth 2} statement will print balances only for account with two levels, i.e. @code{Expenses:Entertainment} but not @@ -5627,14 +5623,14 @@ which means it only affects display, not the total calculations. Report each posting’s deviation from the average. It is only meaningful in the register and prices reports. -@item --display-amount +@item --display-amount @var{EXPR} Apply a transform to the @emph{displayed} amount. This occurs after calculations occur. -@item --display +@item --display @var{BOOLEAN_EXPR} Display lines that satisfy the expression given. -@item --display-total +@item --display-total @var{EXPR} Apply a transform to the @emph{displayed} total. This occurs after calculations occur. @@ -5654,8 +5650,9 @@ Use effective dates for all calculations (@pxref{Effective Dates}). @item --empty Include empty accounts in the report. -@item --end -Specify the end date for transaction to be considered in the report. +@item --end @var{DATE} +Specify the end @var{DATE} for transaction to be considered in the +report. @item --equity Related to the @code{equity} command (@pxref{The @@ -5665,29 +5662,29 @@ register report. @item --exact ASK JOHN -@item --exchange -Display values in terms of the given -commodity. The latest available price is used. +@item --exchange @var{COMMODITY} +@itemx -X @var{COMMODITY} +Display values in terms of the given @var{COMMODITY}. The latest +available price is used. @item --flat -Force the full names of accounts to be used in the -balance report. The balance report will not use an indented tree. +Force the full names of accounts to be used in the balance report. The +balance report will not use an indented tree. @item --force-color -Output tty color codes even if the tty doesn't -support them. Useful for TTY that don't advertise their capabilities -correctly. +Output tty color codes even if the tty doesn't support them. Useful +for TTY that don't advertise their capabilities correctly. @item --force-pager Force Ledger to paginate its output. -@item --forecast-while -Continue forecasting while @code{} is true. +@item --forecast-while @var{VEXPR} +Continue forecasting while @var{VEXPR} is true. -@item --forecast-years -Forecast at most @code{N} years in the future. +@item --forecast-years @var{INT} +Forecast at most @var{INT} years in the future. -@item --format +@item --format @var{FORMAT_STRING} Use the given format string to print output. @item --gain @@ -5698,11 +5695,10 @@ Include auto-generated postings (such as those from automated transactions) in the report, in cases where you normally wouldn't want them. -@item --group-by -Group transaction together in the register -report. @code{EXPR} can be anything, although most common would be -@code{payee} or @code{commodity}. The @code{tags()} function is -also useful here. +@item --group-by @var{EXPR} +Group transaction together in the @command{register} report. +@var{EXPR} can be anything, although most common would be @code{payee} +or @code{commodity}. The @code{tags()} function is also useful here. @item --group-title-format Set the format for the headers that separate reports section of @@ -5722,8 +5718,8 @@ $ ledger reg Expenses --group-by "payee" --group-title-format "----------------- ... @end smallexample -@item --head -Print the first @code{INT} entries. Opposite of @code{--tail}. +@item --head @var{INT} +Print the first @var{INT} entries. Opposite of @code{--tail}. @item --inject Use @code{Expected} amounts in calculations. In the case that you know @@ -5742,7 +5738,7 @@ treat the transaction as if the ``Expected Value'' was actual. @item --invert Change the sign of all reported values. -@item --limit +@item --limit @var{EXPR} Only transactions that satisfy the expression will be considered in the calculation. @@ -5767,11 +5763,11 @@ a balance report. @item --market Use the latest market value for all commodities. -@item --meta +@item --meta @var{TAG} In the register report, prepend the transaction with the value of the -given tag. +given @var{TAG}. -@item --meta-width +@item --meta-width @var{INT} Specify the width of the Meta column used for the @code{--meta} options. @@ -5800,18 +5796,18 @@ future using @code{--current} This is a postings predicate that applies after certain transforms have been executed, such as periodic gathering. -@item --output -Redirect the output of ledger to the file defined in @file{PATH}. +@item --output @var{FILE} +Redirect the output of ledger to the file defined in @file{FILE}. -@item --pager +@item --pager @var{FILE} Specify the pager program to use. -@item --payee -Sets a value expression for formatting the payee. In the register -report this prevents the second entry from having a date and payee for -each transaction +@item --payee @var{VEXPR} +Sets a value expression for formatting the payee. In the +@command{register} report this prevents the second entry from having +a date and payee for each transaction. -@item --payee-width N +@item --payee-width @var{INT} Set the number of columns dedicated to the payee in the register report. @@ -5822,16 +5818,16 @@ Use only postings that are marked pending Calculate the percentage value of each account in a balance reports. Only works for account that have a single commodity. -@item --period -Define a period expression the sets the time period during which -transactions are to be accounted. For a register report only the -transactions that satisfy the period expression with be displayed. For -a balance report only those transactions will be accounted in the final -balances. +@item --period @var{PERIOD_EXPRESSION} +Define a period expression that sets the time period during which +transactions are to be accounted. For a @command{register} report only +the transactions that satisfy the period expression with be displayed. +For a balance report only those transactions will be accounted in the +final balances. -@item --pivot -Produce a balance pivot report ``around'' the given tag. For example, -if you have multiple cars and track each fuel purchase in +@item --pivot @var{TAG} +Produce a balance pivot report ``around'' the given @var{TAG}. For +example, if you have multiple cars and track each fuel purchase in @code{Expenses:Auto:Fuel} and tag each fuel purchase with a tag identifying which car the purchase was for @code{; Car: Prius}, then the command: @@ -5850,22 +5846,22 @@ $ ledger bal Fuel --pivot "Car" --period "this year" @xref{Metadata values}. -@item --plot-amount-format +@item --plot-amount-format @var{STR} Define the output format for an amount data plot. @xref{Visualizing with Gnuplot}. -@item --plot-total-format +@item --plot-total-format @var{STR} Define the output format for a total data plot. @xref{Visualizing with Gnuplot}. -@item --prepend-format STR -Prepend STR to every line of the output +@item --prepend-format @var{STR} +Prepend @var{STR} to every line of the output -@item --prepend-width N -Reserve @code{N} spaces at the beginning of each line of the output +@item --prepend-width @var{INT} +Reserve @var{INT} spaces at the beginning of each line of the output. @item --price -Use the price of the commodity purchase for performing calculations +Use the price of the commodity purchase for performing calculations. @item --quantity FIX THIS ENTRY @@ -5907,13 +5903,13 @@ development testing. @item --sort-all FIX THIS ENTRY -@item --sort -Sort the register report based on the value expression given to sort +@item --sort @var{VEXPR} +Sort the register report based on the value expression given to sort. -@item --sort-xacts -Sort the posting within transactions using the given value expression +@item --sort-xacts @var{VEXPR} +Sort the posting within transactions using the given value expression. -@item --start-of-week +@item --start-of-week @var{INT} Tell ledger to use a particular day of the week to start its ``weekly'' summary. @code{--start-of-week=1} specifies Monday as the start of the week. @@ -5921,17 +5917,17 @@ week. @item --subtotal FIX THIS ENTRY -@item --tail -Report only the last @code{INT} entries. Only useful on a register +@item --tail @var{INT} +Report only the last @var{INT} entries. Only useful on a register report. @item --total-data FIX THIS ENTRY -@item --total +@item --total @var{VEXPR} Define a value expression used to calculate the total in reports. -@item --total-width +@item --total-width @var{INT} Set the width of the total field in the register report. @item --truncate @@ -5992,20 +5988,20 @@ Print the current version of ledger and exits. This is useful for sending bug reports, to let the author know which version of ledger you are using. -@item --file FILE -@itemx -f FILE -Read FILE as a ledger file. This command may be used multiple times. -Typically, the environment variable @env{LEDGER_FILE} is set, rather -than using this command-line option. +@item --file @var{FILE} +@itemx -f @var{FILE} +Read @file{FILE} as a ledger file. This command may be used multiple +times. Typically, the environment variable @env{LEDGER_FILE} is set, +rather than using this command-line option. -@item --output FILE -@itemx -o FILE -Redirect output from any command to @var{FILE}. By default, all output +@item --output @var{FILE} +@itemx -o @var{FILE} +Redirect output from any command to @file{FILE}. By default, all output goes to standard output. -@item --init-file FILE -@itemx -i FILE -Causes @code{FILE} to be read by ledger before any other ledger file. +@item --init-file @var{FILE} +@itemx -i @var{FILE} +Causes @file{FILE} to be read by ledger before any other ledger file. This file may not contain any postings, but it may contain option settings. To specify options in the init file, use the same syntax as the command-line, but put each option on its own line. Here is an @@ -6020,8 +6016,8 @@ example init file: Option settings on the command-line or in the environment always take precedence over settings in the init file. -@item --account NAME -@itemx -a NAME +@item --account @var{NAME} +@itemx -a @var{NAME} Specify the default account which QIF file postings are assumed to relate to. @end ftable @@ -6037,21 +6033,21 @@ report, in ways other than just using regular expressions: @itemx -c Display only transactions occurring on or before the current date. -@item --begin DATE -@itemx -b DATE +@item --begin @var{DATE} +@itemx -b @var{DATE} Constrain the report to transactions on or after @var{DATE}. Only transactions after that date will be calculated, which means that the running total in the balance report will always start at zero with the first matching transaction. (Note: This is different from using @code{--display} to constrain what is displayed). -@item --end DATE -@itemx -e DATE +@item --end @var{DATE} +@itemx -e @var{DATE} Constrain the report so that transactions on or after @var{DATE} are not considered. The ending date is inclusive. -@item --period STR -@itemx -p STR +@item --period @var{STR} +@itemx -p @var{STR} Set the reporting period to @var{STR}. This will subtotal all matching transactions within each period separately, making it easy to see weekly, monthly, quarterly, etc., posting totals. A period string can @@ -6059,7 +6055,7 @@ even specify the beginning and end of the report range, using simple terms like ``last June'' or ``next month''. For more using period expressions, see @ref{Period Expressions}. -@item --period-sort EXPR +@item --period-sort @var{EXPR} Sort the postings within each reporting period using the value expression @var{EXPR}. This is most often useful when reporting monthly expenses, in order to view the highest expense categories at @@ -6127,19 +6123,19 @@ Useful for displaying how close your postings meet your budget. option that projects your budget into the future, showing how it will affect future balances. @xref{Budgeting and Forecasting}. -@item --limit EXPR -@itemx -l EXPR +@item --limit @var{EXPR} +@itemx -l @var{EXPR} Limit which postings take part in the calculations of a report. -@item --amount EXPR -@itemx -t EXPR +@item --amount @var{EXPR} +@itemx -t @var{EXPR} Change the value expression used to calculate the ``value'' column in the @command{register} report, the amount used to calculate account totals in the @command{balance} report, and the values printed in the @command{equity} report. @xref{Value Expressions}. -@item --total EXPR -@itemx -T EXPR +@item --total @var{VEXPR} +@itemx -T @var{VEXPR} Set the value expression used for the ``totals'' column in the @command{register} and @command{balance} reports. @end ftable @@ -6227,40 +6223,40 @@ Report posting totals by month; @itemx -Y Report posting totals by year. For more complex period, using the -@item --period +@item --period @var{STR} Option described above. @item --dow Report postings totals for each day of the week. This is an easy way to see if weekend spending is more than on weekdays. -@item --sort EXPR -@itemx -S EXPR +@item --sort @var{VEXPR} +@itemx -S @var{VEXPR} Sort a report by comparing the values determined using the value -expression @var{EXPR}. For example, using @code{-S -UT} in the +expression @var{VEXPR}. For example, using @code{-S -UT} in the balance report will sort account balances from greatest to least, using the absolute value of the total. For more on how to use value expressions, see @ref{Value Expressions}. -@item --pivot TAG -Produce a pivot table around the tag provided. This requires meta data -using valued tags. +@item --pivot @var{TAG} +Produce a pivot table around the @var{TAG} provided. This requires +meta data using valued tags. @item --wide @itemx -w Cause the default @command{register} report to assume 132 columns instead of 80. -@item --head -Cause only the first @code{N} transactions to be printed. This is +@item --head @var{INT} +Cause only the first @var{INT} transactions to be printed. This is different from using the command-line utility @command{head}, which -would limit to the first N postings. @code{--tail} outputs only the -last @code{N} transactions. Both options may be used simultaneously. -If a negative amount is given, it will invert the meaning of the flag -(instead of the first five transactions being printed, for example, it -would print all but the first five). +would limit to the first @var{INT} postings. @code{--tail} outputs +only the last @var{INT} transactions. Both options may be used +simultaneously. If a negative amount is given, it will invert the +meaning of the flag (instead of the first five transactions being +printed, for example, it would print all but the first five). -@item --pager +@item --pager @var{FILE} Tell Ledger to pass its output to the given pager program; very useful when the output is especially long. This behavior can be made the default by setting the @env{LEDGER_PAGER} environment variable. @@ -6295,8 +6291,8 @@ etc. Change the @command{register} report so that it outputs nothing but the date and totals column, without commodities. -@item --display EXPR -@itemx -d EXPR +@item --display @var{EXPR} +@itemx -d @var{EXPR} Limit which postings or accounts or actually displayed in a report. They might still be calculated, and be part of the running total of a register report, for example, but they will not be displayed. This is @@ -6319,8 +6315,8 @@ Which is more useful depends on what you're looking to know: the total amount for the reporting range (@code{-p}), or simply a display restricted to the reporting range (using @code{-d}). -@item --date-format STR -@itemx -y STR +@item --date-format @var{STR} +@itemx -y @var{STR} Change the basic date format used by reports. The default uses a date like @code{2004/08/01}, which represents the default date format of @code{%Y/%m/%d}. To change the way dates are printed in general, the @@ -6328,13 +6324,13 @@ easiest way is to put @code{--date-format FORMAT} in the Ledger initialization file @file{~/.ledgerrc} (or the file referred to by @env{LEDGER_INIT}). -@item --format STR -@itemx -F STR +@item --format @var{STR} +@itemx -F @var{STR} Set the reporting format for whatever report ledger is about to make. @xref{Format Strings}. There are also specific format commands for each report type: -@item --balance-format STR +@item --balance-format @var{STR} Define the output format for the @code{balance} report. The default (defined in @code{report.h} is: @@ -6352,7 +6348,7 @@ Define the output format for the @code{balance} report. The default --------------------\n" @end smallexample -@item --cleared-format +@item --cleared-format @var{FORMAT_STRING} Define the format for the cleared report. The default is: @smallexample @@ -6367,7 +6363,7 @@ Define the format for the cleared report. The default is: ---------------- ---------------- ---------\n" @end smallexample -@item --register-format STR +@item --register-format @var{STR} Define the output format for the @code{register} report. The default (defined in @code{report.h} is: @@ -6419,7 +6415,7 @@ Set the format for @code{csv} reports. The default is: %(quoted(join(note | xact.note)))\n" @end smallexample -@item --plot-amount-format STR +@item --plot-amount-format @var{STR} Set the format for amount plots, using the @code{-j} option. The default is: @@ -6427,7 +6423,7 @@ default is: "%(format_date(date, \"%Y-%m-%d\")) %(quantity(scrub(display_amount)))\n" @end smallexample -@item --plot-total-format STR +@item --plot-total-format @var{STR} Set the format for total plots, using the @code{-J} option. The default is: @@ -6435,23 +6431,20 @@ default is: "%(format_date(date, \"%Y-%m-%d\")) %(quantity(scrub(display_total)))\n" @end smallexample -@item --pricedb-format STR +@item --pricedb-format @var{STR} Set the format expected for the historical price file. The default is @smallexample "P %(datetime) %(display_account) %(scrub(display_amount))\n" @end smallexample -@item --prices-format STR +@item --prices-format @var{STR} Set the format for the @command{prices} report. The default is: @smallexample "%(date) %-8(display_account) %(justify(scrub(display_amount), 12, 2 + 9 + 8 + 12, true, color))\n" @end smallexample - -@item --wide-register-format STR -(-w @command{register}) @end ftable @node Commodity Reporting, Environment Variables, Output Customization, Detailed Options Description @@ -6460,7 +6453,7 @@ Set the format for the @command{prices} report. The default is: These options affect how commodity values are displayed: @ftable @code -@item --price-db FILE +@item --price-db @var{FILE} Set the file that is used for recording downloaded commodity prices. It is always read on startup, to determine historical prices. Other settings can be placed in this file manually, to prevent downloading @@ -6481,13 +6474,13 @@ download script maintain this file. The format of the file can be changed by telling ledger to use the @code{--pricedb-format} you define. -@item --price-exp MINS -@itemx -L MINS -Set the expected freshness of price quotes, in minutes. That is, if -the last known quote for any commodity is older than this value, and if -@code{--download} is being used, then the Internet will be consulted -again for a newer price. Otherwise, the old price is still considered -to be fresh enough. +@item --price-exp @var{INT} +@itemx -L @var{INT} +Set the expected freshness of price quotes, in @var{INT} minutes. That +is, if the last known quote for any commodity is older than this +value, and if @code{--download} is being used, then the Internet will +be consulted again for a newer price. Otherwise, the old price is +still considered to be fresh enough. @item --download @itemx -Q @@ -6535,11 +6528,12 @@ etc. @findex --now -When you specify @code{-V}, or @code{-X COMM}, you are requesting that -some or all of the commodities be valuated as of today (or whatever -@code{--now} is set to). But what does such a valuation mean? This -meaning is governed by the presence of a @code{VALUE} meta-data -property, whose content is an expression used to compute that value. +When you specify @code{-V}, or @code{-X @var{COMMODITY}}, you are +requesting that some or all of the commodities be valuated as of today +(or whatever @code{--now} is set to). But what does such a valuation +mean? This meaning is governed by the presence of a @code{VALUE} +meta-data property, whose content is an expression used to compute +that value. If no VALUE property is specified, each posting is assumed to have a default, as if you'd specified a global, automated transaction as @@ -6639,7 +6633,7 @@ also balance against itself, and against any AAPL if @code{--lots} is not specified. But if you do specify @code{--lot-prices}, for example, then it will balance against that specific price for AAPL. -Normally when you use @code{-X } to request that amounts be +Normally when you use @code{-X @var{COMMODITY}} to request that amounts be reported in a specific commodity, Ledger uses these values: @itemize @@ -7238,8 +7232,8 @@ Useful specifying a date in plain terms. For example, you could say @node Basics, Format String Structure, Format Strings, Format Strings @section Format String Basics -@findex --format -@findex -F +@findex --format @var{STR} +@findex -F @var{STR} @findex --balance-report @findex --cleared-report @findex --register-report @@ -7248,18 +7242,17 @@ Useful specifying a date in plain terms. For example, you could say @findex --plot-total-report @findex --pricedb-report @findex --prices-report -@findex --wide-register-report Format strings may be used to change the output format of reports. -They are specified by passing a formatting string to the -@code{--format} (@code{-F}) option. Within that string, constructs -are allowed which make it possible to display the various parts of an -account or posting in custom ways. +They are specified by passing a formatting string to the @code{-F +(--format)} option. Within that string, constructs are allowed which +make it possible to display the various parts of an account or posting +in custom ways. There are several additional flags that allow you to define formats -for specific reports. These are useful to define in your -configuration file and will allow you to run ledger reports from the -command line without having to enter a new format for each command. +for specific reports. These are useful to define in your configuration +file and will allow you to run ledger reports from the command line +without having to enter a new format for each command. @itemize @item @code{--balance-report} @@ -7270,7 +7263,6 @@ command line without having to enter a new format for each command. @item @code{--plot-total-report} @item @code{--pricedb-report} @item @code{--prices-report} -@item @code{--wide-register-report} @end itemize @node Format String Structure, Format Expressions, Basics, Format Strings @@ -7408,8 +7400,8 @@ same format string is used for all postings. @node --balance-format, Formatting codes, Format Expressions, Format Strings @section --balance-format -@findex --balance-format -@findex --format +@findex --balance-format @var{STR} +@findex --format @var{STR} As an example of how flexible the @code{--format} strings can be, the default balance format looks like this (the various functions are @@ -7500,7 +7492,7 @@ The following functions allow you to manipulate and format dates. @table @code @item date Return the date of the current transaction -@item format_date(date, "FORMAT STRING") +@item format_date(date, "FORMAT_STRING") Format the date using the given format string. @item now Return the current date and time. If the @code{--now} option is @@ -8415,9 +8407,9 @@ Enable additional assertions during run-time. This causes a significant slowdown. When combined with @code{--debug} ledger will produce memory trace information. -@item --debug "argument" +@item --debug @var{CODE} If Ledger has been built with debug options this will provide extra -data during the run. The following are the available arguments to +data during the run. The following are the available @var{CODES} to debug: @multitable @columnfractions .32 .43 .27 @@ -8447,8 +8439,8 @@ debug: @item @code{expr.calc} @tab @code{option.names} @end multitable -@item --trace INTEGER_TRACE_LEVEL -Enable tracing. The integer specifies the level of trace desired: +@item --trace @var{INT} +Enable tracing. The @var{INT} specifies the level of trace desired: @multitable @columnfractions .3 .7 @item @code{LOG_OFF} @tab 0 -- cgit v1.2.3 From 1af84dcaa420fa98a6ad33a95f2d74e96ff7de6a Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 28 Apr 2013 14:11:54 +0200 Subject: Use @kbd instead of @code for keyboard shortcuts --- doc/ledger3.texi | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 40c2b7ae..09521901 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -4285,13 +4285,13 @@ line options. : £-1300.00 starting balances @end smallexample -Typing @command{C-c C-c} anywhere in the ``ledger source code block'' -will invoke ledger on the contents of that block and generate a -``results'' block. The results block can appear anywhere in the file -but, by default, will appear immediately below the source code block. +Typing @kbd{C-c C-c} anywhere in the ``ledger source code block'' will +invoke ledger on the contents of that block and generate a ``results'' +block. The results block can appear anywhere in the file but, by +default, will appear immediately below the source code block. -You can combine multiple source code blocks before executing ledger and -do all kinds of other wonderful things with Babel (and org). +You can combine multiple source code blocks before executing ledger +and do all kinds of other wonderful things with Babel (and org). @node Org mode with Babel, The pricemap Command, Emacs Org mode, Reports in other Formats @subsection Org mode with Babel @@ -4379,14 +4379,14 @@ entries. The following is an example source block: #+end_src @end smallexample -In this example, we have combined both expenses and income into one set -of Ledger entries. We can now generate register and balance reports (as -well as many other types of reports) using babel to invoke Ledger with -specific arguments. The arguments are passed to Ledger using the -:cmdline header argument. In the code block above, there is no such -argument so the system takes the default. For Ledger code blocks, the -default :cmdline argument is bal and the result of evaluating this code -block (@command{C-c C-c}) would be: +In this example, we have combined both expenses and income into one +set of Ledger entries. We can now generate register and balance +reports (as well as many other types of reports) using babel to invoke +Ledger with specific arguments. The arguments are passed to Ledger +using the :cmdline header argument. In the code block above, there is +no such argument so the system takes the default. For Ledger code +blocks, the default :cmdline argument is bal and the result of +evaluating this code block (@kbd{C-c C-c}) would be: @smallexample #+results: allinone() @@ -4487,7 +4487,7 @@ a register report of all transactions. The overall balance of your account and expenditure with a breakdown according to category is specified by passing the :cmdline bal -argument to Ledger. This code block can now be evaluated (@code{C-c +argument to Ledger. This code block can now be evaluated (@kbd{C-c C-c}) and the results generated by incorporating the transactions referred to by the @code{<>} and @code{<>} lines. -- cgit v1.2.3 From d1156f7a32082857f90e25130eb22eb50011f6d0 Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 28 Apr 2013 14:28:09 +0200 Subject: Use @samp for single characters as recommended in Texinfo manual (i.e. use @samp{$} instead of '$') --- doc/ledger3.texi | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 09521901..9ec1e51e 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -192,7 +192,7 @@ deal with multiple accounts. @cindex account, meaning of @cindex meaning of account -Here is a good place for an aside on the use of the word `account'. +Here is a good place for an aside on the use of the word ``account''. Most private people consider an account to be something that holds money at an institution for them. Ledger uses a more general definition of the word. An account is anywhere money can go. Other @@ -1395,7 +1395,7 @@ Expenses:Food:Hamburgers and Fries @section Commenting on your Journal @cindex comments, characters -Comments are generally started using a ';'. However, in order to +Comments are generally started using a @samp{;}. However, in order to increase compatibility with other text manipulation programs and methods four additional comment characters are valid if used at the beginning of a line: @code{#}, @code{|}, and @code{*} and @code{%}. @@ -1434,8 +1434,8 @@ There are several forms of comments within a transaction, for example: @noindent The first comment is global and Ledger will not attach it to any specific transactions. The comments within the transaction must all -start with `;'s and are preserved as part of the transaction. The -`:'s indicate meta-data and tags (@pxref{Metadata}). +start with @samp{;} and are preserved as part of the transaction. The +@samp{:} indicates meta-data and tags (@pxref{Metadata}). @node Currency and Commodities, Keeping it Consistent, Commenting on your journal, Keeping a Journal @section Currency and Commodities @@ -2241,7 +2241,7 @@ tag Receipt tag CSV @end smallexample -The 'tag' directive supports two optional sub-directives, if they +The @code{tag} directive supports two optional sub-directives, if they immediately follow the tag directive and if they begin with whitespace: @@ -3240,9 +3240,9 @@ The arguments passed to these functions have the following meaning: The source commodity string, or an amount object. If it is a string, the return value must be an amount representing the price of the commodity identified by that string (example: - ``$''). If it is an amount, return the value of that amount - as a new amount (usually calculated as commodity price times - source amount). + @samp{$}). If it is an amount, return the value of that + amount as a new amount (usually calculated as commodity price + times source amount). @item date The date to use for determining the value. If null, it means @@ -3905,11 +3905,11 @@ would look like: (Allocation:Bonds/Cash) 1.000 @end smallexample -How do these work? First the `=' sign at the beginning of the line -tells ledger this is an automatic transaction to be applied when the -condition following the `=' is true. After the `=' sign is a value -expression (@pxref{Value Expressions}) that returns true any time -a posting contains the commodity of interest. +How do these work? First the @samp{=} sign at the beginning of the +line tells ledger this is an automatic transaction to be applied when +the condition following the @samp{=} is true. After the @samp{=} sign +is a value expression (@pxref{Value Expressions}) that returns true +any time a posting contains the commodity of interest. The following line gives the proportions (not percentages) of each unit of commodity that belongs to each asset class. Whenever Ledger sees a @@ -3954,8 +3954,9 @@ third line is where we calculate and display the percentages. The for the account in this line. The @code{parent.total} command gives the total for the next level up in the tree. @code{percent} formats their ratio as a percentage. The fourth line tells ledger to display -the current market value of the line. The last two characters ``%/'' -tell Ledger what to do for the last line, in this case, nothing. +the current market value of the line. The last two characters +@samp{%/} tell Ledger what to do for the last line, in this case, +nothing. @node Visualizing with Gnuplot, , Asset Allocation, Advanced Reports @subsection Visualizing with Gnuplot @@ -6614,7 +6615,7 @@ valuated in another currency. For example: = /^Assets:Brokerage:CAD$/ ; Always report the value of commodities in this account in ; terms of present day dollars, despite what was asked for - ; on the command-line VALUE:: market(amount, date, '$') + ; on the command-line VALUE:: market(amount, date, @samp{$}) @end smallexample @cindex FIFO/LIFO @@ -6871,7 +6872,7 @@ This records a check-in to the given ACCOUNT, and a check-out. You can be checked-in to multiple accounts at a time, if you wish, and they can span multiple days (use @code{--day-break} to break them up in the report). The number of seconds between is accumulated as time -to that ACCOUNT. If the checkout uses a capital ``O'', the +to that ACCOUNT. If the checkout uses a capital @samp{O}, the transaction is marked ``cleared''. You can use an optional PAYEE for whatever meaning you like. @@ -6882,9 +6883,9 @@ information. Or you can use Org mode's time-clocking abilities and the org2tc script developed by John Wiegley. These timelog entries can appear in a separate file, or directly in -your main ledger file. The initial ``i'' and ``o'' count as Ledger -``directives'', and are accepted anywhere that ordinary transactions -are. +your main ledger file. The initial @samp{i} and @samp{o} count as +Ledger ``directives'', and are accepted anywhere that ordinary +transactions are. @node Value Expressions, Format Strings, Time Keeping, Top @chapter Value Expressions -- cgit v1.2.3 From b7437fe6091998c233a9f895923447db17658799 Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 28 Apr 2013 14:44:58 +0200 Subject: no space before and after '---' --- doc/ledger3.texi | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 9ec1e51e..512796b8 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -182,13 +182,13 @@ simply moved from one account to another in both cases. This is the basis of double-entry accounting: money never pops in or out of existence; it is always a posting from one account to another. -Keeping a general journal is the same as keeping two separate journals: -One for Pacific Bell and one for Checking. In that case, each time a -payment is written into one, you write a corresponding withdrawal into -the other. This makes it easier to write in a ``running balance'', -since you don't have to look back at the last time the account was -referenced---but it also means having a lot of journal books, if you -deal with multiple accounts. +Keeping a general journal is the same as keeping two separate +journals: One for Pacific Bell and one for Checking. In that case, +each time a payment is written into one, you write a corresponding +withdrawal into the other. This makes it easier to write in +a ``running balance'', since you don't have to look back at the last +time the account was referenced---but it also means having a lot of +journal books, if you deal with multiple accounts. @cindex account, meaning of @cindex meaning of account @@ -626,8 +626,8 @@ it: Liabilities:MasterCard @end smallexample -The Dining account balance now shows $25 spent on Dining, and a -corresponding $25 owed on the MasterCard---and therefore shown as +The Dining account balance now shows $25 spent on Dining, and +a corresponding $25 owed on the MasterCard---and therefore shown as $-25.00. The MasterCard liability shows up as negative because it offsets the value of your assets. @@ -1134,7 +1134,7 @@ Savings? Traditional finance packages require that the money reside in only one place. But there are really two ``views'' of the data: from the -account point of view and from the fund point of view --- yet both sets +account point of view and from the fund point of view---yet both sets should reflect the same overall expenses and cash flow. It's simply where the money resides that differs. @@ -1575,7 +1575,7 @@ can fix the per-unit price of a commodity. For example, say you buy 10 gallons of gas at $1.20. In future ``value'' reports, you don't want these gallons reported in terms of today's price, but rather the price when you bought it. At the same -time, you also want other kinds of commodities --- like stocks --- +time, you also want other kinds of commodities---like stocks--- reported in terms of today's price. This is supported as follows: @@ -2825,7 +2825,7 @@ Since the second posting is also null, it's value will become the inverse of whatever amount is generated for the first posting. This is the only time in ledger when more than one posting's amount -may be empty --- and then only because it's not true empty, it is +may be empty---and then only because it's not true empty, it is indirectly provided by the balance assignment's value. @node Balancing transactions, , Resetting a balance, Balance verification @@ -3195,7 +3195,7 @@ To show all lot information in a report, use @code{--lots}. Normally when you ask Ledger to display the values of commodities held, it uses a value expression called ``market'' to determine the -most recent value from its price database --- even downloading prices +most recent value from its price database---even downloading prices from the Internet, if @code{-Q} was specified and a suitable ``getquote'' script is found on your system. @@ -3627,8 +3627,8 @@ this, use the special account name @samp{$account}: @end smallexample This example causes 10% of the matching account's total to be deferred -to the @samp{Savings} account---as a balanced virtual posting, -which may be excluded from reports by using @option{--real}. +to the @samp{Savings} account---as a balanced virtual posting, which +may be excluded from reports by using @option{--real}. @node Building Reports, Reporting Commands, Transactions, Top @chapter Building Reports -- cgit v1.2.3 From 04973bd10989a4bb8a39a2e1e675c38d54c39475 Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 28 Apr 2013 15:13:52 +0200 Subject: Use @samp{} for single characters --- doc/ledger3.texi | 296 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 150 insertions(+), 146 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 512796b8..c08d6657 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -315,12 +315,13 @@ If you would rather start with your own journal right away please Please note that as a command line program, Ledger is controlled from your shell. There are several different command shells that all behave slightly differently with respect to some special characters. -In particular, the BASH shell will interpret $ signs differently than -ledger and they must be escaped to reach the actual program. Another -example is zsh, which will interpret ^ differently than ledger -expects. In all cases that follow you should take that into account -when entering the command line arguments given. There are too many -variations between shells to give concrete examples for each. +In particular, the BASH shell will interpret @samp{$} signs +differently than ledger and they must be escaped to reach the actual +program. Another example is zsh, which will interpret @samp{^} +differently than ledger expects. In all cases that follow you should +take that into account when entering the command line arguments given. +There are too many variations between shells to give concrete examples +for each. @node Balance Report, Register Report, Run Some Reports, Run Some Reports @subsection Balance Report @@ -454,7 +455,7 @@ $ ledger -f drewr3.dat balance Groceries @noindent If you would like to find transaction to only a certain payee use -@code{payee} or @@: +@samp{payee} or @samp{@@}: @smallexample $ ledger -f drewr3.dat register payee "Organic" @@ -514,7 +515,8 @@ shows the ``cleared'' balance. Using ledger under the windows command shell has one significant limitation. CMD.exe is limited to standard ASCII characters and as -such cannot display any currency symbols other than dollar signs ($). +such cannot display any currency symbols other than dollar signs +@samp{$}. @node Principles of Accounting, Keeping a Journal, Ledger Tutorial, Top @chapter Principles of Accounting with Ledger @@ -981,7 +983,7 @@ C 1.00 Gb = 1024 Mb C 1.00 Tb = 1024 Gb @end smallexample -Each of these definitions correlates a commodity (such as @code{Kb}) +Each of these definitions correlates a commodity (such as @samp{Kb}) and a default precision, with a certain quantity of another commodity. In the above example, kilobytes are reported with two decimal places of precision and each kilobyte is equal to 1024 bytes. @@ -1398,7 +1400,7 @@ Expenses:Food:Hamburgers and Fries Comments are generally started using a @samp{;}. However, in order to increase compatibility with other text manipulation programs and methods four additional comment characters are valid if used at the -beginning of a line: @code{#}, @code{|}, and @code{*} and @code{%}. +beginning of a line: @samp{#}, @samp{|}, and @samp{*} and @samp{%}. @cindex block comments @cindex comments, block Block comments can be made by use @code{@!comment} ... @code{@!end @@ -1497,7 +1499,7 @@ $ ledger -f example.dat bal The top two lines show my current assets as $-66.00 in checking (in this very short example I didn't establish opening an opening balance -for the checking account) and E15.00. After spending on dinner i have +for the checking account) and E15.00. After spending on dinner I have E15.00 in my wallet. The bottom line balances to zero, but is shown in two lines since we haven't told ledger to convert commodities. @@ -1513,16 +1515,16 @@ in two lines since we haven't told ledger to convert commodities. Commodity names can have any character, including white-space. However, if you include white-space or numeric characters the -commodity name must be enclosed in double quotes: +commodity name must be enclosed in double quotes @samp{"}: @smallexample -1999/06/09 ! Achat - Actif:SG PEE STK 49.957 "Arcancia Equilibre 454" - Actif:SG PEE STK $-234.90 - -2000/12/08 ! Achat - Actif:SG PEE STK 215.796 "Arcancia Equilibre 455" - Actif:SG PEE STK $-10742.54 +1999/06/09 ! Achat + Actif:SG PEE STK 49.957 "Arcancia Équilibre 454" + Actif:SG PEE STK $-234.90 + +2000/12/08 ! Achat + Actif:SG PEE STK 215.796 "Arcancia Équilibre 455" + Actif:SG PEE STK $-10742.54 @end smallexample @node Buying and Selling Stock, Fixing Lot Prices, Naming Commodities, Currency and Commodities @@ -1537,9 +1539,9 @@ convention is as follows: @smallexample 2004/05/01 Stock purchase - Assets:Broker 50 AAPL @@ $30.00 - Expenses:Broker:Commissions $19.95 - Assets:Broker $-1,500.00 + Assets:Broker 50 AAPL @@ $30.00 + Expenses:Broker:Commissions $19.95 + Assets:Broker $-1,500.00 @end smallexample This assumes you have a brokerage account that is capable of managed @@ -1547,19 +1549,20 @@ both liquid and commodity assets. Now, on the day of the sale: @smallexample 2005/08/01 Stock sale - Assets:Broker -50 APPL @{$30.00@} @@ $50.00 - Expenses:Broker:Commissions $19.95 - Income:Capital Gains $-1,000.00 - Assets:Broker $2,500.00 + Assets:Broker -50 APPL @{$30.00@} @@ $50.00 + Expenses:Broker:Commissions $19.95 + Income:Capital Gains $-1,000.00 + Assets:Broker $2,500.00 @end smallexample @noindent You can, of course, elide the amount of the last posting. It is there for clarity's sake. -The @{$30.00@} is a lot price. You can also use a lot date, -[2004/05/01], or both, in case you have several lots of the same -price/date and your taxation model is based on longest-held-first. +The @samp{@{$30.00@}} is a lot price. You can also use a lot date, +@samp{[2004/05/01]}, or both, in case you have several lots of the +same price/date and your taxation model is based on +longest-held-first. @node Fixing Lot Prices, Complete control over commodity pricing, Buying and Selling Stock, Currency and Commodities @subsection Fixing Lot Prices @@ -1586,9 +1589,9 @@ This is supported as follows: Assets:Checking @end smallexample -This transaction actually introduces a new commodity, ``GAL @{=$2.29@}'', -whose market value disregards any future changes in the price of -gasoline. +This transaction actually introduces a new commodity, @samp{GAL +@{=$2.29@}}, whose market value disregards any future changes in the +price of gasoline. If you do not want price fixing, you can specify this same transaction in one of two ways, both equivalent (note the lack of the equal sign @@ -1639,16 +1642,16 @@ points of interception, you can specify the valuation method: @item by changing the journal default of @code{market} @end enumerate -Fixated pricing (such as @code{@{=$20@})} still plays a role in this +Fixated pricing (such as @samp{@{=$20@}}) still plays a role in this scheme. As far as valuation goes, it's shorthand for writing -@code{((s,d,t -> market($20,d,t)))}. +@samp{((s,d,t -> market($20,d,t)))}. A valuation function receives three arguments: @table @code @item source A string identifying the commodity whose price is being asked for -(example: ``EUR'') +(example: @samp{EUR}) @item date The reference date the price should be relative. @@ -1661,7 +1664,7 @@ was used instead of @code{--exchange}. The valuation function should return an amount. If you've written your function in Python, you can return something like -@code{Amount("$100")}. If the function returns an explicit value, +@samp{Amount("$100")}. If the function returns an explicit value, that value is always used, regardless of the commodity, the date, or the desired target commodity. For example, @@ -1714,7 +1717,7 @@ function on a transaction-wide or per-posting basis. @end smallexample Lastly, you can specify the valuation function/value for any specific -amount using the @code{(( ))} commodity annotation. +amount using the @samp{(( ))} commodity annotation. @smallexample 2012-03-02 KFC @@ -1787,7 +1790,7 @@ account Expenses:Utilities ... @end smallexample -Using the @code{--strict} option will cause Ledger to complain if any +Using the @option{--strict} option will cause Ledger to complain if any accounts are not previously defined: @smallexample @@ -1836,10 +1839,10 @@ line is: DATE[=EDATE] [*|!] [(CODE)] DESC @end smallexample -If @code{*} appears after the date (with optional effective date), it +If @samp{*} appears after the date (with optional effective date), it indicates the transaction is ``cleared'', which can mean whatever the -user wants it to mean. If @code{!} appears after the date, it -indicates d the transaction is ``pending''; i.e., tentatively cleared +user wants it to mean. If @samp{!} appears after the date, it +indicates the transaction is ``pending''; i.e., tentatively cleared from the user's point of view, but not yet actually cleared. If a @code{CODE} appears in parentheses, it may be used to indicate a check number, or the type of the posting. Following these is the @@ -1904,8 +1907,8 @@ Ledger. @table @code @item beginning of line -Command directives must occur at the beginning of a line. Use of ! and -@@ is deprecated. +Command directives must occur at the beginning of a line. Use of +@samp{!} and @samp{@@} is deprecated. @item account Pre-declare valid account names. This only has effect if @@ -2286,8 +2289,8 @@ See @code{year} @item N SYMBOL Indicates that pricing information is to be ignored for a given symbol, nor will quotes ever be downloaded for that symbol. Useful -with a home currency, such as the dollar ($). It is recommended that -these pricing options be set in the price database file, which +with a home currency, such as the dollar @samp{$}. It is recommended +that these pricing options be set in the price database file, which defaults to @file{~/.pricedb}. The syntax for this command is: @smallexample @@ -2593,7 +2596,7 @@ You can mark individual postings as cleared or pending, in case one After the payee, and after at least one tab or two spaces (or a space and a tab, which Ledger calls this a ``hard separator''), you may -introduce a note about the transaction using the ; character: +introduce a note about the transaction using the @samp{;} character: @smallexample 2012-03-10 * KFC ; yum, chicken... @@ -2873,8 +2876,8 @@ another. The resulting posting cost is $50.00 per share. @node Explicit posting costs, Posting cost expressions, Posting cost, Transactions @section Explicit posting costs -You can make any posting's cost explicit using the @@ symbol after the -amount or amount expression: +You can make any posting's cost explicit using the @samp{@@} symbol +after the amount or amount expression: @smallexample 2012-03-10 My Broker @@ -2936,9 +2939,9 @@ You can even have both: @node Total posting costs, Virtual posting costs, Posting cost expressions, Transactions @section Total posting costs -The cost figure following the @@ character specifies the +The cost figure following the @samp{@@} character specifies the @emph{per-unit} price for the commodity being transferred. If you'd -like to specify the total cost instead, use @@@@: +like to specify the total cost instead, use @samp{@@@@}: @smallexample 2012-03-10 My Broker @@ -2960,8 +2963,8 @@ Ledger reads this as if you had written: Normally whenever a commodity exchange like this happens, the price of the exchange (such as $50 per share of AAPL, above) is recorded in Ledger's internal price history database. To prevent this from -happening in the case of an exceptional transaction, surround the @@ -or @@@@ with parentheses: +happening in the case of an exceptional transaction, surround the +@samp{@@} or @samp{@@@@} with parentheses: @smallexample 2012-03-10 My Brother @@ -3175,7 +3178,7 @@ expressions): You can also associate arbitrary notes for your own record keeping in parentheses, and reveal them with @code{--lot-notes}. One caveat is -that the note cannot begin with an @@ character, as that would +that the note cannot begin with an @samp{@@} character, as that would indicate a virtual cost: @smallexample @@ -3462,9 +3465,9 @@ posting it matches. @subsection State flags Although you cannot mark an automated transaction as a whole as -cleared or pending, you can mark its postings with a * or ! before the -account name, and that state flag gets carried to the generated -posting. +cleared or pending, you can mark its postings with a @samp{*} or +@samp{!} before the account name, and that state flag gets carried to +the generated posting. @node Effective Dates, Periodic Transactions, State flags, Automated Transactions @subsection Effective Dates @@ -3547,7 +3550,7 @@ really knows that it debited $225 this month. @subsection Periodic Transactions @findex --budget -A periodic transaction starts with a ~ followed by a period +A periodic transaction starts with a @samp{~} followed by a period expression. Periodic transactions are used for budgeting and forecasting only, they have no effect without the @code{--budget} option specified. @xref{Budgeting and Forecasting} for examples and @@ -4859,7 +4862,7 @@ It works by finding a past posting matching the regular expression @code{viva}, and assuming that any accounts or amounts specified will be similar to that earlier posting. If Ledger does not succeed in generating a new transaction, an error is printed and the exit code is -set to @code{1}. +set to @samp{1}. Here are a few more examples of the @command{xact} command, assuming the above journal transaction: @@ -4910,9 +4913,10 @@ meaning, described below. The regular expressions arguments always match the account name that a posting refers to. To match on the payee of the transaction -instead, precede the regular expression with @code{payee} or @@. For -example, the following balance command reports account totals for -rent, food and movies, but only those whose payee matches Freddie: +instead, precede the regular expression with @samp{payee} or +@samp{@@}. For example, the following balance command reports account +totals for rent, food and movies, but only those whose payee matches +Freddie: @smallexample $ ledger bal rent food movies payee freddie @@ -5272,9 +5276,9 @@ $ ledger --options bal --cleared -f ~/ledger/test/input/drewr3.dat @end smallexample @noindent -For the source column, a value starting with a @code{-} or @code{--} +For the source column, a value starting with a @samp{-} or @samp{--} indicated the source was a command line argument. It the entry starts -with a @code{$}, the source was an environment variable. If the source +with a @samp{$}, the source was an environment variable. If the source is @code{?normalize} the value was set internally by ledger, in a function called @code{normalize_options}. @@ -6999,7 +7003,7 @@ The market value of a posting, or an account without its children. @item g The net gain (market value minus cost basis), for a posting or an -account without its children. It is the same as @code{v-b}. +account without its children. It is the same as @samp{v-b}. @item l The depth (``level'') of an account. If an account has one parent, @@ -7010,13 +7014,13 @@ The index of a posting, or the count of postings affecting an account. @item X -1 if a posting's transaction has been cleared, 0 otherwise. +@samp{1} if a posting's transaction has been cleared, @samp{0} otherwise. @item R -1 if a posting is not virtual, 0 otherwise. +@samp{1} if a posting is not virtual, @samp{0} otherwise. @item Z -1 if a posting is not automated, 0 otherwise. +@samp{1} if a posting is not automated, @samp{0} otherwise. @end table @node Calculated totals, , Posting/account details, Variables @@ -7042,7 +7046,7 @@ all its children. @item G The total net gain (market value minus cost basis), for a series of postings, or an account and its children. It is the same as -@code{V-B}. +@samp{V-B}. @end table @node Functions, Operators, Variables, Value Expressions @@ -7061,12 +7065,12 @@ The absolute (unsigned) value of the argument. Strips the commodity from the argument. @item A -The arithmetic mean of the argument; @code{Ax} is the same as -@code{x/n}. +The arithmetic mean of the argument; @samp{Ax} is the same as +@samp{x/n}. @item P -The present market value of the argument. The syntax @code{P(x,d)} is -supported, which yields the market value at time @code{d}. If no date +The present market value of the argument. The syntax @samp{P(x,d)} is +supported, which yields the market value at time @samp{d}. If no date is given, then the current moment is used. @end table @@ -7173,51 +7177,51 @@ Useful specifying a date in plain terms. For example, you could say @multitable @columnfractions .3 .2 .5 @headitem Function @tab Abbrev. @tab Description -@item @code{amount_expr } @tab @code{} @tab -@item @code{abs } @tab @code{} @tab --> U -@item @code{ceiling } @tab @code{} @tab Return the next integer toward +infinity +@item @code{amount_expr} @tab @code{} @tab +@item @code{abs} @tab @code{} @tab --> U +@item @code{ceiling} @tab @code{} @tab Return the next integer toward +infinity @item @code{code} @tab @code{} @tab Return the transaction code, the string between the parenthesis after the date. -@item @code{commodity } @tab @code{} @tab -@item @code{display_amount } @tab @code{} @tab --> t -@item @code{display_total } @tab @code{} @tab --> T -@item @code{date } @tab @code{} @tab -@item @code{format_date } @tab @code{} @tab -@item @code{format } @tab @code{} @tab -@item @code{floor } @tab @code{} @tab Return the next integer toward -infinity -@item @code{get_at } @tab @code{} @tab -@item @code{is_seq } @tab @code{} @tab -@item @code{justify } @tab @code{} @tab -@item @code{join } @tab @code{} @tab -@item @code{market --> P } @tab @code{} @tab -@item @code{null } @tab @code{} @tab -@item @code{now --> d m } @tab @code{} @tab -@item @code{options } @tab @code{} @tab -@item @code{post } @tab @code{} @tab -@item @code{percent } @tab @code{} @tab -@item @code{price } @tab @code{} @tab -@item @code{print } @tab @code{} @tab -@item @code{quoted } @tab @code{} @tab -@item @code{quantity } @tab @code{} @tab -@item @code{rounded } @tab @code{} @tab -@item @code{roundto } @tab @code{} @tab Return value rounded to n digits. Does not affect formatting. -@item @code{scrub } @tab @code{} @tab -@item @code{strip --> S } @tab @code{} @tab -@item @code{should_bold } @tab @code{} @tab -@item @code{truncated } @tab @code{} @tab -@item @code{total_expr } @tab @code{} @tab -@item @code{today } @tab @code{} @tab -@item @code{top_amount } @tab @code{} @tab -@item @code{to_boolean } @tab @code{} @tab -@item @code{to_int } @tab @code{} @tab -@item @code{to_datetime } @tab @code{} @tab -@item @code{to_date } @tab @code{} @tab -@item @code{to_amount } @tab @code{} @tab -@item @code{to_balance } @tab @code{} @tab -@item @code{to_spring } @tab @code{} @tab -@item @code{to_mask } @tab @code{} @tab -@item @code{to_sequence } @tab @code{} @tab -@item @code{unrounded } @tab @code{} @tab -@item @code{value_date } @tab @code{} @tab +@item @code{commodity} @tab @code{} @tab +@item @code{display_amount} @tab @code{} @tab --> t +@item @code{display_total} @tab @code{} @tab --> T +@item @code{date} @tab @code{} @tab +@item @code{format_date} @tab @code{} @tab +@item @code{format} @tab @code{} @tab +@item @code{floor} @tab @code{} @tab Return the next integer toward -infinity +@item @code{get_at} @tab @code{} @tab +@item @code{is_seq} @tab @code{} @tab +@item @code{justify} @tab @code{} @tab +@item @code{join} @tab @code{} @tab +@item @code{market --> P} @tab @code{} @tab +@item @code{null} @tab @code{} @tab +@item @code{now --> d m} @tab @code{} @tab +@item @code{options} @tab @code{} @tab +@item @code{post} @tab @code{} @tab +@item @code{percent} @tab @code{} @tab +@item @code{price} @tab @code{} @tab +@item @code{print} @tab @code{} @tab +@item @code{quoted} @tab @code{} @tab +@item @code{quantity} @tab @code{} @tab +@item @code{rounded} @tab @code{} @tab +@item @code{roundto} @tab @code{} @tab Return value rounded to n digits. Does not affect formatting. +@item @code{scrub} @tab @code{} @tab +@item @code{strip --> S} @tab @code{} @tab +@item @code{should_bold} @tab @code{} @tab +@item @code{truncated} @tab @code{} @tab +@item @code{total_expr} @tab @code{} @tab +@item @code{today} @tab @code{} @tab +@item @code{top_amount} @tab @code{} @tab +@item @code{to_boolean} @tab @code{} @tab +@item @code{to_int} @tab @code{} @tab +@item @code{to_datetime} @tab @code{} @tab +@item @code{to_date} @tab @code{} @tab +@item @code{to_amount} @tab @code{} @tab +@item @code{to_balance} @tab @code{} @tab +@item @code{to_spring} @tab @code{} @tab +@item @code{to_mask} @tab @code{} @tab +@item @code{to_sequence} @tab @code{} @tab +@item @code{unrounded} @tab @code{} @tab +@item @code{value_date} @tab @code{} @tab @end multitable @node Format Strings, Extending with Python, Value Expressions, Top @@ -7270,18 +7274,18 @@ without having to enter a new format for each command. @section Format String Structure Within a format string, a substitution is specified using a percent -character (@code{%}). The basic format of all substitutions is: +@samp{%} character. The basic format of all substitutions is: @smallexample %[-][MIN WIDTH][.MAX WIDTH](VALEXPR) @end smallexample -If the optional minus sign (@code{-}) follows the percent character, +If the optional minus sign @samp{-} follows the percent character, whatever is substituted will be left justified. The default is right -justified. If a minimum width is given next, the substituted text will -be at least that wide, perhaps wider. If a period and a maximum width -is given, the substituted text will never be wider than this, and will -be truncated to fit. Here are some examples: +justified. If a minimum width is given next, the substituted text +will be at least that wide, perhaps wider. If a period and a maximum +width is given, the substituted text will never be wider than this, +and will be truncated to fit. Here are some examples: @table @code @item %-20P @@ -7357,7 +7361,7 @@ has an effective date, it prints @code{[ACTUAL_DATE=EFFECTIVE_DATE]}. If a posting has been cleared, this returns a 1, otherwise returns 0. @item Y -This is the same as @code{%X}, except that it only displays a state +This is the same as @samp{%X}, except that it only displays a state character if all of the member postings have the same state. @item C @@ -7393,7 +7397,7 @@ Inserts the full name of an account. Inserts the note associated with a posting, if one exists. @item / -The @code{%/} construct is special. It separates a format string +The @samp{%/} construct is special. It separates a format string between what is printed for the first posting of a transaction, and what is printed for all subsequent postings. If not used, the same format string is used for all postings. @@ -7451,10 +7455,10 @@ The character based formatting ledger can do is limited to the ANSI terminal character colors and font highlights in a normal TTY session. @multitable @columnfractions .3 .3 .3 -@item @code{red} @tab @code{magenta} @tab @code{bold} -@item @code{green } @tab @code{cyan} @tab @code{underline} -@item @code{yellow } @tab @code{white} @tab @code{blink} -@item @code{blue } +@item @code{red} @tab @code{magenta} @tab @code{bold} +@item @code{green} @tab @code{cyan} @tab @code{underline} +@item @code{yellow} @tab @code{white} @tab @code{blink} +@item @code{blue} @end multitable @node Quantities and Calculations, Dates, Colors, Formatting codes @@ -7553,7 +7557,7 @@ is simple to sort on. @node Weekdays, Month, Days, Date and Time Format Codes @subsubsection Weekdays -You can have additional weekday information in your date with @code{%A} +You can have additional weekday information in your date with @samp{%A} as @table @code @@ -7587,12 +7591,12 @@ day of week starting with Sunday (0), i.e. @code{smtwtfs} 3 @node Month, Miscellaneous Date Codes, Weekdays, Date and Time Format Codes @subsubsection Month -You can have additional month information in your date with @code{%B} +You can have additional month information in your date with @samp{%B} as @table @code @item %m-%d-%Y %B -yields @code{ 02-10-2010 February} +yields @code{02-10-2010 February} @item %B %m-%d-%Y yields @code{February 02-10-2010} @@ -7603,11 +7607,11 @@ These are options you can select for month @table @code @item %m -@code{mm} month as two digits +@samp{mm} month as two digits @item %b -Locale’s abbreviated month, for example @code{02} might be abbreviated -as @code{Feb} +Locale’s abbreviated month, for example @samp{02} might be abbreviated +as @samp{Feb} @item %B Locale’s full month, variable length February @@ -7662,7 +7666,7 @@ justified and padded to the full width of the field. If @code{colorize} is true then ledger will honor color settings. @item join(STR) -Replaces line feeds in @code{STR} with @code{\n}. +Replaces line feeds in @code{STR} with @samp{\n}. @item quoted(STR) Return @code{STR} surrounded by double quotes, @code{"STR"}. @@ -7681,19 +7685,19 @@ generated the posting. @table @code @item filename -name of ledger data file from whence posting came, abbreviated @code{S} +name of ledger data file from whence posting came, abbreviated @samp{S} @item beg_pos character position in @code{filename} where entry for posting begins, -abbreviated @code{B} +abbreviated @samp{B} @item end_pos character position in @code{filename} where entry for posting ends, -abbreviated @code{E} +abbreviated @samp{E} @item beg_line line number in @code{filename} where entry for posting begins, -abbreviated @code{b} +abbreviated @samp{b} @item end_line line number in @code{filename} where posting's entry for posting ends, -abbreviated @code{e} +abbreviated @samp{e} @end table @node Extending with Python, Ledger for Developers, Format Strings, Top @@ -8150,10 +8154,10 @@ amount of the first posting is typically positive. Consider: @node Comments and meta-data, Specifying Amounts, Journal File Format, Journal File Format @subsection Comments and meta-data -Comments are generally started using a @code{;}. However, in order to +Comments are generally started using a @samp{;}. However, in order to increase compatibility with other text manipulation programs and methods three additional comment characters are valid if used at the -beginning of a line: @code{#}, @code{|}, and @code{*}. +beginning of a line: @samp{#}, @samp{|}, and @samp{*}. @node Specifying Amounts, Posting costs, Comments and meta-data, Journal File Format @subsection Specifying Amounts @@ -8200,8 +8204,8 @@ case of @code{1000.00} above, the internal value is @code{100000/100}. While rational numbers are great at not losing precision, the question arises: How should they be displayed? A number like @code{100000/100} is no problem, since it represents a clean decimal fraction. But what -about when the number @code{1/1} is divided by three? How should one -print @code{1/3}, an infinitely repeating decimal? +about when the number @samp{1/1} is divided by three? How should one +print @samp{1/3}, an infinitely repeating decimal? Ledger gets around this problem by rendering rationals into decimal at the last possible moment, and only for display. As such, some @@ -8212,11 +8216,11 @@ rarely, but even then it does not reflect adjustment of the @emph{internal amount}, only the displayed amount. What has still not been answered is how Ledger rounds values. Should -@code{1/3} be printed as @code{0.33} or @code{0.33333}? For +@samp{1/3} be printed as @samp{0.33} or @samp{0.33333}? For commoditized amounts, the number of decimal places is decided by observing how each commodity is used; but in the case of integer amounts, an arbitrary factor must be chosen. Initially, this factor -is six. Thus, @code{1/3} is printed back as @code{0.333333}. +is six. Thus, @samp{1/3} is printed back as @samp{0.333333}. Further, this rounding factor becomes associated with each particular value, and is carried through mathematical operations. For example, if that particular number were multiplied by itself, the decimal -- cgit v1.2.3 From 1438ab783c292ed54e13057b12a812c23197fc5b Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 28 Apr 2013 16:42:19 +0200 Subject: Add documentation about pre-commands --- doc/ledger3.texi | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index c08d6657..19772a3c 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -8471,9 +8471,12 @@ Print version information and exit. @node Pre-commands, , Debug Options, Developer Commands @subsection Pre-Commands +@cindex pre-commands Pre-commands are useful when you aren't sure how a command or option -will work. +will work. The difference between a pre-command and a regular command +is that pre-commands ignore the journal data file completely, nor is +the user's init file read. @ftable @code @item args @@ -8490,14 +8493,14 @@ Evaluate the given arguments against the following model transaction: Liabilities:MasterCard $-200.00 @end smallexample -@item eval +@item eval @var{VEXPR} Evaluate the given value expression against the model transaction @item expr "LIMIT EXPRESSION" Print details of how ledger parses the given limit expression and apply it against a model transaction. -@item format "FORMATTING" +@item format @var{FORMAT_STRING} Print details of how ledger uses the given formatting description and apply it against a model transaction. @@ -8505,7 +8508,7 @@ apply it against a model transaction. Randomly generates syntactically valid Ledger data from a seed. Used by the GenerateTests harness for development testing -@item parse +@item parse @var{VEXPR} Print details of how ledger uses the given value expression description and apply it against a model transaction. -- cgit v1.2.3 From 6ca9c4ef56fa9fa3e15ac396c884b8ab362e57f4 Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 28 Apr 2013 21:06:23 +0200 Subject: Check that options in global.cc::lookup_option, report.cc::lookup_option, session.cc::lookup_option, are listed in documentation. Add consistency about the @var{} variables passed to --options. M-x texinfo-all-menus-update --- doc/ledger3.texi | 568 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 358 insertions(+), 210 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 19772a3c..a5e24407 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -1625,12 +1625,13 @@ Assets:Checking because its amount is null. @node Complete control over commodity pricing, , Fixing Lot Prices, Currency and Commodities @subsection Complete control over commodity pricing @findex --market -@findex --exchange +@findex --exchange @var{COMMODITY} Ledger allows you to have very detailed control over how your commodities are valued. You can fine tune the results given using the -@code{--market} or @code{--exchange} options. There are now several -points of interception, you can specify the valuation method: +@code{--market} or @code{--exchange @var{COMMODITY}} options. There +are now several points of interception, you can specify the valuation +method: @enumerate @item on a commodity itself @@ -1659,7 +1660,7 @@ The reference date the price should be relative. @item target A string identifying the ``target'' commodity, or the commodity the returned price should be in. This argument is null if @code{--market} -was used instead of @code{--exchange}. +was used instead of @code{--exchange @var{COMMODITY}}. @end table The valuation function should return an amount. If you've written @@ -2913,8 +2914,8 @@ Said another way, whenever Ledger sees a posting cost of the form ``primary''. The only meaning a primary commodity has is that @code{-V} flag will -never convert a primary commodity into any other commodity. @code{-X} -still will, however. +never convert a primary commodity into any other commodity. @code{-X +@var{COMMODITY}} still will, however. @node Posting cost expressions, Total posting costs, Explicit posting costs, Transactions @section Posting cost expressions @@ -3794,7 +3795,7 @@ total; and report the balance for all accounts that begin with @findex --monthly @findex -M @findex --display @var{EXPR} -@findex --period-sort +@findex --period-sort @var{VEXPR} The following query makes it easy to see monthly expenses, with each month's expenses sorted by the amount: @@ -4193,7 +4194,7 @@ Ledger will include @code{; transid: 767718} in the first transaction is from the file above. @findex --invert -@findex --account @var{NAME} +@findex --account @var{STR} @findex --rich-data The @code{convert} command accepts three options, the most important @@ -4227,6 +4228,7 @@ used. @node The lisp command, Emacs Org mode, Comma Separated Values files, Reports in other Formats @subsection The @code{lisp} command @findex lisp +@findex emacs The @command{lisp} command outputs results in a form that can be read directly by Emacs Lisp. The format of the @code{sexp} is: @@ -4242,6 +4244,7 @@ directly by Emacs Lisp. The format of the @code{sexp} is: @node Emacs Org mode, Org mode with Babel, The lisp command, Reports in other Formats @subsection Emacs @code{org} Mode +@findex org The @code{org} command produces a journal file suitable for use in the Emacs Org mode. More details on using Org mode can be found at @@ -4775,6 +4778,8 @@ pricedb database files. * commodities:: * tags:: * entry and xact:: +* stats:: +* select:: @end menu @node accounts, payees, Reports about your Journals, Reports about your Journals @@ -4821,7 +4826,7 @@ is sorted by name. Using the @code{--count} option will tell you how many entries use each tag. Using the @code{--values} option will report the values used by each tag. -@node entry and xact, , tags, Reports about your Journals +@node entry and xact, stats, tags, Reports about your Journals @subsection @command{draft}, @command{entry} and @command{xact} @findex draft @findex entry @@ -4879,6 +4884,19 @@ $ ledger xact 4/9 viva dining "DM 11.50" @command{xact} is identical to @command{entry} and is provide for backwards compatibility with Ledger 2.X. +@node stats, select, entry and xact, Reports about your Journals +@subsection @code{stats} +@findex stats +@findex stat + +FIXME + +@node select, , stats, Reports about your Journals +@subsection @code{select} +@findex select + +FIXME + @node Command-line Syntax, Budgeting and Forecasting, Reporting Commands, Top @chapter Command-line Syntax @@ -4952,8 +4970,10 @@ commands. @ftable @code @item balance +@itemx bal Show account balances @item register +@itemx reg Show all transactions with running total @item csv Show transactions in csv format, for exporting to other programs @@ -4961,7 +4981,8 @@ Show transactions in csv format, for exporting to other programs Print transaction in a ledger readable format @item xml Produce XML output of the register command -@item emacs +@item lisp +@itemx emacs Produce Emacs lisp output @item equity Print account balances as transactions @@ -4997,9 +5018,9 @@ Redirect output to @file{FILE} @itemx -i @var{FILE} Specify options file -@item --account @var{NAME} -@itemx -a @var{NAME} -Specify default account @var{NAME} for QIF file postings +@item --account @var{STR} +@itemx -a @var{STR} +Specify default account @var{STR} for QIF file postings @end ftable @node Report Filtering Quick Reference, Error Checking and Calculation Options, Basic Options Quick Reference, Command Line Quick Reference @@ -5015,10 +5036,10 @@ Begin reports on or after @var{DATE} @item --end @var{DATE} @itemx -e @var{DATE} Limit end date of transactions for report -@item --period @var{STR} -@itemx -p @var{STR} -Set report period to @var{STR} -@item --period-sort +@item --period @var{PERIOD_EXPRESSION} +@itemx -p @var{PERIOD_EXPRESSION} +Set report period to @var{PERIOD_EXPRESSION} +@item --period-sort @var{VEXPR} Sort postings within each period @item --cleared @itemx -C @@ -5123,24 +5144,24 @@ Produce a pivot table of the @var{TAG} type specified @item --amount-data @itemx -j Show only date and value column to format the output for plots -@item --plot-amount-format @var{STR} +@item --plot-amount-format @var{FORMAT_STRING} Specify the format for the plot output @item --total-data @itemx -J Show only dates and totals to format the output for plots -@item --plot-total-format @var{STR} +@item --plot-total-format @var{FORMAT_STRING} Specify the format for the plot output @item --display @var{EXPR} @itemx -d @var{EXPR} Display only posting that meet the criterias in the @var{EXPR} -@item --date-format @var{STR} -@itemx -y @var{STR} +@item --date-format @var{DATE_FORMAT} +@itemx -y @var{DATE_FORMAT} Change the basic date format used in reports -@item --format @var{STR} -@itemx --balance-format @var{STR} -@itemx --register-format @var{STR} -@itemx --prices-format @var{STR} -@itemx -F @var{STR} +@item --format @var{FORMAT_STRING} +@itemx --balance-format @var{FORMAT_STRING} +@itemx --register-format @var{FORMAT_STRING} +@itemx --prices-format @var{FORMAT_STRING} +@itemx -F @var{FORMAT_STRING} Set reporting format @item --wide @itemx -w @@ -5236,7 +5257,11 @@ use only command-line arguments to control Ledger. Useful for debugs or testing small Journal files not associated with you main financial database. +@item --debug @var{CODE} +FIXME TD + @item --help +@itemx -h Display the info page for ledger. @item --init-file @var{FILE} @@ -5284,6 +5309,22 @@ a function called @code{normalize_options}. @item --script @var{FILE} Execute a ledger script. + +@item --trace @var{INT} +FIXME TD + +@item --verbose +@itemx -v +FIXME TD + +@item --verify +FIXME TD + +@item --verify-memory +FIXME TD + +@item --version +FIXME TD @end ftable @node Session Options, Report Options, Global Options, Detailed Options Description @@ -5297,15 +5338,29 @@ instance of Ledger running in the background and running multiple sessions with multiple reports per session. @ftable @code +@item --cache @var{FIXME} +FIXME + +@item --check-payees +FIXME + +@item --day-break +FIXME + @item --decimal-comma Direct Ledger to parse journals using the European standard comma as decimal separator, vice a period. @item --download +@itemx -Q Direct Ledger to download prices using the script defined in @code{--getquote @var{FILE}}. +@item --explicit +FIXME + @item --file @var{FILE} +@itemx -f @var{FILE} Specify the input @file{FILE} for this invocation. @item --getquote @var{FILE} @@ -5352,10 +5407,18 @@ $ ledger -f test/input/drewr3.dat bal --master-account HUMBUG $ 200.00 Mortgage:Principal @end smallexample +@item --pedantic +FIXME + +@item --permissive +FIXME + @item --price-db @var{FILE} Specify the location of the price entry data file. @item --price-exp @var{INT} +@itemx -Z @var{INT} +@itemx --leeway @var{INT} Set the expected freshness of price quotes, in @var{INT} minutes. That is, if the last known quote for any commodity is older than this value, and if @code{--download} is being used, then the Internet will @@ -5370,6 +5433,12 @@ Ledger interprets all cleared transactions as correct, and if it finds a new account or commodity (same as a misspelled commodity or account) it will issue a warning giving you the file and line number of the problem. + +@item --time-colon +FIXME + +@item --value-expr @var{FIXME} +FIXME @end ftable @node Report Options, Basic options, Session Options, Detailed Options Description @@ -5393,33 +5462,32 @@ desired width. @item --account @var{STR} Prepend @var{STR} to all accounts reported. That is, the option -@code{--account Personal} would tack @code{Personal:} to the beginning +@code{--account Personal} would tack @samp{Personal:} to the beginning of every account reported in a balance report or register report. @item --account-width @var{INT} Set the width of the account column in the @command{register} report to @code{INT} characters. -@item --actual-dates -Show actual dates of transactions (@pxref{Effective Dates}). Also -@code{-L}. - @item --actual +@itemx -L Report only real transactions, with no automated or virtual transactions used. @item --add-budget Show only un-budgeted postings. -@item --amount-data -On a register report print only the dates and amount of postings. -Useful for graphing and spreadsheet applications. - @item --amount @var{EXPR} +@itemx -t @var{EXPR} Apply the given value expression to the posting amount (@pxref{Value Expressions}). Using @code{--amount} you can apply an arbitrary transformation to the postings. +@item --amount-data +@itemx -j +On a register report print only the dates and amount of postings. +Useful for graphing and spreadsheet applications. + @item --amount-width @var{INT} Set the width in characters of the amount column in the @command{register} report. @@ -5427,11 +5495,19 @@ Set the width in characters of the amount column in the @item --anon Anonymize registry output, mostly for sending in bug reports. +@item --auto-match +FIXME + +@item --aux-date +@itemx --effective +Show auxiliary dates for all calculations (@pxref{Effective Dates}). + @item --average +@itemx -A Print average values over the number of transactions instead of running totals. -@item --balance-format @var{STR} +@item --balance-format @var{FORMAT_STRING} Specify the format to use for the @code{balance} report (@pxref{Format Strings}). The default is: @@ -5447,13 +5523,15 @@ Strings}). The default is: ASK JOHN @item --basis +@itemx -B +@itemx --cost Report the cost basis on all posting @item --begin @var{DATE} Specify the start @var{DATE} of all calculations. Transactions before that date will be ignored. -@item --bold-if @var{EXPR} +@item --bold-if @var{VEXPR} Print the entire line in bold if the given value expression is true (@pxref{Value Expressions}). @@ -5465,6 +5543,11 @@ $ ledger reg Expenses --begin Dec --bold-if "amount > 100" list all transactions since the beginning of December and bold any posting greater than $100 +@item --budget +Only display budgeted items. In a register report this +displays transaction in the budget, in a balance report this displays +accounts in the budget (@pxref{Budgeting and Forecasting}). + @item --budget-format @var{FORMAT_STRING} Specify the format to use for the @code{budget} report (@pxref{Format Strings}). The default is: @@ -5477,15 +5560,17 @@ Strings}). The default is: "--------------------\n" @end smallexample -@item --budget -Only display budgeted items. In a register report this -displays transaction in the budget, in a balance report this displays -accounts in the budget (@pxref{Budgeting and Forecasting}). - @item --by-payee +@itemx -P Group the register report by payee. +@item --cleared +@itemx -C +Consider only transaction that have been cleared for +display and calculation. + @item --cleared-format @var{FORMAT_STRING} +FIXME: to keep? Specify the format to use for the @code{cleared} report (@pxref{Format Strings}). The default is: @@ -5501,20 +5586,17 @@ Strings}). The default is: "---------------- ---------------- ---------\n" @end smallexample -@item --cleared -Consider only transaction that have been cleared for -display and calculation. - @item --collapse -By default ledger prints all account in an account -tree. With @code{--collapse} it print only the top level account -specified. +@itemx -n +By default ledger prints all account in an account tree. With +@code{--collapse} it print only the top level account specified. @item --collapse-if-zero Collapse the account display only if it has a zero balance. @item --color +@itemx --ansi Use color is the tty supports it. @item --columns @var{INT} @@ -5524,9 +5606,9 @@ Specify the width of the @command{register} report in characters. Direct ledger to report the number of items when appended to the commodities, accounts or payees command. -@item --csv-format -Specify the format to use for the @code{csv} -report (@pxref{Format Strings}). The default is: +@item --csv-format @var{FORMAT_STRING} +Specify the format to use for the @code{csv} report (@pxref{Format +Strings}). The default is: @smallexample "%(quoted(date))," @@ -5543,20 +5625,22 @@ report (@pxref{Format Strings}). The default is: Shorthand for @code{--limit "date <= today"} @item --daily +@itemx -D Shorthand for @code{--period "daily"} +@item --date @var{EXPR} +Transform the date of the transaction using @var{EXPR}. + @item --date-format @var{DATE_FORMAT} +@itemx -y @var{DATE_FORMAT} Specify format ledger should use to print dates (@pxref{Date and Time Format Codes}). -@item --date @var{EXPR} -Transform the date of the transaction using @var{EXPR}. - @item --date-width @var{INT} Specify the width, in characters, of the date column in the @command{register} report. -@item --datetime-format +@item --datetime-format @var{FIXME} ASK JOHN @item --dc @@ -5628,31 +5712,30 @@ which means it only affects display, not the total calculations. Report each posting’s deviation from the average. It is only meaningful in the register and prices reports. +@item --display @var{EXPR} +Display lines that satisfy the expression given. + @item --display-amount @var{EXPR} Apply a transform to the @emph{displayed} amount. This occurs after calculations occur. -@item --display @var{BOOLEAN_EXPR} -Display lines that satisfy the expression given. - @item --display-total @var{EXPR} Apply a transform to the @emph{displayed} total. This occurs after calculations occur. @item --dow -group transactions by the day of the week. +@itemx --days-of-week +Group transactions by the days of the week. @smallexample $ ledger reg Expenses --dow --collapse @end smallexample @noindent -will print all Expenses totaled for each day of the week. - -@item --effective -Use effective dates for all calculations (@pxref{Effective Dates}). +Will print all Expenses totaled for each day of the week. @item --empty +@itemx -E Include empty accounts in the report. @item --end @var{DATE} @@ -5684,15 +5767,19 @@ for TTY that don't advertise their capabilities correctly. Force Ledger to paginate its output. @item --forecast-while @var{VEXPR} +@itemx --forecast @var{VEXPR} Continue forecasting while @var{VEXPR} is true. @item --forecast-years @var{INT} Forecast at most @var{INT} years in the future. @item --format @var{FORMAT_STRING} +@itemx -F @var{FORMAT_STRING} Use the given format string to print output. @item --gain +@itemx -G +@itemx --change Report on gains using the latest available prices. @item --generated @@ -5705,7 +5792,7 @@ Group transaction together in the @command{register} report. @var{EXPR} can be anything, although most common would be @code{payee} or @code{commodity}. The @code{tags()} function is also useful here. -@item --group-title-format +@item --group-title-format @var{FORMAT_STRING} Set the format for the headers that separate reports section of a grouped report. Only has effect with a @code{--group-by} register report. @@ -5724,8 +5811,16 @@ $ ledger reg Expenses --group-by "payee" --group-title-format "----------------- @end smallexample @item --head @var{INT} +@itemx --first @var{INT} Print the first @var{INT} entries. Opposite of @code{--tail}. +@item --historical +@itemx -H +FIXME + +@item --immediate +FIXME + @item --inject Use @code{Expected} amounts in calculations. In the case that you know that amount a transaction should be, but the actual transaction has the @@ -5744,6 +5839,7 @@ treat the transaction as if the ``Expected Value'' was actual. Change the sign of all reported values. @item --limit @var{EXPR} +@itemx -l @var{EXPR} Only transactions that satisfy the expression will be considered in the calculation. @@ -5751,21 +5847,23 @@ calculation. Report the date on which each commodity in a balance report was purchased. +@item --lot-notes +@itemx --lot-tags +Report the tag attached to each commodity in a balance report. + @item --lot-prices Report the price at which each commodity in a balance report was purchased. -@item --lot-tags -Report the tag attached to each commodity in a balance report. - -@item --lots-actual -FIX THIS ENTRY - @item --lots Report the date and price at which each commodity was purchased in a balance report. +@item --lots-actual +FIX THIS ENTRY + @item --market +@itemx -V Use the latest market value for all commodities. @item --meta @var{TAG} @@ -5777,6 +5875,7 @@ Specify the width of the Meta column used for the @code{--meta} options. @item --monthly +@itemx -M Synonym for @code{--period "monthly"} @item --no-color @@ -5793,11 +5892,11 @@ Suppress the output of group titles @item --no-total Suppress printing the final total line in a balance report. -@item --now +@item --now @var{DATE} Define the current date in case to you to do calculate in the past or future using @code{--current} -@item --only +@item --only @var{FIXME} This is a postings predicate that applies after certain transforms have been executed, such as periodic gathering. @@ -5820,6 +5919,7 @@ report. Use only postings that are marked pending @item --percent +@itemx -% Calculate the percentage value of each account in a balance reports. Only works for account that have a single commodity. @@ -5851,24 +5951,36 @@ $ ledger bal Fuel --pivot "Car" --period "this year" @xref{Metadata values}. -@item --plot-amount-format @var{STR} +@item --plot-amount-format @var{FORMAT_STRING} Define the output format for an amount data plot. @xref{Visualizing with Gnuplot}. -@item --plot-total-format @var{STR} +@item --plot-total-format @var{FORMAT_STRING} Define the output format for a total data plot. @xref{Visualizing with Gnuplot}. -@item --prepend-format @var{STR} +@item --prepend-format @var{FORMAT_STRING} Prepend @var{STR} to every line of the output @item --prepend-width @var{INT} Reserve @var{INT} spaces at the beginning of each line of the output. @item --price +@itemx -I Use the price of the commodity purchase for performing calculations. +@item --pricedb-format @var{FORMAT_STRING} +FIXME + +@item --prices-format @var{FORMAT_STRING} +FIXME + +@item --primary-date +@itemx --actual-dates +Show primary dates for all calculations (@pxref{Effective Dates}). + @item --quantity +@itemx -O FIX THIS ENTRY @item --quarterly @@ -5881,37 +5993,47 @@ interpreting. Can be useful for minor cleanups, like just aligning amounts. @item --real +@itemx -R Account using only real transactions ignoring virtual and automatic transactions. -@item --related-all -Show all postings in a transaction, similar to @code{--related} but -show both ``sides'' of each transaction. +@item --register-format @var{FORMAT_STRING} +FIXME @item --related In a register report show the related account. This is the other ``side'' of the transaction. -@item --revalued-only +@item --related-all +Show all postings in a transaction, similar to @code{--related} but +show both ``sides'' of each transaction. + +@item --revalued FIX THIS ENTRY -@item --revalued-total +@item --revalued-only FIX THIS ENTRY -@item --revalued +@item --revalued-total @var{FIXME} FIX THIS ENTRY -@item --seed +@item --rich-data +@itemx --detail +FIXME + +@item --seed @var{FIXME} Set the random seed for the @code{generate} command. Used as part of development testing. -@item --sort-all -FIX THIS ENTRY - @item --sort @var{VEXPR} +@itemx -S @var{VEXPR} Sort the register report based on the value expression given to sort. +@item --sort-all @var{FIXME} +FIX THIS ENTRY + @item --sort-xacts @var{VEXPR} +@itemx --period-sort @var{VEXPR} Sort the posting within transactions using the given value expression. @item --start-of-week @var{INT} @@ -5923,45 +6045,56 @@ week. FIX THIS ENTRY @item --tail @var{INT} +@itemx --last @var{INT} Report only the last @var{INT} entries. Only useful on a register report. -@item --total-data -FIX THIS ENTRY +@item --time-report +FIXME @item --total @var{VEXPR} +@itemx -T @var{VEXPR} Define a value expression used to calculate the total in reports. +@item --total-data +@itemx -J +FIX THIS ENTRY + @item --total-width @var{INT} Set the width of the total field in the register report. -@item --truncate +@item --truncate @var{CODE} Indicates how truncation should happen when the contents of columns -exceed their width. Valid arguments are @code{leading}, @code{middle}, -and @code{trailing}. The default is smarter than any of these three, as -it considers sub-names within the account name (that style is called -``abbreviate''). +exceed their width. Valid arguments are @samp{leading}, @samp{middle}, +and @samp{trailing}. The default is smarter than any of these three, +as it considers sub-names within the account name (that style is +called ``abbreviate''). @item --unbudgeted FIX THIS ENTRY @item --uncleared +@itemx -U Use only uncleared transactions in calculations and reports. -@item --unrealized-gains +@item --unrealized FIX THIS ENTRY -@item --unrealized-losses +@item --unrealized-gains @var{FIXME} FIX THIS ENTRY -@item --unrealized +@item --unrealized-losses @var{FIXME} FIX THIS ENTRY @item --unround Perform all calculations without rounding and display results to full precision. +@item --values +FIXME + @item --weekly +@itemx -W Synonym for @code{--period "weekly"} @item --wide @@ -5969,6 +6102,7 @@ Let the register report use 132 columns. Identical to @code{--columns "132"} @item --yearly +@itemx -Y Synonym for @code{--period "yearly"} @end ftable @@ -6021,8 +6155,8 @@ example init file: Option settings on the command-line or in the environment always take precedence over settings in the init file. -@item --account @var{NAME} -@itemx -a @var{NAME} +@item --account @var{STR} +@itemx -a @var{STR} Specify the default account which QIF file postings are assumed to relate to. @end ftable @@ -6051,8 +6185,8 @@ first matching transaction. (Note: This is different from using Constrain the report so that transactions on or after @var{DATE} are not considered. The ending date is inclusive. -@item --period @var{STR} -@itemx -p @var{STR} +@item --period @var{PERIOD_EXPRESSION} +@itemx -p @var{PERIOD_EXPRESSION} Set the reporting period to @var{STR}. This will subtotal all matching transactions within each period separately, making it easy to see weekly, monthly, quarterly, etc., posting totals. A period string can @@ -6060,7 +6194,7 @@ even specify the beginning and end of the report range, using simple terms like ``last June'' or ``next month''. For more using period expressions, see @ref{Period Expressions}. -@item --period-sort @var{EXPR} +@item --period-sort @var{VEXPR} Sort the postings within each reporting period using the value expression @var{EXPR}. This is most often useful when reporting monthly expenses, in order to view the highest expense categories at @@ -6228,7 +6362,7 @@ Report posting totals by month; @itemx -Y Report posting totals by year. For more complex period, using the -@item --period @var{STR} +@item --period @var{PERIOD_EXPRESSION} Option described above. @item --dow @@ -6320,22 +6454,22 @@ Which is more useful depends on what you're looking to know: the total amount for the reporting range (@code{-p}), or simply a display restricted to the reporting range (using @code{-d}). -@item --date-format @var{STR} -@itemx -y @var{STR} +@item --date-format @var{DATE_FORMAT} +@itemx -y @var{DATE_FORMAT} Change the basic date format used by reports. The default uses a date like @code{2004/08/01}, which represents the default date format of @code{%Y/%m/%d}. To change the way dates are printed in general, the -easiest way is to put @code{--date-format FORMAT} in the Ledger -initialization file @file{~/.ledgerrc} (or the file referred to by -@env{LEDGER_INIT}). +easiest way is to put @code{--date-format @var{DATE_FORMAT}} in the +Ledger initialization file @file{~/.ledgerrc} (or the file referred to +by @env{LEDGER_INIT}). -@item --format @var{STR} -@itemx -F @var{STR} +@item --format @var{FORMAT_STRING} +@itemx -F @var{FORMAT_STRING} Set the reporting format for whatever report ledger is about to make. @xref{Format Strings}. There are also specific format commands for each report type: -@item --balance-format @var{STR} +@item --balance-format @var{FORMAT_STRING} Define the output format for the @code{balance} report. The default (defined in @code{report.h} is: @@ -6368,7 +6502,7 @@ Define the format for the cleared report. The default is: ---------------- ---------------- ---------\n" @end smallexample -@item --register-format @var{STR} +@item --register-format @var{FORMAT_STRING} Define the output format for the @code{register} report. The default (defined in @code{report.h} is: @@ -6406,7 +6540,7 @@ Define the output format for the @code{register} report. The default %$3 %$4 %$5\n" @end smallexample -@item --csv-format +@item --csv-format @var{FORMAT_STRING} Set the format for @code{csv} reports. The default is: @smallexample @@ -6420,7 +6554,7 @@ Set the format for @code{csv} reports. The default is: %(quoted(join(note | xact.note)))\n" @end smallexample -@item --plot-amount-format @var{STR} +@item --plot-amount-format @var{FORMAT_STRING} Set the format for amount plots, using the @code{-j} option. The default is: @@ -6428,7 +6562,7 @@ default is: "%(format_date(date, \"%Y-%m-%d\")) %(quantity(scrub(display_amount)))\n" @end smallexample -@item --plot-total-format @var{STR} +@item --plot-total-format @var{FORMAT_STRING} Set the format for total plots, using the @code{-J} option. The default is: @@ -6436,14 +6570,14 @@ default is: "%(format_date(date, \"%Y-%m-%d\")) %(quantity(scrub(display_total)))\n" @end smallexample -@item --pricedb-format @var{STR} +@item --pricedb-format @var{FORMAT_STRING} Set the format expected for the historical price file. The default is @smallexample "P %(datetime) %(display_account) %(scrub(display_amount))\n" @end smallexample -@item --prices-format @var{STR} +@item --prices-format @var{FORMAT_STRING} Set the format for the @command{prices} report. The default is: @smallexample @@ -6531,14 +6665,14 @@ commodity can mean different things to different people, depending on the accounts involved, the commodities, the nature of the transactions, etc. -@findex --now +@findex --now @var{DATE} When you specify @code{-V}, or @code{-X @var{COMMODITY}}, you are requesting that some or all of the commodities be valuated as of today -(or whatever @code{--now} is set to). But what does such a valuation -mean? This meaning is governed by the presence of a @code{VALUE} -meta-data property, whose content is an expression used to compute -that value. +(or whatever @code{--now @var{DATE}} is set to). But what does such +a valuation mean? This meaning is governed by the presence of +a @code{VALUE} meta-data property, whose content is an expression used +to compute that value. If no VALUE property is specified, each posting is assumed to have a default, as if you'd specified a global, automated transaction as @@ -6550,8 +6684,8 @@ follows: @end smallexample This definition emulates the present day behavior of @code{-V} and -@code{-X} (in the case of @code{-X}, the requested commodity is passed -via the string 'exchange' above). +@code{-X @var{COMMODITY}} (in the case of @code{-X}, the requested +commodity is passed via the string @samp{exchange} above). @cindex Euro conversion One thing many people have wanted to do is to fixate the valuation of @@ -6562,9 +6696,9 @@ old European currencies in terms of the Euro after a certain date: ; VALUE:: date < [Jun 2008] ? market(amount, date, exchange) : 1.44 EUR @end smallexample -This says: If @code{--now} is some old date, use market prices as they -were at that time; but if @code{--now} is past June 2008, use a fixed -price for converting Deutsch Mark to Euro. +This says: If @code{--now @var{DATE}} is some old date, use market +prices as they were at that time; but if @code{--now @var{DATE}} is +past June 2008, use a fixed price for converting Deutsch Mark to Euro. Or how about never re-valuating commodities used in Expenses, since they cannot have a different future value: @@ -6576,7 +6710,7 @@ they cannot have a different future value: This says the future valuation is the same as the valuation at the time of posting. post.date equals the posting's date, while just 'date' is -the value of @code{--now} (defaults to today). +the value of @code{--now @var{DATE}} (defaults to today). Or how about valuating miles based on a reimbursement rate during a specific time period: @@ -6587,7 +6721,7 @@ specific time period: @end smallexample In this case, miles driven in 2007 will always be valuated at $1.05 -each. If you use @code{-X EUR} to expressly request all amounts in +each. If you use @samp{-X EUR} to expressly request all amounts in Euro, Ledger shall convert $1.05 to Euro by whatever means are appropriate for dollars. @@ -6611,7 +6745,7 @@ the function 'market' so it can be further revalued if the user has asked for a specific currency. Or, if it better suits your accounting, you can be less symbolic, -which allows you to report most everything in EUR if you use @code{-X +which allows you to report most everything in EUR if you use @samp{-X EUR}, except for certain accounts or postings which should always be valuated in another currency. For example: @@ -6638,8 +6772,8 @@ also balance against itself, and against any AAPL if @code{--lots} is not specified. But if you do specify @code{--lot-prices}, for example, then it will balance against that specific price for AAPL. -Normally when you use @code{-X @var{COMMODITY}} to request that amounts be -reported in a specific commodity, Ledger uses these values: +Normally when you use @code{-X @var{COMMODITY}} to request that +amounts be reported in a specific commodity, Ledger uses these values: @itemize @item Register Report @@ -6654,9 +6788,9 @@ For the balance report, use the value of that commodity as of today. You can now specify @code{-H} to ask that all valuations for any amount be done relative to the date that amount was encountered. -You can also now use @code{-X} (and @code{-H}) in conjunction with -@code{-B} and @code{-I}, to see valuation reports of just your basis -costs or lot prices. +You can also now use @code{-X @var{COMMODITY}} (and @code{-H}) in +conjunction with @code{-B} and @code{-I}, to see valuation reports of +just your basis costs or lot prices. @node Environment Variables, , Commodity Reporting, Detailed Options Description @subsection Environment variables @@ -6788,19 +6922,19 @@ payee. For example: @smallexample ~ Monthly - Expenses:Rent $500.00 - Expenses:Food $450.00 - Expenses:Auto:Gas $120.00 - Expenses:Insurance $150.00 - Expenses:Phone $125.00 - Expenses:Utilities $100.00 - Expenses:Movies $50.00 - Expenses $200.00 ; all other expenses - Assets + Expenses:Rent $500.00 + Expenses:Food $450.00 + Expenses:Auto:Gas $120.00 + Expenses:Insurance $150.00 + Expenses:Phone $125.00 + Expenses:Utilities $100.00 + Expenses:Movies $50.00 + Expenses $200.00 ; all other expenses + Assets ~ Yearly - Expenses:Auto:Repair $500.00 - Assets + Expenses:Auto:Repair $500.00 + Assets @end smallexample These two period transactions give the usual monthly expenses, as well @@ -7175,54 +7309,60 @@ Useful specifying a date in plain terms. For example, you could say @node Misc, , Complex Expressions, Complex Expressions @subsection Miscellaneous -@multitable @columnfractions .3 .2 .5 -@headitem Function @tab Abbrev. @tab Description -@item @code{amount_expr} @tab @code{} @tab -@item @code{abs} @tab @code{} @tab --> U -@item @code{ceiling} @tab @code{} @tab Return the next integer toward +infinity -@item @code{code} @tab @code{} @tab Return the transaction code, the string between the parenthesis after the date. -@item @code{commodity} @tab @code{} @tab -@item @code{display_amount} @tab @code{} @tab --> t -@item @code{display_total} @tab @code{} @tab --> T -@item @code{date} @tab @code{} @tab -@item @code{format_date} @tab @code{} @tab -@item @code{format} @tab @code{} @tab -@item @code{floor} @tab @code{} @tab Return the next integer toward -infinity -@item @code{get_at} @tab @code{} @tab -@item @code{is_seq} @tab @code{} @tab -@item @code{justify} @tab @code{} @tab -@item @code{join} @tab @code{} @tab -@item @code{market --> P} @tab @code{} @tab -@item @code{null} @tab @code{} @tab -@item @code{now --> d m} @tab @code{} @tab -@item @code{options} @tab @code{} @tab -@item @code{post} @tab @code{} @tab -@item @code{percent} @tab @code{} @tab -@item @code{price} @tab @code{} @tab -@item @code{print} @tab @code{} @tab -@item @code{quoted} @tab @code{} @tab -@item @code{quantity} @tab @code{} @tab -@item @code{rounded} @tab @code{} @tab -@item @code{roundto} @tab @code{} @tab Return value rounded to n digits. Does not affect formatting. -@item @code{scrub} @tab @code{} @tab -@item @code{strip --> S} @tab @code{} @tab -@item @code{should_bold} @tab @code{} @tab -@item @code{truncated} @tab @code{} @tab -@item @code{total_expr} @tab @code{} @tab -@item @code{today} @tab @code{} @tab -@item @code{top_amount} @tab @code{} @tab -@item @code{to_boolean} @tab @code{} @tab -@item @code{to_int} @tab @code{} @tab -@item @code{to_datetime} @tab @code{} @tab -@item @code{to_date} @tab @code{} @tab -@item @code{to_amount} @tab @code{} @tab -@item @code{to_balance} @tab @code{} @tab -@item @code{to_spring} @tab @code{} @tab -@item @code{to_mask} @tab @code{} @tab -@item @code{to_sequence} @tab @code{} @tab -@item @code{unrounded} @tab @code{} @tab -@item @code{value_date} @tab @code{} @tab -@end multitable +@table @code +@item abs--> U +@item amount_expr +@item ansify_if +@item ceiling +Return the next integer toward +infinity +@item code +Return the transaction code, the string between the parenthesis after the date. +@item commodity +@item date +@item display_amount --> t +@item display_total --> T +@item floor +Return the next integer toward -infinity +@item format +@item format_date +@item format_datetime +@item get_at +@item is_seq +@item join +@item justify +@item market --> P +@item nail_down +@item now --> d m +@item options +@item percent +@item print +@item quantity +@item quoted +@item round +@item rounded +@item roundto +Return value rounded to n digits. Does not affect formatting. +@item scrub +@item should_bold +@item strip --> S +@item to_amount +@item to_balance +@item to_boolean +@item to_date +@item to_datetime +@item to_int +@item to_mask +@item to_sequence +@item to_spring +@item today +@item top_amount +@item total_expr +@item trim +@item truncated +@item unround +@item unrounded +@item value_date +@end table @node Format Strings, Extending with Python, Value Expressions, Top @chapter Format Strings @@ -7237,8 +7377,8 @@ Useful specifying a date in plain terms. For example, you could say @node Basics, Format String Structure, Format Strings, Format Strings @section Format String Basics -@findex --format @var{STR} -@findex -F @var{STR} +@findex --format @var{FORMAT_STRING} +@findex -F @var{FORMAT_STRING} @findex --balance-report @findex --cleared-report @findex --register-report @@ -7405,8 +7545,8 @@ same format string is used for all postings. @node --balance-format, Formatting codes, Format Expressions, Format Strings @section --balance-format -@findex --balance-format @var{STR} -@findex --format @var{STR} +@findex --balance-format @var{FORMAT_STRING} +@findex --format @var{FORMAT_STRING} As an example of how flexible the @code{--format} strings can be, the default balance format looks like this (the various functions are @@ -7458,7 +7598,7 @@ terminal character colors and font highlights in a normal TTY session. @item @code{red} @tab @code{magenta} @tab @code{bold} @item @code{green} @tab @code{cyan} @tab @code{underline} @item @code{yellow} @tab @code{white} @tab @code{blink} -@item @code{blue} +@item @code{blue} @tab @code{black} @end multitable @node Quantities and Calculations, Dates, Colors, Formatting codes @@ -7490,7 +7630,7 @@ terminal character colors and font highlights in a normal TTY session. @node Dates, Date and Time Format Codes, Quantities and Calculations, Formatting codes @subsection Date Functions -@findex --now +@findex --now @var{DATE} The following functions allow you to manipulate and format dates. @@ -7500,10 +7640,10 @@ Return the date of the current transaction @item format_date(date, "FORMAT_STRING") Format the date using the given format string. @item now -Return the current date and time. If the @code{--now} option is -defined it will return that value. +Return the current date and time. If the @code{--now @var{DATE}} +option is defined it will return that value. @item today -Return the current date. If the @code{--now} option is +Return the current date. If the @code{--now @var{DATE}} option is defined it will return that value. @item to_datetime Convert a string to a date-time value @@ -8378,11 +8518,13 @@ commodities. @node echo, reload, Developer Commands, Developer Commands @subsection @command{echo} +@findex echo This command simply echoes its argument back to the output. @node reload, source, echo, Developer Commands @subsection @command{reload} +@findex reload Forces ledger to reload any journal files. This function exists to support external programs controlling a running ledger process and does @@ -8390,6 +8532,7 @@ nothing for a command line user. @node source, Debug Options, reload, Developer Commands @subsection @command{source} +@findex source The @code{source} command take a journal file as an argument and parses it checking for errors, no other reports are generated, and no other @@ -8404,13 +8547,7 @@ use to a user trying something new. @ftable @code @item --args-only -Ignore init -files and environment variables for the ledger run. - -@item --verify -Enable additional assertions during run-time. This causes a significant -slowdown. When combined with @code{--debug} ledger will produce -memory trace information. +Ignore init files and environment variables for the ledger run. @item --debug @var{CODE} If Ledger has been built with debug options this will provide extra @@ -8465,6 +8602,14 @@ Enable tracing. The @var{INT} specifies the level of trace desired: @item --verbose Print detailed information on the execution of Ledger. +@item --verify +Enable additional assertions during run-time. This causes a significant +slowdown. When combined with @code{--debug} ledger will produce +memory trace information. + +@item --verify-memory +FIXME + @item --version Print version information and exit. @end ftable @@ -8535,7 +8680,7 @@ END_REACHED: @end smallexample @item query -Evaluate the given query and report how Ledger interprets it against +Evaluate the given arguments and report how Ledger interprets it against the model transaction: @smallexample @@ -8574,6 +8719,9 @@ $ ledger query "/Book/" true @end smallexample +@item script +FIXME + @item template Shows the insertion template that a @code{draft} or @code{xact} sub-command generates. This is a debugging command. -- cgit v1.2.3 From 68dde8cda690e44bd88ce247ac5d86d00b062fa0 Mon Sep 17 00:00:00 2001 From: thdox Date: Sun, 28 Apr 2013 23:04:10 +0200 Subject: Some cleanup on pre-commands --- doc/ledger3.texi | 44 ++++++++++++++------------------------------ 1 file changed, 14 insertions(+), 30 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index a5e24407..de5b9b00 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -3525,7 +3525,7 @@ gives you your cash basis income in the same two weeks. Another use is distributing costs out in time. As an example, suppose you just prepaid into a local vegetable co-op that sustains you -through the winter. It cost $225 to join the program, so you write +through the winter. It costs $225 to join the program, so you write a check. You don't want your October grocery budget to be blown because you bought food ahead, however. What you really want is for the money to be evenly distributed over the next six months so that @@ -5467,7 +5467,7 @@ of every account reported in a balance report or register report. @item --account-width @var{INT} Set the width of the account column in the @command{register} report -to @code{INT} characters. +to @var{INT} characters. @item --actual @itemx -L @@ -7420,20 +7420,20 @@ Within a format string, a substitution is specified using a percent %[-][MIN WIDTH][.MAX WIDTH](VALEXPR) @end smallexample -If the optional minus sign @samp{-} follows the percent character, -whatever is substituted will be left justified. The default is right -justified. If a minimum width is given next, the substituted text -will be at least that wide, perhaps wider. If a period and a maximum -width is given, the substituted text will never be wider than this, -and will be truncated to fit. Here are some examples: +If the optional minus sign @samp{-} follows the percent character +@samp{%}, whatever is substituted will be left justified. The default +is right justified. If a minimum width is given next, the substituted +text will be at least that wide, perhaps wider. If a period and +a maximum width is given, the substituted text will never be wider +than this, and will be truncated to fit. Here are some examples: @table @code @item %-20P A transaction's payee, left justified and padded to 20 characters wide. @item %20P -The same, right justified, at least 20 chars wide +The same, right justified, at least 20 chars wide. @item %.20P -The same, no more than 20 chars wide +The same, no more than 20 chars wide. @end table The expression following the format constraints can be a single letter, @@ -8624,27 +8624,9 @@ is that pre-commands ignore the journal data file completely, nor is the user's init file read. @ftable @code -@item args -Evaluate the given arguments against the following model transaction: - -@smallexample -2004/05/27 Book Store - ; This note applies to all postings. :SecondTag: - Expenses:Books 20 BOOK @@ $10 - ; Metadata: Some Value - ; Typed:: $100 + $200 - ; :ExampleTag: - ; Here follows a note describing the posting. - Liabilities:MasterCard $-200.00 -@end smallexample - @item eval @var{VEXPR} Evaluate the given value expression against the model transaction -@item expr "LIMIT EXPRESSION" -Print details of how ledger parses the given limit expression and apply -it against a model transaction. - @item format @var{FORMAT_STRING} Print details of how ledger uses the given formatting description and apply it against a model transaction. @@ -8654,10 +8636,11 @@ Randomly generates syntactically valid Ledger data from a seed. Used by the GenerateTests harness for development testing @item parse @var{VEXPR} +@itemx expr @var{VEXPR} Print details of how ledger uses the given value expression description and apply it against a model transaction. -@item period +@item period @var{PERIOD_EXPRESSION} Evaluate the given period and report how Ledger interprets it: @smallexample @@ -8680,8 +8663,9 @@ END_REACHED: @end smallexample @item query +@itemx args Evaluate the given arguments and report how Ledger interprets it against -the model transaction: +the following model transaction: @smallexample $ ledger query "/Book/" -- cgit v1.2.3 From 600a9c5d3becb9c06e6006e6c752f1f45819efea Mon Sep 17 00:00:00 2001 From: thdox Date: Mon, 29 Apr 2013 22:00:36 +0200 Subject: Change from -report to -format as -report can not be found in source code --- doc/ledger3.texi | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index de5b9b00..d07ca0cb 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -7379,14 +7379,15 @@ Return value rounded to n digits. Does not affect formatting. @section Format String Basics @findex --format @var{FORMAT_STRING} @findex -F @var{FORMAT_STRING} -@findex --balance-report -@findex --cleared-report -@findex --register-report -@findex --csv-report -@findex --plot-amount-report -@findex --plot-total-report -@findex --pricedb-report -@findex --prices-report +@findex --balance-format +@findex --budget-format +@findex --cleared-format +@findex --csv-format +@findex --plot-amount-format +@findex --plot-total-format +@findex --pricedb-format +@findex --prices-format +@findex --register-format Format strings may be used to change the output format of reports. They are specified by passing a formatting string to the @code{-F @@ -7400,14 +7401,15 @@ file and will allow you to run ledger reports from the command line without having to enter a new format for each command. @itemize -@item @code{--balance-report} -@item @code{--cleared-report} -@item @code{--register-report} -@item @code{--csv-report} -@item @code{--plot-amount-report} -@item @code{--plot-total-report} -@item @code{--pricedb-report} -@item @code{--prices-report} +@item @code{--balance-format} +@item @code{--budget-format} +@item @code{--cleared-format} +@item @code{--csv-format} +@item @code{--plot-amount-format} +@item @code{--plot-total-format} +@item @code{--pricedb-format} +@item @code{--prices-format} +@item @code{--register-format} @end itemize @node Format String Structure, Format Expressions, Basics, Format Strings -- cgit v1.2.3 From 1cca1c1ef05b2d1ed6529d945a3e1317d882b79a Mon Sep 17 00:00:00 2001 From: thdox Date: Mon, 29 Apr 2013 22:12:26 +0200 Subject: Moved to "FIX THIS ENTRY" for consistency --- doc/ledger3.texi | 62 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index d07ca0cb..cd1b59a8 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -4889,13 +4889,13 @@ backwards compatibility with Ledger 2.X. @findex stats @findex stat -FIXME +FIX THIS ENTRY @c FIXME thdox @node select, , stats, Reports about your Journals @subsection @code{select} @findex select -FIXME +FIX THIS ENTRY @c FIXME thdox @node Command-line Syntax, Budgeting and Forecasting, Reporting Commands, Top @chapter Command-line Syntax @@ -5258,7 +5258,7 @@ or testing small Journal files not associated with you main financial database. @item --debug @var{CODE} -FIXME TD +FIX THIS ENTRY @c FIXME thdox @item --help @itemx -h @@ -5311,20 +5311,20 @@ a function called @code{normalize_options}. Execute a ledger script. @item --trace @var{INT} -FIXME TD +FIX THIS ENTRY @c FIXME thdox @item --verbose @itemx -v -FIXME TD +FIX THIS ENTRY @c FIXME thdox @item --verify -FIXME TD +FIX THIS ENTRY @c FIXME thdox @item --verify-memory -FIXME TD +FIX THIS ENTRY @c FIXME thdox @item --version -FIXME TD +FIX THIS ENTRY @c FIXME thdox @end ftable @node Session Options, Report Options, Global Options, Detailed Options Description @@ -5339,13 +5339,13 @@ sessions with multiple reports per session. @ftable @code @item --cache @var{FIXME} -FIXME +FIX THIS ENTRY @c FIXME thdox @item --check-payees -FIXME +FIX THIS ENTRY @c FIXME thdox @item --day-break -FIXME +FIX THIS ENTRY @c FIXME thdox @item --decimal-comma Direct Ledger to parse journals using the European standard comma as @@ -5357,7 +5357,7 @@ Direct Ledger to download prices using the script defined in @code{--getquote @var{FILE}}. @item --explicit -FIXME +FIX THIS ENTRY @c FIXME thdox @item --file @var{FILE} @itemx -f @var{FILE} @@ -5408,10 +5408,10 @@ $ ledger -f test/input/drewr3.dat bal --master-account HUMBUG @end smallexample @item --pedantic -FIXME +FIX THIS ENTRY @c FIXME thdox @item --permissive -FIXME +FIX THIS ENTRY @c FIXME thdox @item --price-db @var{FILE} Specify the location of the price entry data file. @@ -5435,10 +5435,10 @@ it will issue a warning giving you the file and line number of the problem. @item --time-colon -FIXME +FIX THIS ENTRY @c FIXME thdox @item --value-expr @var{FIXME} -FIXME +FIX THIS ENTRY @c FIXME thdox @end ftable @node Report Options, Basic options, Session Options, Detailed Options Description @@ -5496,7 +5496,7 @@ Set the width in characters of the amount column in the Anonymize registry output, mostly for sending in bug reports. @item --auto-match -FIXME +FIX THIS ENTRY @c FIXME thdox @item --aux-date @itemx --effective @@ -5520,7 +5520,7 @@ Strings}). The default is: @end smallexample @item --base -ASK JOHN +FIX THIS ENTRY @c ASK JOHN @item --basis @itemx -B @@ -5570,7 +5570,7 @@ Consider only transaction that have been cleared for display and calculation. @item --cleared-format @var{FORMAT_STRING} -FIXME: to keep? +FIX THIS ENTRY @c FIXME thdox: to keep? Specify the format to use for the @code{cleared} report (@pxref{Format Strings}). The default is: @@ -5641,7 +5641,7 @@ Specify the width, in characters, of the date column in the @command{register} report. @item --datetime-format @var{FIXME} -ASK JOHN +FIX THIS ENTRY @c ASK JOHN @item --dc Display register or balance in debit/credit format If you use @@ -5748,7 +5748,7 @@ equity Command}). Gives current account balances in the form of a register report. @item --exact -ASK JOHN +FIX THIS ENTRY @c ASK JOHN @item --exchange @var{COMMODITY} @itemx -X @var{COMMODITY} @@ -5816,10 +5816,10 @@ Print the first @var{INT} entries. Opposite of @code{--tail}. @item --historical @itemx -H -FIXME +FIX THIS ENTRY @c FIXME thdox @item --immediate -FIXME +FIX THIS ENTRY @c FIXME thdox @item --inject Use @code{Expected} amounts in calculations. In the case that you know @@ -5970,10 +5970,10 @@ Reserve @var{INT} spaces at the beginning of each line of the output. Use the price of the commodity purchase for performing calculations. @item --pricedb-format @var{FORMAT_STRING} -FIXME +FIX THIS ENTRY @c FIXME thdox @item --prices-format @var{FORMAT_STRING} -FIXME +FIX THIS ENTRY @c FIXME thdox @item --primary-date @itemx --actual-dates @@ -5998,7 +5998,7 @@ Account using only real transactions ignoring virtual and automatic transactions. @item --register-format @var{FORMAT_STRING} -FIXME +FIX THIS ENTRY @c FIXME thdox @item --related In a register report show the related account. This is the other @@ -6019,7 +6019,7 @@ FIX THIS ENTRY @item --rich-data @itemx --detail -FIXME +FIX THIS ENTRY @c FIXME thdox @item --seed @var{FIXME} Set the random seed for the @code{generate} command. Used as part of @@ -6050,7 +6050,7 @@ Report only the last @var{INT} entries. Only useful on a register report. @item --time-report -FIXME +FIX THIS ENTRY @c FIXME thdox @item --total @var{VEXPR} @itemx -T @var{VEXPR} @@ -6091,7 +6091,7 @@ Perform all calculations without rounding and display results to full precision. @item --values -FIXME +FIX THIS ENTRY @c FIXME thdox @item --weekly @itemx -W @@ -8610,7 +8610,7 @@ slowdown. When combined with @code{--debug} ledger will produce memory trace information. @item --verify-memory -FIXME +FIX THIS ENTRY @c FIXME thdox @item --version Print version information and exit. @@ -8706,7 +8706,7 @@ true @end smallexample @item script -FIXME +FIX THIS ENTRY @c FIXME thdox @item template Shows the insertion template that a @code{draft} or @code{xact} -- cgit v1.2.3