Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FiniteStateMachine._latex_: more options, better documentation #16207

Closed
cheuberg opened this issue Apr 22, 2014 · 18 comments
Closed

FiniteStateMachine._latex_: more options, better documentation #16207

cheuberg opened this issue Apr 22, 2014 · 18 comments

Comments

@cheuberg
Copy link
Contributor

Improved FiniteStateMachine._latex_:

  • use state iterators instead of lists

  • move code format_transition_label

  • collect tikz options in array

  • typeset final_word_out, introduce relevant options: if a final state has an attribute final_word_out, this is typeset as a leaving edge. This is in preparation for FiniteStateMachine: implement final_word_out #16191

  • new method latex_options: Provide a new convenience function collecting all options for LaTeX output. While all of its functionality can also be achieved by directly setting attributes of FiniteStateMachine, FSMState and FSMTransition, this function also (somewhat) checks its input and serves to collect documentation on all these options.

  • Added a section in the introduction to the module explaining how to latex a FiniteStateMachine and pointing to this method for details.

  • Similarly, expanded explanations in setup_latex_preamble.

  • Use latex_options in other doctest instead of direct attribute assignment

  • new method default_format_transition_label: Previously, when no custorm FiniteStateMachine.format_transition_label was provided by the user, words have simply typeset by calling latex. As words are always lists, parentheses [ ] have always been printed.
    This new default method typesets words by juxtaposition of their letters, the letters are piped through format_letter first. The latter now defaults to latex.

    Finally, format_transition_label is by default set to default_format_transition_label in the hope of providing a sensible default value.

  • Convenience Formatting functions for digit problems: When using negative digits, it is quite customary to write e.g. \overline{1} instead of -1 in LaTeX. Introduce FiniteStateMachine.format_letter_negative for this purpose.

    Furthermore, In digit expansions, digits are frequently processed from the least significant to the most significant position, but it is customary to write the least significant digit at the right-most position. Therefore, the labels have to be reversed. Provide a method FiniteStateMachine.format_transition_label_reversed for this purpose.

Depends on #16132
Depends on #16145
Depends on #16146
Depends on #16200
Depends on #16205

CC: @dkrenn @sagetrac-skropf

Component: combinatorics

Author: Clemens Heuberger

Branch/Commit: e5a3191

Reviewer: Daniel Krenn

Issue created by migration from https://trac.sagemath.org/ticket/16207

@cheuberg cheuberg added this to the sage-6.2 milestone Apr 22, 2014
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 22, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

fe9b380marked 3 doctests as indirect
92526f6Merge branch 'fsm/latex-initial-state-new' into fsm/latex-rotate-labels-new
0bd8c5aMerge branch 'fsm/latex-rotate-labels-new' #16205 into fsm/latex-improved
2438f93replaced range by srange
1e294f2replace \overline{-1} by \overline{1}
53a700cMoved FiniteStateMachine._latex_.accepting_where to finite_state_machine.tikz_automata_where

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 22, 2014

Changed commit from d6661e7 to 53a700c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 22, 2014

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

2d43fddFiniteStateMachine: add failing doctests: non-hashable colors
547968aFiniteStateMachine.product_FiniteStateMachine, composition: fix unhashable colors
d51be51Automaton.determinisation(): docstring on hashable colors
c5dd860Merge branch 'fsm/state_color' into fsm/process_output_new
70294bftrac ticket number added
ed93dd3Minor changes during review.
3820c49corrected whitespaceerror
a14dd81Merge remote-tracking branch 'origin/u/dkrenn/ticket/16132' into fsm/process_output_new-on-beta8
afc15e5Replaced two raise ..., ... by raise ...(...) in the spirit of #15990
4aee511Merge ticket #16132 into #16207 in order to resolve merge conflict.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 22, 2014

Changed commit from 53a700c to 4aee511

@cheuberg
Copy link
Contributor Author

Changed dependencies from #16146, #16200, #16205 to #16132, #16146, #16200, #16205

@cheuberg
Copy link
Contributor Author

comment:4

Merged #16132, otherwise, this will not merge (commit 53a700c introduced a new module local variable at the same position where #16132 did the same).

@cheuberg
Copy link
Contributor Author

comment:5

trac's automerge fails. Patch is based on 6.2.beta8, it merges cleanly with 6.2.rc0.

@dkrenn
Copy link
Contributor

dkrenn commented Apr 23, 2014

Reviewer: Daniel Krenn

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 24, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

a6a417dFiniteStateMachine._latex_: write final_word_out as "$ | output"
1f14955FiniteStateMachine._latex_: use tikz arrow style "latex"
56b1d48default accepting_distance=7ex because of $ in final output

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 24, 2014

Changed commit from 4aee511 to 56b1d48

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 24, 2014

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

f13725dasymptotic_moments: add explanation on PolynomialRing vs SymbolicRing
878acffasymptotic_moments: replaced parameter verbose by sage.misc.misc.verbose
40da528Explanations for >1 final components, periodic final components
00e063easymptotic_moments: upgraded two tests to examples
1908a5dasymptotic_moments: unique initial states, all states are final
78997f5Corrected and improved version of commit 40da528
d56a769Rewrote asymptotic_moments to output en+Order(1) etc.
24b6d69explained the shifting in the Gray code-construction differently
0b1200dMerge branch 't/16143/fsm/example_gray_code' into fsm/asymptotic-moments
a0d894eMerge remote-tracking branch 'aau/fsm/asymptotic-moments' into fsm/latex-options-digits

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 24, 2014

Changed commit from 56b1d48 to a0d894e

@cheuberg
Copy link
Contributor Author

Changed dependencies from #16132, #16146, #16200, #16205 to #16132, #16145, #16146, #16200, #16205

@cheuberg
Copy link
Contributor Author

comment:10

merged #16145 in order to avoid a merge conflict and listed #16145 as a dependency.

@dkrenn
Copy link
Contributor

dkrenn commented May 2, 2014

Changed branch from u/cheuberg/fsm/latex-improved to u/dkrenn/fsm/latex-improved

@dkrenn
Copy link
Contributor

dkrenn commented May 2, 2014

comment:12

finished my review; everything is fine; corrected one PEP8-spacing.


New commits:

e5a3191corrected one spacing (PEP8)

@dkrenn
Copy link
Contributor

dkrenn commented May 2, 2014

Changed commit from a0d894e to e5a3191

@vbraun
Copy link
Member

vbraun commented May 7, 2014

Changed branch from u/dkrenn/fsm/latex-improved to e5a3191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants